diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-09-25 17:33:31 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2018-10-30 21:13:56 +0100 |
commit | 7f61dc95be4ac543986c7df2459532fd8f81368d (patch) | |
tree | 930497c659bbaa3e073313a261f3458348fd423d /includes/pages/user_settings.php | |
parent | 63d1292bf80d88be40eec7695c1a59f29e6609c5 (diff) |
EventConfig: Merge event configuration from database to global config
Diffstat (limited to 'includes/pages/user_settings.php')
-rw-r--r-- | includes/pages/user_settings.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index d8f6e44b..cf8d2f0b 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -1,5 +1,6 @@ <?php +use Carbon\Carbon; use Engelsystem\Database\DB; /** @@ -206,6 +207,7 @@ function user_settings() { global $user; $request = request(); + $config = config(); $themes = config('available_themes'); $enable_tshirt_size = config('enable_tshirt_size'); @@ -214,14 +216,15 @@ function user_settings() $buildup_start_date = null; $teardown_end_date = null; - $event_config = EventConfig(); - if (!empty($event_config)) { - if (isset($event_config['buildup_start_date'])) { - $buildup_start_date = $event_config['buildup_start_date']; - } - if (isset($event_config['teardown_end_date'])) { - $teardown_end_date = $event_config['teardown_end_date']; - } + + if ($buildup = $config->get('buildup_start')) { + /** @var Carbon $buildup */ + $buildup_start_date = $buildup->getTimestamp(); + } + + if ($teardown = $config->get('teardown_end')) { + /** @var Carbon $teardown */ + $teardown_end_date = $teardown->getTimestamp(); } $user_source = $user; |