]> git.mxchange.org Git - friendica.git/blobdiff - mod/events.php
Merge pull request #2172 from tobiasd/20151212-frosticons
[friendica.git] / mod / events.php
index bf53286c2032173488da80cab4900a404c488bed..653ae489b8f97c8022fe68fcd6f7513e4b5fe009 100644 (file)
@@ -154,6 +154,7 @@ function events_post(&$a) {
        if(! $cid)
                proc_run('php',"include/notifier.php","event","$item_id");
 
+       goaway($_SESSION['return_url']);
 }
 
 
@@ -165,6 +166,9 @@ function events_content(&$a) {
                return;
        }
 
+       if($a->argc == 1)
+               $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
+
        if(($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
                $r = q("update event set ignore = 1 where id = %d and uid = %d",
                        intval($a->argv[2]),
@@ -505,7 +509,7 @@ function events_content(&$a) {
                else
                        $sh_checked = (($orig_event['allow_cid'] === '<' . local_user() . '>' && (! $orig_event['allow_gid']) && (! $orig_event['deny_cid']) && (! $orig_event['deny_gid'])) ? '' : ' checked="checked" ' );
 
-               if($cid)
+               if($cid OR ($mode !== 'new'))
                        $sh_checked .= ' disabled="disabled" ';
 
 
@@ -536,6 +540,9 @@ function events_content(&$a) {
 
                require_once('include/acl_selectors.php');
 
+               if ($mode === 'new')
+                       $acl = (($cid) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $a->user)));
+
                $tpl = get_markup_template('event_form.tpl');
 
                $o .= replace_macros($tpl,array(
@@ -563,7 +570,7 @@ function events_content(&$a) {
                        '$sh_text' => t('Share this event'),
                        '$sh_checked' => $sh_checked,
                        '$preview' => t('Preview'),
-                       '$acl' => (($cid) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $a->user))),
+                       '$acl' => $acl,
                        '$submit' => t('Submit')
 
                ));