diff options
Diffstat (limited to 'mod/events.php')
-rwxr-xr-x | mod/events.php | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/mod/events.php b/mod/events.php index 74b44906c..30cf5f303 100755 --- a/mod/events.php +++ b/mod/events.php @@ -93,8 +93,8 @@ function events_post(&$a) { //$action = ($event_hash == '') ? 'new' : "event/" . $event_hash; //fixme: this url gives a wsod if there is a linebreak detected in one of the variables ($desc or $location) - //$onerror_url = $a->get_baseurl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish&type=$type"; - $onerror_url = $a->get_baseurl() . "/events"; + //$onerror_url = z_root() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish&type=$type"; + $onerror_url = z_root() . "/events"; if(strcmp($finish,$start) < 0 && !$nofinish) { notice( t('Event can not end before it has started.') . EOL); @@ -116,9 +116,9 @@ function events_post(&$a) { $share = ((intval($_POST['share'])) ? intval($_POST['share']) : 0); - $channel = $a->get_channel(); + $channel = App::get_channel(); - $acl = new AccessList(false); + $acl = new Zotlabs\Access\AccessList(false); if($event_id) { $x = q("select * from event where id = %d and uid = %d limit 1", @@ -158,7 +158,7 @@ function events_post(&$a) { } $post_tags = array(); - $channel = $a->get_channel(); + $channel = App::get_channel(); $ac = $acl->get(); if(strlen($categories)) { @@ -281,21 +281,28 @@ function events_content(&$a) { $first_day = (($first_day) ? $first_day : 0); $htpl = get_markup_template('event_head.tpl'); - $a->page['htmlhead'] .= replace_macros($htpl,array( - '$baseurl' => $a->get_baseurl(), - '$lang' => $a->language, + App::$page['htmlhead'] .= replace_macros($htpl,array( + '$baseurl' => z_root(), + '$module_url' => '/events', + '$modparams' => 1, + '$lang' => App::$language, '$first_day' => $first_day )); $o = ''; - $channel = $a->get_channel(); + $channel = App::get_channel(); $mode = 'view'; $y = 0; $m = 0; $ignored = ((x($_REQUEST,'ignored')) ? " and ignored = " . intval($_REQUEST['ignored']) . " " : ''); + + // logger('args: ' . print_r(App::$argv,true)); + + + if(argc() > 1) { if(argc() > 2 && argv(1) === 'add') { $mode = 'add'; @@ -333,7 +340,7 @@ function events_content(&$a) { $orig_event = $r[0]; } - $channel = $a->get_channel(); + $channel = App::get_channel(); // Passed parameters overrides anything found in the DB if(!x($orig_event)) @@ -422,19 +429,19 @@ function events_content(&$a) { require_once('include/acl_selectors.php'); - $acl = new AccessList($channel); + $acl = new Zotlabs\Access\AccessList($channel); $perm_defaults = $acl->get(); $tpl = get_markup_template('event_form.tpl'); $form = replace_macros($tpl,array( - '$post' => $a->get_baseurl() . '/events', + '$post' => z_root() . '/events', '$eid' => $eid, '$type' => $type, '$xchan' => $event_xchan, '$mid' => $mid, '$event_hash' => $event_id, - '$summary' => array('summary', (($event_id) ? t('Edit event titel') : t('Event titel')), $t_orig, t('Required'), '*'), + '$summary' => array('summary', (($event_id) ? t('Edit event title') : t('Event title')), $t_orig, t('Required'), '*'), '$catsenabled' => $catsenabled, '$placeholdercategory' => t('Categories (comma-separated list)'), '$c_text' => (($event_id) ? t('Edit Category') : t('Category')), @@ -564,7 +571,7 @@ function events_content(&$a) { foreach($r as $rr) { $j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j')); if(! x($links,$j)) - $links[$j] = $a->get_baseurl() . '/' . $a->cmd . '#link-' . $j; + $links[$j] = z_root() . '/' . App::$cmd . '#link-' . $j; } } @@ -593,9 +600,9 @@ function events_content(&$a) { $last_date = $d; - $edit = ((local_channel() && $rr['author_xchan'] == get_observer_hash()) ? array($a->get_baseurl().'/events/'.$rr['event_hash'].'?expandform=1',t('Edit event'),'','') : false); + $edit = ((local_channel() && $rr['author_xchan'] == get_observer_hash()) ? array(z_root().'/events/'.$rr['event_hash'].'?expandform=1',t('Edit event'),'','') : false); - $drop = array($a->get_baseurl().'/events/drop/'.$rr['event_hash'],t('Delete event'),'',''); + $drop = array(z_root().'/events/drop/'.$rr['event_hash'],t('Delete event'),'',''); $title = strip_tags(html_entity_decode(bbcode($rr['summary']),ENT_QUOTES,'UTF-8')); if(! $title) { @@ -634,7 +641,7 @@ function events_content(&$a) { killme(); } - if ($a->argv[1] === 'json'){ + if (App::$argv[1] === 'json'){ echo json_encode($events); killme(); } @@ -647,11 +654,11 @@ function events_content(&$a) { } $o = replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(), - '$new_event' => array($a->get_baseurl().'/events',(($event_id) ? t('Edit Event') : t('Create Event')),'',''), - '$previus' => array($a->get_baseurl()."/events/$prevyear/$prevmonth",t('Previous'),'',''), - '$next' => array($a->get_baseurl()."/events/$nextyear/$nextmonth",t('Next'),'',''), - '$export' => array($a->get_baseurl()."/events/$y/$m/export",t('Export'),'',''), + '$baseurl' => z_root(), + '$new_event' => array(z_root().'/events',(($event_id) ? t('Edit Event') : t('Create Event')),'',''), + '$previus' => array(z_root()."/events/$prevyear/$prevmonth",t('Previous'),'',''), + '$next' => array(z_root()."/events/$nextyear/$nextmonth",t('Next'),'',''), + '$export' => array(z_root()."/events/$y/$m/export",t('Export'),'',''), '$calendar' => cal($y,$m,$links, ' eventcal'), '$events' => $events, '$upload' => t('Import'), |