Improve code for intro texts.

This commit is contained in:
James Cole
2017-07-21 06:00:10 +02:00
parent d79008495a
commit f2d388f742
8 changed files with 230 additions and 51 deletions

View File

@@ -67,12 +67,15 @@ class Controller extends BaseController
// get shown-intro-preference:
if (auth()->check()) {
$route = Route::currentRouteName();
$route = Route::currentRouteName();
$originalRoute = $route;
$route = str_replace('.', '_', $route);
$key = 'shown_demo_' . $route;
$config = config('intro.' . $route);
$shownDemo = Preferences::get($key, false)->data;
// TODO get parameters from route?
$route = str_replace('.', '_', $route);
$key = 'shown_demo_' . $route;
$config = config('intro.' . $route);
$shownDemo = Preferences::get($key, false)->data;
if (is_null($config) || (is_array($config) && count($config) === 0)) {
// no demo when no data for demo.
$shownDemo = true;