-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
executable file
·67 lines (57 loc) · 2.5 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
61
62
63
64
65
66
67
<?php
return [
'name' => 'adminlte',
'inherit' => 'default', //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/app.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('sidebar-menu');
Menu::handler('backend_sidebar')
->getAllItemLists()
->map(function ($itemList) {
if ($itemList->getParent() !== null && $itemList->hasChildren()) {
$itemList->getParent()->addClass('treeview');
$itemList->addClass('treeview-menu');
}
});
// add dropdown class to the li if the set has children
Menu::handler('backend_sidebar')
->getItemsByContentType('Menu\Items\Contents\Link')
->map(function ($item) {
$itemValue = $item->getValue()->getValue();
if ($item->hasChildren()) {
$value = sprintf('<span>%s</span> <i class="fa fa-angle-left pull-right"></i>', $itemValue);
$item->getValue()->setValue($value);
} elseif ($item->getValue()->getUrl() === '#') {
$item->addClass('header');
$item->getValue()->setElement('span');
$item->getParent()->setValue($itemValue);
}
});
},
],
];