mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 06:46:08 -06:00
#3283 added theme settings in left navigation
This commit is contained in:
parent
50e5fd8c3c
commit
67673b29d5
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Ui\ControlPanel\Component\Navigation\NavigationFactory;
|
||||||
|
use Anomaly\Streams\Platform\Ui\ControlPanel\ControlPanelBuilder;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
@ -12,15 +14,15 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot(ControlPanelBuilder $builder, NavigationFactory $factory)
|
||||||
{
|
{
|
||||||
view()->composer('*', function ($view) {
|
view()->composer('*', function ($view) use ($builder, $factory) {
|
||||||
//Hidden menu items in sidebar on dashboard
|
//Hidden menu items in sidebar on dashboard
|
||||||
if (auth()->check() and template()->get('cp')) {
|
if (auth()->check() and template()->get('cp')) {
|
||||||
$is_hidden = ($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;
|
||||||
$is_hidden = ($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;
|
||||||
$is_hidden = ($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;
|
||||||
$is_hidden = ($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
|
//Auto Language Switcher
|
||||||
if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||||
@ -30,6 +32,23 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
App()->setLocale($lang);
|
App()->setLocale($lang);
|
||||||
Request()->session()->put('_locale', $lang);
|
Request()->session()->put('_locale', $lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$newNavigations = [
|
||||||
|
[
|
||||||
|
'slug' => setting_value("streams::standard_theme"),
|
||||||
|
'icon' => 'fa fa-pencil-square-o',
|
||||||
|
'title' => 'visiosoft.theme.defaultadmin::section.theme_settings.name',
|
||||||
|
'attributes' => [
|
||||||
|
'href' => url("admin/settings/themes/" . setting_value("streams::standard_theme"))
|
||||||
|
]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$cp = $builder->getControlPanel();
|
||||||
|
foreach ($newNavigations as $newNavigation) {
|
||||||
|
if (!template()->get('cp')->getNavigation()->get($newNavigation['slug'])){
|
||||||
|
$cp->addNavigationLink($factory->make($newNavigation));
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user