Rev 717 | Rev 801 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 717 | Rev 800 | ||
---|---|---|---|
1 | <?php |
1 | <?php |
2 | 2 | ||
3 | /* |
3 | /* |
4 | * OIDplus 2.0 |
4 | * OIDplus 2.0 |
5 | * Copyright 2019 - 2021 Daniel Marschall, ViaThinkSoft |
5 | * Copyright 2019 - 2021 Daniel Marschall, ViaThinkSoft |
6 | * |
6 | * |
7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
8 | * you may not use this file except in compliance with the License. |
8 | * you may not use this file except in compliance with the License. |
9 | * You may obtain a copy of the License at |
9 | * You may obtain a copy of the License at |
10 | * |
10 | * |
11 | * http://www.apache.org/licenses/LICENSE-2.0 |
11 | * http://www.apache.org/licenses/LICENSE-2.0 |
12 | * |
12 | * |
13 | * Unless required by applicable law or agreed to in writing, software |
13 | * Unless required by applicable law or agreed to in writing, software |
14 | * distributed under the License is distributed on an "AS IS" BASIS, |
14 | * distributed under the License is distributed on an "AS IS" BASIS, |
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | * See the License for the specific language governing permissions and |
16 | * See the License for the specific language governing permissions and |
17 | * limitations under the License. |
17 | * limitations under the License. |
18 | */ |
18 | */ |
19 | 19 | ||
20 | if (!defined('INSIDE_OIDPLUS')) die(); |
20 | if (!defined('INSIDE_OIDPLUS')) die(); |
21 | 21 | ||
22 | class OIDplusPageAdminColors extends OIDplusPagePluginAdmin { |
22 | class OIDplusPageAdminColors extends OIDplusPagePluginAdmin { |
23 | 23 | ||
24 | public function action($actionID, $params) { |
24 | public function action($actionID, $params) { |
25 | if ($actionID == 'color_update') { |
25 | if ($actionID == 'color_update') { |
26 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
26 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
27 | throw new OIDplusException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin'))); |
27 | throw new OIDplusException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin'))); |
28 | } |
28 | } |
29 | 29 | ||
30 | _CheckParamExists($params, 'hue_shift'); |
30 | _CheckParamExists($params, 'hue_shift'); |
31 | _CheckParamExists($params, 'sat_shift'); |
31 | _CheckParamExists($params, 'sat_shift'); |
32 | _CheckParamExists($params, 'val_shift'); |
32 | _CheckParamExists($params, 'val_shift'); |
33 | _CheckParamExists($params, 'invcolors'); |
33 | _CheckParamExists($params, 'invcolors'); |
34 | _CheckParamExists($params, 'theme'); |
34 | _CheckParamExists($params, 'theme'); |
35 | 35 | ||
36 | OIDplus::config()->setValue('color_hue_shift', $params['hue_shift']); |
36 | OIDplus::config()->setValue('color_hue_shift', $params['hue_shift']); |
37 | OIDplus::config()->setValue('color_sat_shift', $params['sat_shift']); |
37 | OIDplus::config()->setValue('color_sat_shift', $params['sat_shift']); |
38 | OIDplus::config()->setValue('color_val_shift', $params['val_shift']); |
38 | OIDplus::config()->setValue('color_val_shift', $params['val_shift']); |
39 | OIDplus::config()->setValue('color_invert', $params['invcolors']); |
39 | OIDplus::config()->setValue('color_invert', $params['invcolors']); |
40 | OIDplus::config()->setValue('design', $params['theme']); |
40 | OIDplus::config()->setValue('design', $params['theme']); |
41 | 41 | ||
42 | OIDplus::logger()->log("[OK]A?", "Changed system color theme"); |
42 | OIDplus::logger()->log("[OK]A?", "Changed system color theme"); |
43 | 43 | ||
44 | return array("status" => 0); |
44 | return array("status" => 0); |
45 | } else { |
45 | } else { |
46 | throw new OIDplusException(_L('Unknown action ID')); |
46 | throw new OIDplusException(_L('Unknown action ID')); |
47 | } |
47 | } |
48 | } |
48 | } |
49 | 49 | ||
50 | public function init($html=true) { |
50 | public function init($html=true) { |
51 | OIDplus::config()->prepareConfigKey('color_hue_shift', 'HSV Hue shift of CSS colors (-360..360)', '0', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
51 | OIDplus::config()->prepareConfigKey('color_hue_shift', 'HSV Hue shift of CSS colors (-360..360)', '0', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
52 | if (!is_numeric($value) || ($value < -360) || ($value > 360)) { |
52 | if (!is_numeric($value) || ($value < -360) || ($value > 360)) { |
53 | throw new OIDplusException(_L('Please enter a valid value.')); |
53 | throw new OIDplusException(_L('Please enter a valid value.')); |
54 | } |
54 | } |
55 | }); |
55 | }); |
56 | OIDplus::config()->prepareConfigKey('color_sat_shift', 'HSV Saturation shift of CSS colors (-100..100)', '0', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
56 | OIDplus::config()->prepareConfigKey('color_sat_shift', 'HSV Saturation shift of CSS colors (-100..100)', '0', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
57 | if (!is_numeric($value) || ($value < -100) || ($value > 100)) { |
57 | if (!is_numeric($value) || ($value < -100) || ($value > 100)) { |
58 | throw new OIDplusException(_L('Please enter a valid value.')); |
58 | throw new OIDplusException(_L('Please enter a valid value.')); |
59 | } |
59 | } |
60 | }); |
60 | }); |
61 | OIDplus::config()->prepareConfigKey('color_val_shift', 'HSV Value shift of CSS colors (-100..100)', '0', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
61 | OIDplus::config()->prepareConfigKey('color_val_shift', 'HSV Value shift of CSS colors (-100..100)', '0', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
62 | if (!is_numeric($value) || ($value < -100) || ($value > 100)) { |
62 | if (!is_numeric($value) || ($value < -100) || ($value > 100)) { |
63 | throw new OIDplusException(_L('Please enter a valid value.')); |
63 | throw new OIDplusException(_L('Please enter a valid value.')); |
64 | } |
64 | } |
65 | }); |
65 | }); |
66 | OIDplus::config()->prepareConfigKey('color_invert', 'Invert colors? (0=no, 1=yes)', '0', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
66 | OIDplus::config()->prepareConfigKey('color_invert', 'Invert colors? (0=no, 1=yes)', '0', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
67 | if (!is_numeric($value) || ($value < 0) || ($value > 1)) { |
67 | if (!is_numeric($value) || ($value < 0) || ($value > 1)) { |
68 | throw new OIDplusException(_L('Please enter a valid value (0=no, 1=yes).')); |
68 | throw new OIDplusException(_L('Please enter a valid value (0=no, 1=yes).')); |
69 | } |
69 | } |
70 | }); |
70 | }); |
71 | OIDplus::config()->prepareConfigKey('design', 'Which design to use (must exist in plugins/[vendorname]/design/)?', 'default', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
71 | OIDplus::config()->prepareConfigKey('design', 'Which design to use (must exist in plugins/[vendorname]/design/)?', 'default', OIDplusConfig::PROTECTION_EDITABLE, function($value) { |
72 | $good = true; |
72 | $good = true; |
73 | if (strpos($value,'/') !== false) $good = false; |
73 | if (strpos($value,'/') !== false) $good = false; |
74 | if (strpos($value,'\\') !== false) $good = false; |
74 | if (strpos($value,'\\') !== false) $good = false; |
75 | if (strpos($value,'..') !== false) $good = false; |
75 | if (strpos($value,'..') !== false) $good = false; |
76 | if (!$good) { |
76 | if (!$good) { |
77 | throw new OIDplusException(_L('Invalid design folder name. Do only enter a folder name, not an absolute or relative path')); |
77 | throw new OIDplusException(_L('Invalid design folder name. Do only enter a folder name, not an absolute or relative path')); |
78 | } |
78 | } |
79 | 79 | ||
80 | if (!rec_is_dir(OIDplus::localpath().'plugins/'.'*'.'/design/'.$value)) { |
80 | if (!rec_is_dir(OIDplus::localpath().'plugins/'.'*'.'/design/'.$value)) { |
81 | throw new OIDplusException(_L('The design "%1" does not exist in plugin directory %2',$value,'plugins/[vendorname]/design/')); |
81 | throw new OIDplusException(_L('The design "%1" does not exist in plugin directory %2',$value,'plugins/[vendorname]/design/')); |
82 | } |
82 | } |
83 | }); |
83 | }); |
84 | OIDplus::config()->prepareConfigKey('oobe_colors_done', '"Out Of Box Experience" wizard for OIDplusPageAdminColors done once?', '0', OIDplusConfig::PROTECTION_HIDDEN, function($value) {}); |
84 | OIDplus::config()->prepareConfigKey('oobe_colors_done', '"Out Of Box Experience" wizard for OIDplusPageAdminColors done once?', '0', OIDplusConfig::PROTECTION_HIDDEN, function($value) {}); |
85 | } |
85 | } |
86 | 86 | ||
87 | public function gui($id, &$out, &$handled) { |
87 | public function gui($id, &$out, &$handled) { |
88 | if ($id === 'oidplus:colors') { |
88 | if ($id === 'oidplus:colors') { |
89 | $handled = true; |
89 | $handled = true; |
90 | $out['title'] = _L('Design'); |
90 | $out['title'] = _L('Design'); |
91 | $out['icon'] = OIDplus::webpath(__DIR__).'icon_big.png'; |
91 | $out['icon'] = OIDplus::webpath(__DIR__,true).'img/main_icon.png'; |
92 | 92 | ||
93 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
93 | if (!OIDplus::authUtils()->isAdminLoggedIn()) { |
94 | $out['icon'] = 'img/error_big.png'; |
94 | $out['icon'] = 'img/error.png'; |
95 | $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>'; |
95 | $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')).'</p>'; |
96 | return; |
96 | return; |
97 | } |
97 | } |
98 | 98 | ||
99 | $out['text'] = '<br><p>'; |
99 | $out['text'] = '<br><p>'; |
100 | $out['text'] .= ' <label for="theme">'._L('Design').':</label>'; |
100 | $out['text'] .= ' <label for="theme">'._L('Design').':</label>'; |
101 | $out['text'] .= ' <select name="theme" id="theme">'; |
101 | $out['text'] .= ' <select name="theme" id="theme">'; |
102 | foreach (OIDplus::getDesignPlugins() as $plugin) { |
102 | foreach (OIDplus::getDesignPlugins() as $plugin) { |
103 | $folder = basename($plugin->getPluginDirectory()); |
103 | $folder = basename($plugin->getPluginDirectory()); |
104 | $selected = $folder == OIDplus::config()->getValue('design') ? ' selected="true"' : ''; |
104 | $selected = $folder == OIDplus::config()->getValue('design') ? ' selected="true"' : ''; |
105 | $out['text'] .= '<option value="'.htmlentities($folder).'"'.$selected.'>'.htmlentities($plugin->getManifest()->getName()).'</option>'; |
105 | $out['text'] .= '<option value="'.htmlentities($folder).'"'.$selected.'>'.htmlentities($plugin->getManifest()->getName()).'</option>'; |
106 | } |
106 | } |
107 | $out['text'] .= ' </select>'; |
107 | $out['text'] .= ' </select>'; |
108 | $out['text'] .= '</p>'; |
108 | $out['text'] .= '</p>'; |
109 | 109 | ||
110 | $out['text'] .= '<br><p>'; |
110 | $out['text'] .= '<br><p>'; |
111 | $out['text'] .= ' <label for="amount">'._L('Hue shift').':</label>'; |
111 | $out['text'] .= ' <label for="amount">'._L('Hue shift').':</label>'; |
112 | $out['text'] .= ' <input type="text" id="hshift" readonly style="border:0; background:transparent; font-weight:bold;">'; |
112 | $out['text'] .= ' <input type="text" id="hshift" readonly style="border:0; background:transparent; font-weight:bold;">'; |
113 | $out['text'] .= '</p>'; |
113 | $out['text'] .= '</p>'; |
114 | $out['text'] .= '<div id="slider-hshift"></div>'; |
114 | $out['text'] .= '<div id="slider-hshift"></div>'; |
115 | 115 | ||
116 | $out['text'] .= '<br><p>'; |
116 | $out['text'] .= '<br><p>'; |
117 | $out['text'] .= ' <label for="amount">'._L('Saturation shift').':</label>'; |
117 | $out['text'] .= ' <label for="amount">'._L('Saturation shift').':</label>'; |
118 | $out['text'] .= ' <input type="text" id="sshift" readonly style="border:0; background:transparent; font-weight:bold;">'; |
118 | $out['text'] .= ' <input type="text" id="sshift" readonly style="border:0; background:transparent; font-weight:bold;">'; |
119 | $out['text'] .= '</p>'; |
119 | $out['text'] .= '</p>'; |
120 | $out['text'] .= '<div id="slider-sshift"></div>'; |
120 | $out['text'] .= '<div id="slider-sshift"></div>'; |
121 | 121 | ||
122 | $out['text'] .= '<br><p>'; |
122 | $out['text'] .= '<br><p>'; |
123 | $out['text'] .= ' <label for="amount">'._L('Value shift').':</label>'; |
123 | $out['text'] .= ' <label for="amount">'._L('Value shift').':</label>'; |
124 | $out['text'] .= ' <input type="text" id="vshift" readonly style="border:0; background:transparent; font-weight:bold;">'; |
124 | $out['text'] .= ' <input type="text" id="vshift" readonly style="border:0; background:transparent; font-weight:bold;">'; |
125 | $out['text'] .= '</p>'; |
125 | $out['text'] .= '</p>'; |
126 | $out['text'] .= '<div id="slider-vshift"></div>'; |
126 | $out['text'] .= '<div id="slider-vshift"></div>'; |
127 | 127 | ||
128 | $out['text'] .= '<br><p>'; |
128 | $out['text'] .= '<br><p>'; |
129 | $out['text'] .= ' <label for="amount">'._L('Invert colors').':</label>'; |
129 | $out['text'] .= ' <label for="amount">'._L('Invert colors').':</label>'; |
130 | $out['text'] .= ' <input type="text" id="icolor" readonly style="border:0; background:transparent; font-weight:bold;">'; // TODO: It would be good if that was a checkbox |
130 | $out['text'] .= ' <input type="text" id="icolor" readonly style="border:0; background:transparent; font-weight:bold;">'; // TODO: It would be good if that was a checkbox |
131 | $out['text'] .= '</p>'; |
131 | $out['text'] .= '</p>'; |
132 | $out['text'] .= '<div id="slider-icolor"></div>'; |
132 | $out['text'] .= '<div id="slider-icolor"></div>'; |
133 | 133 | ||
134 | $out['text'] .= '<script>'; |
134 | $out['text'] .= '<script>'; |
135 | $out['text'] .= 'if (OIDplusPageAdminColors.hue_shift == null) OIDplusPageAdminColors.hue_shift = OIDplusPageAdminColors.hue_shift_saved = '.OIDplus::config()->getValue('color_hue_shift').";\n"; |
135 | $out['text'] .= 'if (OIDplusPageAdminColors.hue_shift == null) OIDplusPageAdminColors.hue_shift = OIDplusPageAdminColors.hue_shift_saved = '.OIDplus::config()->getValue('color_hue_shift').";\n"; |
136 | $out['text'] .= 'if (OIDplusPageAdminColors.sat_shift == null) OIDplusPageAdminColors.sat_shift = OIDplusPageAdminColors.sat_shift_saved = '.OIDplus::config()->getValue('color_sat_shift').";\n"; |
136 | $out['text'] .= 'if (OIDplusPageAdminColors.sat_shift == null) OIDplusPageAdminColors.sat_shift = OIDplusPageAdminColors.sat_shift_saved = '.OIDplus::config()->getValue('color_sat_shift').";\n"; |
137 | $out['text'] .= 'if (OIDplusPageAdminColors.val_shift == null) OIDplusPageAdminColors.val_shift = OIDplusPageAdminColors.val_shift_saved = '.OIDplus::config()->getValue('color_val_shift').";\n"; |
137 | $out['text'] .= 'if (OIDplusPageAdminColors.val_shift == null) OIDplusPageAdminColors.val_shift = OIDplusPageAdminColors.val_shift_saved = '.OIDplus::config()->getValue('color_val_shift').";\n"; |
138 | $out['text'] .= 'if (OIDplusPageAdminColors.invcolors == null) OIDplusPageAdminColors.invcolors = OIDplusPageAdminColors.invcolors_saved = '.OIDplus::config()->getValue('color_invert').";\n"; |
138 | $out['text'] .= 'if (OIDplusPageAdminColors.invcolors == null) OIDplusPageAdminColors.invcolors = OIDplusPageAdminColors.invcolors_saved = '.OIDplus::config()->getValue('color_invert').";\n"; |
139 | $out['text'] .= 'if (OIDplusPageAdminColors.activetheme == null) OIDplusPageAdminColors.activetheme_saved = '.js_escape(OIDplus::config()->getValue('design')).";\n"; |
139 | $out['text'] .= 'if (OIDplusPageAdminColors.activetheme == null) OIDplusPageAdminColors.activetheme_saved = '.js_escape(OIDplus::config()->getValue('design')).";\n"; |
140 | $out['text'] .= 'OIDplusPageAdminColors.setup_color_sliders();'; |
140 | $out['text'] .= 'OIDplusPageAdminColors.setup_color_sliders();'; |
141 | $out['text'] .= '</script>'; |
141 | $out['text'] .= '</script>'; |
142 | 142 | ||
143 | $out['text'] .= '<br>'; |
143 | $out['text'] .= '<br>'; |
144 | $out['text'] .= '<input type="button" onclick="OIDplusPageAdminColors.color_reset_sliders_cfg()" value="'._L('Reset to last saved config').'">'.str_repeat(' ',5); |
144 | $out['text'] .= '<input type="button" onclick="OIDplusPageAdminColors.color_reset_sliders_cfg()" value="'._L('Reset to last saved config').'">'.str_repeat(' ',5); |
145 | $out['text'] .= '<input type="button" onclick="OIDplusPageAdminColors.color_reset_sliders_factory()" value="'._L('Reset default setting').'">'.str_repeat(' ',5); |
145 | $out['text'] .= '<input type="button" onclick="OIDplusPageAdminColors.color_reset_sliders_factory()" value="'._L('Reset default setting').'">'.str_repeat(' ',5); |
146 | $out['text'] .= '<input type="button" onclick="OIDplusPageAdminColors.test_color_theme()" value="'._L('Test').'">'.str_repeat(' ',5); |
146 | $out['text'] .= '<input type="button" onclick="OIDplusPageAdminColors.test_color_theme()" value="'._L('Test').'">'.str_repeat(' ',5); |
147 | $out['text'] .= '<input type="button" onclick="OIDplusPageAdminColors.crudActionColorUpdate()" value="'._L('Set permanently').'">'; |
147 | $out['text'] .= '<input type="button" onclick="OIDplusPageAdminColors.crudActionColorUpdate()" value="'._L('Set permanently').'">'; |
148 | } |
148 | } |
149 | } |
149 | } |
150 | 150 | ||
151 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
151 | public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') { |
152 | if (!OIDplus::authUtils()->isAdminLoggedIn()) return false; |
152 | if (!OIDplus::authUtils()->isAdminLoggedIn()) return false; |
153 | 153 | ||
154 | if (file_exists(__DIR__.'/treeicon.png')) { |
154 | if (file_exists(__DIR__.'/img/main_icon16.png')) { |
155 | $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png'; |
155 | $tree_icon = OIDplus::webpath(__DIR__,true).'img/main_icon16.png'; |
156 | } else { |
156 | } else { |
157 | $tree_icon = null; // default icon (folder) |
157 | $tree_icon = null; // default icon (folder) |
158 | } |
158 | } |
159 | 159 | ||
160 | $json[] = array( |
160 | $json[] = array( |
161 | 'id' => 'oidplus:colors', |
161 | 'id' => 'oidplus:colors', |
162 | 'icon' => $tree_icon, |
162 | 'icon' => $tree_icon, |
163 | 'text' => _L('Design') |
163 | 'text' => _L('Design') |
164 | ); |
164 | ); |
165 | 165 | ||
166 | return true; |
166 | return true; |
167 | } |
167 | } |
168 | 168 | ||
169 | public function tree_search($request) { |
169 | public function tree_search($request) { |
170 | return false; |
170 | return false; |
171 | } |
171 | } |
172 | 172 | ||
173 | public function implementsFeature($id) { |
173 | public function implementsFeature($id) { |
174 | if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.1') return true; // oobeEntry, oobeRequested |
174 | if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.1') return true; // oobeEntry, oobeRequested |
175 | return false; |
175 | return false; |
176 | } |
176 | } |
177 | 177 | ||
178 | public function oobeRequested(): bool { |
178 | public function oobeRequested(): bool { |
179 | // Interface 1.3.6.1.4.1.37476.2.5.2.3.1 |
179 | // Interface 1.3.6.1.4.1.37476.2.5.2.3.1 |
180 | 180 | ||
181 | return OIDplus::config()->getValue('oobe_colors_done') == '0'; |
181 | return OIDplus::config()->getValue('oobe_colors_done') == '0'; |
182 | } |
182 | } |
183 | 183 | ||
184 | public function oobeEntry($step, $do_edits, &$errors_happened)/*: void*/ { |
184 | public function oobeEntry($step, $do_edits, &$errors_happened)/*: void*/ { |
185 | // Interface 1.3.6.1.4.1.37476.2.5.2.3.1 |
185 | // Interface 1.3.6.1.4.1.37476.2.5.2.3.1 |
186 | 186 | ||
187 | echo '<p><u>'._L('Step %1: Color Theme',$step).'</u></p>'; |
187 | echo '<p><u>'._L('Step %1: Color Theme',$step).'</u></p>'; |
188 | 188 | ||
189 | echo '<input type="checkbox" name="color_invert" id="color_invert"'; |
189 | echo '<input type="checkbox" name="color_invert" id="color_invert"'; |
190 | if (isset($_REQUEST['sent'])) { |
190 | if (isset($_REQUEST['sent'])) { |
191 | if ($set_value = isset($_REQUEST['color_invert'])) { |
191 | if ($set_value = isset($_REQUEST['color_invert'])) { |
192 | echo ' checked'; |
192 | echo ' checked'; |
193 | } |
193 | } |
194 | } else { |
194 | } else { |
195 | if ($set_value = (OIDplus::config()->getValue('color_invert') == 1)) { |
195 | if ($set_value = (OIDplus::config()->getValue('color_invert') == 1)) { |
196 | echo ' checked'; |
196 | echo ' checked'; |
197 | } |
197 | } |
198 | } |
198 | } |
199 | echo '> <label for="color_invert">'._L('Dark Theme (inverted colors)').'</label><br>'; |
199 | echo '> <label for="color_invert">'._L('Dark Theme (inverted colors)').'</label><br>'; |
200 | 200 | ||
201 | $msg = ''; |
201 | $msg = ''; |
202 | if ($do_edits) { |
202 | if ($do_edits) { |
203 | try { |
203 | try { |
204 | OIDplus::config()->setValue('color_invert', $set_value ? 1 : 0); |
204 | OIDplus::config()->setValue('color_invert', $set_value ? 1 : 0); |
205 | OIDplus::config()->setValue('oobe_colors_done', '1'); |
205 | OIDplus::config()->setValue('oobe_colors_done', '1'); |
206 | } catch (Exception $e) { |
206 | } catch (Exception $e) { |
207 | $msg = $e->getMessage(); |
207 | $msg = $e->getMessage(); |
208 | $errors_happened = true; |
208 | $errors_happened = true; |
209 | } |
209 | } |
210 | } |
210 | } |
211 | 211 | ||
212 | echo ' <font color="red"><b>'.$msg.'</b></font>'; |
212 | echo ' <font color="red"><b>'.$msg.'</b></font>'; |
213 | } |
213 | } |
214 | 214 | ||
215 | } |
215 | } |
216 | 216 |