X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fevents.php;h=0fdec5cbe4c0f01d1e59bff4fc6418230a8ce6ab;hb=dd0a1cf586fc37fe9a3d84af277c7504136a3bf9;hp=8e34b15681d05cfd4eccc6d5725d6a828995993f;hpb=e1d22ef5d4333cff860079c92fea92d82fe58fda;p=friendica.git diff --git a/mod/events.php b/mod/events.php index 8e34b15681..0fdec5cbe4 100644 --- a/mod/events.php +++ b/mod/events.php @@ -3,6 +3,9 @@ * @file mod/events.php * @brief The events module */ + +use Friendica\App; + require_once 'include/bbcode.php'; require_once 'include/datetime.php'; require_once 'include/event.php'; @@ -53,8 +56,8 @@ function events_post(App $a) { // The default setting for the `private` field in event_store() is false, so mirror that $private_event = false; - $start = '0000-00-00 00:00:00'; - $finish = '0000-00-00 00:00:00'; + $start = NULL_DATE; + $finish = NULL_DATE; if ($start_text) { $start = $start_text; @@ -98,7 +101,7 @@ function events_post(App $a) { goaway($onerror_url); } - if ((! $summary) || ($start === '0000-00-00 00:00:00')) { + 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.'); @@ -237,12 +240,12 @@ function events_content(App $a) { $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]); } @@ -321,7 +324,7 @@ function events_content(App $a) { ); // 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); @@ -352,7 +355,7 @@ function events_content(App $a) { killme(); } - if (x($_GET, 'id')){ + if (x($_GET, 'id')) { $tpl = get_markup_template("event.tpl"); } else { $tpl = get_markup_template("events_js.tpl"); @@ -433,7 +436,7 @@ function events_content(App $a) { $sh_checked = (($orig_event['allow_cid'] === '<' . local_user() . '>' && (! $orig_event['allow_gid']) && (! $orig_event['deny_cid']) && (! $orig_event['deny_gid'])) ? '' : ' checked="checked" '); } - if ($cid OR ($mode !== 'new')) { + if ($cid || ($mode !== 'new')) { $sh_checked .= ' disabled="disabled" '; }