@@ -14,16 +14,16 @@ |
||
14 | 14 | */ |
15 | 15 | public function boot() |
16 | 16 | { |
17 | - view()->composer('*', function ($view) { |
|
18 | - //Hidden menu items in sidebar on dashboard |
|
19 | - if (auth()->check() and template()->get('cp')){ |
|
20 | - template()->get('cp')->getNavigation()->get('anomaly.module.variables')->setClass('hidden'); |
|
21 | - template()->get('cp')->getNavigation()->get('anomaly.module.system')->setClass('hidden'); |
|
22 | - template()->get('cp')->getNavigation()->get('anomaly.module.redirects')->setClass('hidden'); |
|
23 | - template()->get('cp')->getNavigation()->get('anomaly.module.repeaters')->setClass('hidden'); |
|
24 | - } |
|
25 | - //Auto Language Switcher |
|
26 | - if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
17 | + view()->composer('*', function ($view) { |
|
18 | + //Hidden menu items in sidebar on dashboard |
|
19 | + if (auth()->check() and template()->get('cp')){ |
|
20 | + template()->get('cp')->getNavigation()->get('anomaly.module.variables')->setClass('hidden'); |
|
21 | + template()->get('cp')->getNavigation()->get('anomaly.module.system')->setClass('hidden'); |
|
22 | + template()->get('cp')->getNavigation()->get('anomaly.module.redirects')->setClass('hidden'); |
|
23 | + template()->get('cp')->getNavigation()->get('anomaly.module.repeaters')->setClass('hidden'); |
|
24 | + } |
|
25 | + //Auto Language Switcher |
|
26 | + if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
27 | 27 | $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);//Get Browser Language |
28 | 28 | $acceptLang = config('streams::locales.enabled'); //Supported Language |
29 | 29 | $lang = in_array($lang, $acceptLang) ? $lang : config('streams::locales.default', 'en'); |
@@ -14,17 +14,17 @@ |
||
14 | 14 | */ |
15 | 15 | public function boot() |
16 | 16 | { |
17 | - view()->composer('*', function ($view) { |
|
17 | + view()->composer('*', function($view) { |
|
18 | 18 | //Hidden menu items in sidebar on dashboard |
19 | - if (auth()->check() and template()->get('cp')){ |
|
19 | + if (auth()->check() and template()->get('cp')) { |
|
20 | 20 | template()->get('cp')->getNavigation()->get('anomaly.module.variables')->setClass('hidden'); |
21 | 21 | template()->get('cp')->getNavigation()->get('anomaly.module.system')->setClass('hidden'); |
22 | 22 | template()->get('cp')->getNavigation()->get('anomaly.module.redirects')->setClass('hidden'); |
23 | 23 | template()->get('cp')->getNavigation()->get('anomaly.module.repeaters')->setClass('hidden'); |
24 | 24 | } |
25 | 25 | //Auto Language Switcher |
26 | - if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
27 | - $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);//Get Browser Language |
|
26 | + if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ])) { |
|
27 | + $lang = substr($_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ], 0, 2); //Get Browser Language |
|
28 | 28 | $acceptLang = config('streams::locales.enabled'); //Supported Language |
29 | 29 | $lang = in_array($lang, $acceptLang) ? $lang : config('streams::locales.default', 'en'); |
30 | 30 | App()->setLocale($lang); |