X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fevents.php;h=653ae489b8f97c8022fe68fcd6f7513e4b5fe009;hb=eeb462cd0460d029a8b9e29f3dd122eb16befec1;hp=ff615141705ceb0c3af8f04747396a7af4f4fae0;hpb=67638118e7eed76ee9b7a783af9ae0fc6f77f262;p=friendica.git diff --git a/mod/events.php b/mod/events.php index ff61514170..653ae489b8 100644 --- a/mod/events.php +++ b/mod/events.php @@ -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]), @@ -179,14 +183,18 @@ function events_content(&$a) { ); } + if ($a->theme_events_in_profile) + nav_set_selected('home'); + else + nav_set_selected('events'); $editselect = 'none'; if( feature_enabled(local_user(), 'richtext') ) $editselect = 'textareas'; // First day of the week (0 = Sunday) - // To-Do: Needs to be configurable - $firstDay = 0; + $firstDay = get_pconfig(local_user(),'system','first_day_of_week'); + if ($firstDay === false) $firstDay=0; $i18n = array( "firstDay" => $firstDay, @@ -249,7 +257,8 @@ function events_content(&$a) { $o =""; // tabs - $tabs = profile_tabs($a, True); + if ($a->theme_events_in_profile) + $tabs = profile_tabs($a, True); @@ -285,7 +294,7 @@ function events_content(&$a) { $m = intval($thismonth); // Put some limits on dates. The PHP date functions don't seem to do so well before 1900. - // An upper limit was chosen to keep search engines from exploring links millions of years in the future. + // An upper limit was chosen to keep search engines from exploring links millions of years in the future. if($y < 1901) $y = 1900; @@ -500,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" '; @@ -531,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( @@ -558,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') ));