mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 07:16:06 -06:00
#3283 added theme settings in left navigation
This commit is contained in:
parent
67673b29d5
commit
9136b20a4f
@ -17,22 +17,15 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
public function boot(ControlPanelBuilder $builder, NavigationFactory $factory)
|
public function boot(ControlPanelBuilder $builder, NavigationFactory $factory)
|
||||||
{
|
{
|
||||||
view()->composer('*', function ($view) use ($builder, $factory) {
|
view()->composer('*', function ($view) use ($builder, $factory) {
|
||||||
//Hidden menu items in sidebar on dashboard
|
|
||||||
if (auth()->check() and template()->get('cp')) {
|
if (auth()->check() and template()->get('cp')) {
|
||||||
|
//Hidden menu items in sidebar on dashboard
|
||||||
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.variables')) ? $navigation->setClass('hidden') : false;
|
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.variables')) ? $navigation->setClass('hidden') : false;
|
||||||
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.system')) ? $navigation->setClass('hidden') : false;
|
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.system')) ? $navigation->setClass('hidden') : false;
|
||||||
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.redirects')) ? $navigation->setClass('hidden') : false;
|
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.redirects')) ? $navigation->setClass('hidden') : false;
|
||||||
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.repeaters')) ? $navigation->setClass('hidden') : false;
|
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.repeaters')) ? $navigation->setClass('hidden') : false;
|
||||||
}
|
|
||||||
//Auto Language Switcher
|
|
||||||
if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
|
||||||
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);//Get Browser Language
|
|
||||||
$acceptLang = config('streams::locales.enabled'); //Supported Language
|
|
||||||
$lang = in_array($lang, $acceptLang) ? $lang : config('streams::locales.default', 'en');
|
|
||||||
App()->setLocale($lang);
|
|
||||||
Request()->session()->put('_locale', $lang);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Add new menu items in sidebar on dashboard
|
||||||
$newNavigations = [
|
$newNavigations = [
|
||||||
[
|
[
|
||||||
'slug' => setting_value("streams::standard_theme"),
|
'slug' => setting_value("streams::standard_theme"),
|
||||||
@ -49,6 +42,15 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
$cp->addNavigationLink($factory->make($newNavigation));
|
$cp->addNavigationLink($factory->make($newNavigation));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
//Auto Language Switcher
|
||||||
|
if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||||
|
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);//Get Browser Language
|
||||||
|
$acceptLang = config('streams::locales.enabled'); //Supported Language
|
||||||
|
$lang = in_array($lang, $acceptLang) ? $lang : config('streams::locales.default', 'en');
|
||||||
|
App()->setLocale($lang);
|
||||||
|
Request()->session()->put('_locale', $lang);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user