}
if ($a->argc == 1) {
- // if it's a json request abort here becaus we don't
+ // If it's a json request abort here because we don't
// need the widget data
if ($a->argv[1] === 'json') {
return;
function events_post(App $a) {
- logger('post: ' . print_r($_REQUEST, true));
+ logger('post: ' . print_r($_REQUEST, true), LOGGER_DATA);
if (! local_user()) {
return;
// The default setting for the `private` field in event_store() is false, so mirror that
$private_event = false;
+ $start = NULL_DATE;
+ $finish = NULL_DATE;
+
if ($start_text) {
$start = $start_text;
- } else {
- $start = sprintf('%d-%d-%d %d:%d:0', $startyear, $startmonth, $startday, $starthour, $startminute);
- }
-
- if ($nofinish) {
- $finish = '0000-00-00 00:00:00';
}
if ($finish_text) {
$finish = $finish_text;
- } else {
- $finish = sprintf('%d-%d-%d %d:%d:0', $finishyear, $finishmonth, $finishday, $finishhour, $finishminute);
}
if ($adjust) {
goaway($onerror_url);
}
- if ((! $summary) || (! $start)) {
+ if ((! $summary) || ($start === NULL_DATE)) {
notice(t('Event title and start time are required.') . EOL);
if (intval($_REQUEST['preview'])) {
echo t('Event title and start time are required.');
goaway($_SESSION['return_url']);
}
-
-
function events_content(App $a) {
if (! local_user()) {
$tabs = profile_tabs($a, true);
}
-
-
$mode = 'view';
$y = 0;
$m = 0;
$ignored = ((x($_REQUEST, 'ignored')) ? intval($_REQUEST['ignored']) : 0);
- if($a->argc > 1) {
+ if ($a->argc > 1) {
if ($a->argc > 2 && $a->argv[1] == 'event') {
$mode = 'edit';
$event_id = intval($a->argv[2]);
}
- if($a->argc > 2 && $a->argv[1] == 'drop') {
+ if ($a->argc > 2 && $a->argv[1] == 'drop') {
$mode = 'drop';
$event_id = intval($a->argv[2]);
}
);
// get events by id or by date
- if (x($_GET, 'id')){
+ if (x($_GET, 'id')) {
$r = event_by_id(local_user(), $event_params);
} else {
$r = events_by_date(local_user(), $event_params);
killme();
}
- if (x($_GET, 'id')){
+ if (x($_GET, 'id')) {
$tpl = get_markup_template("event.tpl");
} else {
$tpl = get_markup_template("events_js.tpl");
if (x($_REQUEST, 'location')) {$orig_event['location'] = $_REQUEST['location'];}
if (x($_REQUEST, 'start')) {$orig_event['start'] = $_REQUEST['start'];}
if (x($_REQUEST, 'finish')) {$orig_event['finish'] = $_REQUEST['finish'];}
- }
-
- if ($mode === 'edit' || $mode === 'new') {
$n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : '');
$a_checked = ((x($orig_event) && $orig_event['adjust']) ? ' checked="checked" ' : '');
$cid = ((x($orig_event)) ? $orig_event['cid'] : 0);
$uri = ((x($orig_event)) ? $orig_event['uri'] : '');
-
if (! x($orig_event)) {
$sh_checked = '';
} else {
$sh_checked .= ' disabled="disabled" ';
}
-
$sdt = ((x($orig_event)) ? $orig_event['start'] : 'now');
$fdt = ((x($orig_event)) ? $orig_event['finish'] : 'now');