-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAdminThemeBossConfig.php
114 lines (108 loc) · 3.45 KB
/
AdminThemeBossConfig.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/**
* © ICF Church – <[email protected]>.
*
* This source file is subject to the license file that is bundled
* with this source code in the file LICENSE.
*
* File created/changed: 2018-10-11T14:17:03+02:00
*/
namespace ProcessWire;
if (!defined('PROCESSWIRE')) {
die();
}
/**
* Implementation for Uikit admin theme getConfigInputfields method.
*
* @param AdminTheme|AdminThemeBoss $adminTheme
* @param InputfieldWrapper $inputfields
*/
class AdminThemeBossConfig extends ModuleConfig
{
public function __construct()
{
$adminThemeUrl = $this->modules->getModuleEditUrl('AdminThemeUikit');
$this->add([
[
'name' => 'enablemodule',
'type' => 'checkbox',
'icon' => 'check',
'label' => $this->_('Enable Theme'),
'checkboxLabel' => $this->_('Yes'),
'description' => $this->_('You can disable this theme using this setting without uninstalling it.'),
'value' => $this->get('enablemodule'),
],
[
'type' => 'fieldset',
'name' => 'theme-options',
'label' => $this->_('Theme Options'),
'icon' => 'paint-brush',
'showIf' => 'enablemodule=1',
'children' => [
[
'name' => 'variant',
'type' => 'radios',
'icon' => 'adjust',
'label' => $this->_('Color Sheme'),
'value' => $this->get('variant'),
'options' => [
'blue' => $this->_('ProcessWire Blue'),
'vibrant' => $this->_('Vibrant Blue'),
'black' => $this->_('Dark Black'),
'pink' => $this->_('Happy Pink'),
'green' => $this->_('Smooth Green'),
],
],
],
],
[
'type' => 'fieldset',
'name' => 'advanced-options',
'label' => $this->_('Advanced Options'),
'icon' => 'cog',
'collapsed' => Inputfield::collapsedYes,
'showIf' => 'enablemodule=1',
'children' => [
[
'name' => 'extendedbreadcrumb',
'type' => 'checkbox',
'icon' => 'link',
'label' => $this->_('Extended Breadcrumb'),
'checkboxLabel' => $this->_('Yes, use extended breadcrumb'),
'description' => $this->_('If set, the default breadcrumb will be extended with edit links'),
'notes' => $this->_('Only applies if Module BreadcrumbDropdowns is not installed.'),
'value' => $this->get('extendedbreadcrumb'),
],
[
'name' => 'allusers',
'type' => 'checkbox',
'icon' => 'user',
'label' => $this->_('Enable For All Users'),
'checkboxLabel' => $this->_('Yes'),
'description' => $this->_('If enabled, [AdminThemeUikit](' . $adminThemeUrl . ') will be set as theme for all users.'),
'value' => $this->get('allusers'),
],
[
'name' => 'usedarklogo',
'type' => 'checkbox',
'icon' => 'bookmark',
'label' => $this->_('Use Dark ProcessWire Logo'),
'checkboxLabel' => $this->_('Yes'),
'description' => $this->_('Set a dark theme logo for the [AdminThemeUikit](' . $adminThemeUrl . ') logo settings.'),
'value' => $this->get('useuikitlogo'),
],
],
],
]);
}
public function getDefaults()
{
return [
'enablemodule' => true,
'variant' => 'blue',
'extendedbreadcrumb' => true,
'allusers' => true,
'usedarklogo' => false,
];
}
}