-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
executable file
·60 lines (50 loc) · 2.04 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
return [
'name' => 'default_admin',
'inherit' => 'default',
'events' => [
'before' => function ($theme) {
$theme->setTitle(config('app.name').' Admin Panel');
// Breadcrumb template.
$theme->breadcrumb()->setTemplate(
'<ol class="breadcrumb">
@foreach ($crumbs as $i => $crumb)
@if ($i != (count($crumbs) - 1))
<li><a href="{{ $crumb["url"] }}">{{ $crumb["label"] }}</a></li>
@else
<li class="active">{{ $crumb["label"] }}</li>
@endif
@endforeach
</ol>'
);
},
'asset' => function ($theme) {
$themeName = config('cms.core.app.themes.backend');
$theme->add('css', 'themes/'.$themeName.'/css/app.css');
$theme->add('js', 'themes/'.$themeName.'/js/all.js');
},
// add dropdown-menu classes and such for the bootstrap toggle
'beforeRenderTheme' => function ($theme) {
$navService = (new \Cms\Modules\Core\Services\NavigationService());
// grab the navigations
$navService->boot();
// theme specific nav stuff
Menu::handler('backend_sidebar')->addClass('nav')->id('side-menu');
Menu::handler('backend_sidebar')
->getAllItemLists()
->map(function ($itemList) {
if ($itemList->getParent() !== null && $itemList->hasChildren()) {
$itemList->addClass('nav nav-second-level');
}
});
// add dropdown class to the li if the set has children
Menu::handler('backend_sidebar')
->getItemsByContentType('Menu\Items\Contents\Link')
->map(function ($item) {
if ($item->hasChildren()) {
$item->getValue()->addClass('text-center title');
}
});
},
],
];