From fe58e4f4220d6685b91bf516374e33936e1075e3 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 14 Jan 2018 17:47:26 +0100 Subject: database: updated checks for selectOne --- includes/view/EventConfig_view.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'includes/view/EventConfig_view.php') diff --git a/includes/view/EventConfig_view.php b/includes/view/EventConfig_view.php index 25c4b225..fe6de670 100644 --- a/includes/view/EventConfig_view.php +++ b/includes/view/EventConfig_view.php @@ -8,7 +8,7 @@ */ function EventConfig_countdown_page($event_config) { - if ($event_config == null) { + if (empty($event_config)) { return div('col-md-12 text-center', [ heading(sprintf(_('Welcome to the %s!'), ' ENGELSYSTEM'), 2) ]); @@ -16,7 +16,7 @@ function EventConfig_countdown_page($event_config) $elements = []; - if ($event_config['event_name'] != null) { + if (!is_null($event_config['event_name'])) { $elements[] = div('col-sm-12 text-center', [ heading(sprintf( _('Welcome to the %s!'), @@ -25,7 +25,7 @@ function EventConfig_countdown_page($event_config) ]); } - if ($event_config['buildup_start_date'] != null && time() < $event_config['buildup_start_date']) { + if (!is_null($event_config['buildup_start_date']) && time() < $event_config['buildup_start_date']) { $elements[] = div('col-sm-3 text-center hidden-xs', [ heading(_('Buildup starts'), 4), '%c', @@ -33,7 +33,7 @@ function EventConfig_countdown_page($event_config) ]); } - if ($event_config['event_start_date'] != null && time() < $event_config['event_start_date']) { + if (!is_null($event_config['event_start_date']) && time() < $event_config['event_start_date']) { $elements[] = div('col-sm-3 text-center hidden-xs', [ heading(_('Event starts'), 4), '%c', @@ -41,7 +41,7 @@ function EventConfig_countdown_page($event_config) ]); } - if ($event_config['event_end_date'] != null && time() < $event_config['event_end_date']) { + if (!is_null($event_config['event_end_date']) && time() < $event_config['event_end_date']) { $elements[] = div('col-sm-3 text-center hidden-xs', [ heading(_('Event ends'), 4), '%c', @@ -49,7 +49,7 @@ function EventConfig_countdown_page($event_config) ]); } - if ($event_config['teardown_end_date'] != null && time() < $event_config['teardown_end_date']) { + if (!is_null($event_config['teardown_end_date']) && time() < $event_config['teardown_end_date']) { $elements[] = div('col-sm-3 text-center hidden-xs', [ heading(_('Teardown ends'), 4), '%c', @@ -68,15 +68,15 @@ function EventConfig_countdown_page($event_config) */ function EventConfig_info($event_config) { - if ($event_config == null) { + if (empty($event_config)) { return ''; } // Event name, start+end date are set if ( - $event_config['event_name'] != null - && $event_config['event_start_date'] != null - && $event_config['event_end_date'] != null + !is_null($event_config['event_name']) + && !is_null($event_config['event_start_date']) + && !is_null($event_config['event_end_date']) ) { return sprintf( _('%s, from %s to %s'), @@ -87,7 +87,7 @@ function EventConfig_info($event_config) } // Event name, start date are set - if ($event_config['event_name'] != null && $event_config['event_start_date'] != null) { + if (!is_null($event_config['event_name']) && !is_null($event_config['event_start_date'])) { return sprintf( _('%s, starting %s'), $event_config['event_name'], date(_('Y-m-d'), $event_config['event_start_date']) @@ -95,7 +95,7 @@ function EventConfig_info($event_config) } // Event start+end date are set - if ($event_config['event_start_date'] != null && $event_config['event_end_date'] != null) { + if (!is_null($event_config['event_start_date']) && !is_null($event_config['event_end_date'])) { return sprintf( _('Event from %s to %s'), date(_('Y-m-d'), $event_config['event_start_date']), @@ -104,7 +104,7 @@ function EventConfig_info($event_config) } // Only event name is set - if ($event_config['event_name'] != null) { + if (!is_null($event_config['event_name'])) { return sprintf($event_config['event_name']); } -- cgit v1.2.3-54-g00ecf