Rev 1086 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1086 | Rev 1116 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | \defined('INSIDE_OIDPLUS') or die; |
35 | \defined('INSIDE_OIDPLUS') or die; |
36 | // phpcs:enable PSR1.Files.SideEffects |
36 | // phpcs:enable PSR1.Files.SideEffects |
37 | 37 | ||
38 | class OIDplusPagePublicUITweaks extends OIDplusPagePluginPublic { |
38 | class OIDplusPagePublicUITweaks extends OIDplusPagePluginPublic { |
39 | 39 | ||
- | 40 | /** |
|
- | 41 | * @param bool $html |
|
- | 42 | * @return void |
|
- | 43 | * @throws OIDplusException |
|
- | 44 | */ |
|
40 | public function init($html=true) { |
45 | public function init(bool $html=true) { |
41 | OIDplus::config()->prepareConfigKey('uitweaks_expand_objects_tree', 'UITweaks plugin: 1=Fully expand objects tree on page reload, 0=Default behavior', '0', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
46 | OIDplus::config()->prepareConfigKey('uitweaks_expand_objects_tree', 'UITweaks plugin: 1=Fully expand objects tree on page reload, 0=Default behavior', '0', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
42 | if (!is_numeric($value) || ($value < 0) || ($value > 1)) { |
47 | if (!is_numeric($value) || ($value < 0) || ($value > 1)) { |
43 | throw new OIDplusException(_L('Please enter a valid value.')); |
48 | throw new OIDplusException(_L('Please enter a valid value.')); |
44 | } |
49 | } |
45 | }); |
50 | }); |
Line 69... | Line 74... | ||
69 | throw new OIDplusException(_L('Please enter a valid value.')); |
74 | throw new OIDplusException(_L('Please enter a valid value.')); |
70 | } |
75 | } |
71 | }); |
76 | }); |
72 | } |
77 | } |
73 | 78 | ||
- | 79 | /** |
|
- | 80 | * @param array $head_elems |
|
- | 81 | * @return void |
|
- | 82 | * @throws OIDplusException |
|
- | 83 | */ |
|
74 | public function htmlHeaderUpdate(&$head_elems) { |
84 | public function htmlHeaderUpdate(array &$head_elems) { |
75 | $w = js_escape(OIDplus::config()->getValue('uitweaks_menu_width')); |
85 | $w = js_escape(OIDplus::config()->getValue('uitweaks_menu_width')); |
76 | $rw = OIDplus::config()->getValue('uitweaks_menu_remember_width') == 1 ? 'true' : 'false'; |
86 | $rw = OIDplus::config()->getValue('uitweaks_menu_remember_width') == 1 ? 'true' : 'false'; |
77 | $o = OIDplus::config()->getValue('uitweaks_expand_objects_tree') == 1 ? 'true' : 'false'; |
87 | $o = OIDplus::config()->getValue('uitweaks_expand_objects_tree') == 1 ? 'true' : 'false'; |
78 | $l = OIDplus::config()->getValue('uitweaks_collapse_login_tree') == 1 ? 'true' : 'false'; |
88 | $l = OIDplus::config()->getValue('uitweaks_collapse_login_tree') == 1 ? 'true' : 'false'; |
79 | $r = OIDplus::config()->getValue('uitweaks_collapse_res_tree') == 1 ? 'true' : 'false'; |
89 | $r = OIDplus::config()->getValue('uitweaks_collapse_res_tree') == 1 ? 'true' : 'false'; |
Line 91... | Line 101... | ||
91 | $s .= "</script>"; |
101 | $s .= "</script>"; |
92 | 102 | ||
93 | $head_elems[] = $s; |
103 | $head_elems[] = $s; |
94 | } |
104 | } |
95 | 105 | ||
96 | - | ||
97 | - | ||
98 | } |
106 | } |