require_once('include/event.php');
require_once('include/items.php');
-function events_init(&$a) {
- if(! local_user())
+function events_init(App &$a) {
+ if (! local_user()) {
return;
+ }
- if($a->argc == 1) {
+ if ($a->argc == 1) {
// if it's a json request abort here becaus we don't
// need the widget data
if($a->argv[1] === 'json')
$cal_widget = widget_events();
- if(! x($a->page,'aside'))
+ if (! x($a->page,'aside')) {
$a->page['aside'] = '';
+ }
$a->page['aside'] .= $cal_widget;
}
return;
}
-function events_post(&$a) {
+function events_post(App &$a) {
logger('post: ' . print_r($_REQUEST,true));
- if(! local_user())
+ if (! local_user()) {
return;
+ }
$event_id = ((x($_POST,'event_id')) ? intval($_POST['event_id']) : 0);
$cid = ((x($_POST,'cid')) ? intval($_POST['cid']) : 0);
-function events_content(&$a) {
+function events_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
- if($a->argc == 1)
+ if ($a->argc == 1) {
$_SESSION['return_url'] = App::get_baseurl() . '/' . $a->cmd;
+ }
- if(($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
+ 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]),
intval(local_user())
);
}
- if(($a->argc > 2) && ($a->argv[1] === 'unignore') && intval($a->argv[2])) {
+ if (($a->argc > 2) && ($a->argv[1] === 'unignore') && intval($a->argv[2])) {
$r = q("update event set ignore = 0 where id = %d and uid = %d",
intval($a->argv[2]),
intval(local_user())
);
}
- if ($a->theme_events_in_profile)
+ if ($a->theme_events_in_profile) {
nav_set_selected('home');
- else
+ } else {
nav_set_selected('events');
+ }
$editselect = 'none';
- if( feature_enabled(local_user(), 'richtext') )
+ if ( feature_enabled(local_user(), 'richtext') ) {
$editselect = 'textareas';
+ }
// get the translation strings for the callendar
$i18n = get_event_strings();
$r = sort_by_date($r);
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))
+ if(! x($links,$j)) {
$links[$j] = App::get_baseurl() . '/' . $a->cmd . '#link-' . $j;
+ }
}
}