aboutsummaryrefslogtreecommitdiffstats
path: root/mod/events.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/events.php')
-rwxr-xr-xmod/events.php25
1 files changed, 18 insertions, 7 deletions
diff --git a/mod/events.php b/mod/events.php
index 8bf8c6ce1..911b6c891 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -125,9 +125,10 @@ function events_post(&$a) {
$datarray['created'] = $created;
$datarray['edited'] = $edited;
- $item_id = event_store($datarray);
+ $event = event_store_event($datarray);
+ $item_id = event_store_item($datarray,$event);
- if(! $cid)
+ if($share)
proc_run('php',"include/notifier.php","event","$item_id");
}
@@ -158,10 +159,11 @@ function events_content(&$a) {
}
- $plaintext = true;
+ $plaintext = true;
+
+ if(feature_enabled(local_user(),'richtext'))
+ $plaintext = false;
- if(feature_enabled(local_user(),'richtext'))
- $plaintext = false;
$htpl = get_markup_template('event_head.tpl');
@@ -189,6 +191,10 @@ function events_content(&$a) {
$mode = 'edit';
$event_id = argv(2);
}
+ if(argc() > 2 && argv(1) === 'add') {
+ $mode = 'add';
+ $item_id = intval(argv(2));
+ }
if(argv(1) === 'new') {
$mode = 'new';
$event_id = '';
@@ -200,6 +206,11 @@ function events_content(&$a) {
}
}
+ if($mode === 'add') {
+ event_addtocal($item_id,local_user());
+ killme();
+ }
+
if($mode == 'view') {
@@ -341,7 +352,7 @@ function events_content(&$a) {
'is_first'=>$is_first,
'item'=>$rr,
'html'=>$html,
- 'plink' => array($rr['plink'],t('link to source'),'',''),
+ 'plink' => array($rr['plink'],t('Link to Source'),'',''),
);
@@ -477,7 +488,7 @@ function events_content(&$a) {
'$t_orig' => $t_orig,
'$sh_text' => t('Share this event'),
'$sh_checked' => $sh_checked,
- '$acl' => (($orig_event['event_xchan']) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $perm_defaults))),
+ '$acl' => (($orig_event['event_xchan']) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $perm_defaults),false)),
'$submit' => t('Submit')
));