PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.3.2
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.3.2
2.1.3 2.1.2 2.1.1 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 trunk 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 All 57 releases
← All changes | src/Admin/Views/AdvancedSettings.php +144 -271 2.0.01.3.2 View file →
@@ -1,13 +1,13 @@
1 1 <?php
2 2
3 3 /**
4 - * AdvancedSettings class for Advanced options.
4 + * Views class for Shortcode generator options.
5 5 *
6 6 * @link https://themeatelier.net
7 7 * @since 1.0.0
8 8 *
9 - * @package darkify
9 + * @package darkify
10 10 * @subpackage darkify/src/Admin/Views/AdvancedSettings
11 11 * @author ThemeAtelier<themeatelierbd@gmail.com>
12 12 */
13 13
@@ -12,9 +12,9 @@
12 12 */
13 13
14 14 namespace ThemeAtelier\Darkify\Admin\Views;
15 15
16 -use ThemeAtelier\Darkify\Admin\Schema\SchemaRegistry as Darkify;
16 +use ThemeAtelier\Darkify\Admin\Framework\Classes\Darkify;
17 17
18 18 class AdvancedSettings
19 19 {
20 20 /**
@@ -25,294 +25,167 @@
25 25 */
26 26 public static function options($prefix)
27 27 {
28 28 Darkify::createSection($prefix, array(
29 - 'title' => esc_html__('Advanced', 'darkify'),
29 + 'title' => esc_html__('ADVANCED SETTINGS', 'darkify'),
30 30 'icon' => 'icofont-settings',
31 31 'fields' => array(
32 - array(
33 - 'type' => 'section_tab',
34 - 'tabs' => array(
35 - array(
36 - 'title' => esc_html__('HTML/CSS Restriction', 'darkify'),
37 - 'icon' => 'icofont-code-alt',
38 - 'fields' => array(
39 - // Intro line, rendered plain above the section card.
40 - array(
41 - 'type' => 'page_hint',
42 - 'content' => esc_html__('Restrict which HTML elements dark mode applies to, by tag, CSS class, or CSS ID.', 'darkify'),
43 - ),
44 - // ===== HTML/CSS RESTRICTION =====
45 - array(
46 - 'type' => 'heading',
47 - 'title' => esc_html__('HTML/CSS Restriction', 'darkify'),
48 - 'section_start' => true,
49 - ),
50 - // ALLOWED ELEMENTS
51 - array(
52 - 'id' => 'allowed_elements',
53 - 'type' => 'textarea',
54 - 'title' => esc_html__('Allow Only Elements', 'darkify'),
55 - 'title_help' =>
56 - '<div class="darkify-info-label">' .
57 - __('Dark mode will be applied only to these elements.', 'darkify') .
58 - '</div>',
59 - 'placeholder' => esc_html__(
60 - 'Enter comma-separated HTML tags, CSS classes, or CSS IDs. Example: div, #site-header, .my-footer',
61 - 'darkify'
62 - ),
63 32
33 + // 'HTML/CSS Restriction
64 34
65 - 'class' => 'only_pro',
66 - ),
35 + array(
36 + 'type' => 'heading',
37 + 'content' => esc_html__('HTML/CSS Restriction', 'darkify'),
38 + ),
67 39
68 - array(
69 - 'id' => 'allowed_elements_force_to_correct',
70 - 'type' => 'switcher',
71 - 'title' => esc_html__('Force Design Correction', 'darkify'),
72 - 'title_help' =>
73 - '<div class="darkify-info-label">' .
74 - __('Force Darkify to preserve layout and readability when background or text colors are modified on allowed elements.', 'darkify') .
75 - '</div>',
40 + // ALLOWED ELEMENTS
76 41
77 - 'class' => 'switcher_pro_only',
78 - 'text_on' => esc_html__('Yes', 'darkify'),
79 - 'text_off' => esc_html__('No', 'darkify'),
80 - 'default' => true,
81 - ),
42 + array(
43 + 'id' => 'allowed_elements',
44 + 'type' => 'textarea',
45 + 'title' => esc_html__('Allow Only Elements', 'darkify'),
46 + 'desc' => esc_html__('Dark mode will be applied only to these elements.', 'darkify'),
47 + 'placeholder' => esc_html__('Enter comma separated HTML tags, CSS class or CSS ids. Example: div, #site-header, .my-footer', 'darkify'),
48 + 'class' => 'only_pro',
49 + ),
82 50
83 - // DISALLOWED ELEMENTS
84 - array(
85 - 'id' => 'disallowed_elements',
86 - 'type' => 'textarea',
87 - 'class' => 'only_pro',
88 - 'title' => esc_html__('Disallowed Elements', 'darkify'),
89 - 'title_help' =>
90 - '<div class="darkify-info-label">' .
91 - esc_html__('Dark mode will NOT be applied to the elements.', 'darkify') .
92 - '</div>',
51 + array(
52 + 'id' => 'allowed_elements_force_to_correct',
53 + 'type' => 'switcher',
54 + 'title' => esc_html__('Force To Correct', 'darkify'),
55 + 'desc' => esc_html__('Force to keep designs correct if background color or text color is changed on disallowed elements..', 'darkify'),
56 + 'text_on' => esc_html__('Yes', 'darkify'),
57 + 'text_off' => esc_html__('No', 'darkify'),
58 + 'default' => true,
59 + 'class' => 'switcher_pro_only',
60 + ),
61 +
62 + // DISALLOWED ELEMENTS
63 + array(
64 + 'id' => 'disallowed_elements',
65 + 'type' => 'textarea',
66 + 'title' => esc_html__('Disallowed Elements', 'darkify'),
67 + 'desc' => esc_html__('Dark mode will be applied only to these elements.', 'darkify'),
68 + 'placeholder' => esc_html__('Enter comma separated HTML tags, CSS class or CSS ids. Example: div, #site-header, .my-footer', 'darkify'),
69 + 'class' => 'only_pro',
70 + ),
71 +
72 + array(
73 + 'id' => 'disallowed_elements_force_to_correct',
74 + 'type' => 'switcher',
75 + 'title' => esc_html__('Force To Correct', 'darkify'),
76 + 'desc' => esc_html__('Force to keep designs correct if background color or text color is not working properly for allowed elements.', 'darkify'),
77 + 'text_on' => esc_html__('Yes', 'darkify'),
78 + 'text_off' => esc_html__('No', 'darkify'),
79 + 'class' => 'switcher_pro_only',
80 + 'default' => true,
81 + ),
93 82
94 - 'placeholder' => esc_html__(
95 - 'Enter comma-separated HTML tags, CSS classes, or CSS IDs. Example: div, #site-header, .my-footer',
96 - 'darkify'
97 - ),
83 + // Page Restriction
98 84
99 - ),
85 + array(
86 + 'type' => 'heading',
87 + 'content' => esc_html__('Page Restriction', 'darkify'),
88 + ),
100 89
101 - array(
102 - 'id' => 'disallowed_elements_force_to_correct',
103 - 'type' => 'switcher',
104 - 'title' => esc_html__('Force To Correct', 'darkify'),
105 - 'title_help' => '<div class="darkify-info-label">' .
106 - __('Force Darkify to keep the design correct when background or text colors do not work properly for disallowed elements.', 'darkify') .
107 - '</div>',
90 + array(
91 + 'id' => 'allowed_pages',
92 + 'type' => 'select',
93 + 'title' => esc_html__('Allow Only Pages', 'darkify'),
94 + 'help' => esc_html__('Dark mode will be applied only to these pages.', 'darkify'),
95 + 'desc' => esc_html__('Choose the pages only where dark mode and floating switch can work. No other pages will be able to process dark mode.', 'darkify'),
96 + 'placeholder' => esc_html__('Select some pages', 'darkify'),
97 + 'options' => 'pages',
98 + 'chosen' => true,
99 + 'multiple' => true,
100 + 'class' => 'only_pro',
101 + ),
108 102
109 - 'class' => 'switcher_pro_only',
110 - 'text_on' => esc_html__('Yes', 'darkify'),
111 - 'text_off' => esc_html__('No', 'darkify'),
112 - 'default' => true,
113 - ),
114 - )
115 - ),
103 + array(
104 + 'id' => 'disallowed_pages',
105 + 'type' => 'select',
106 + 'title' => esc_html__('Disallowed Pages', 'darkify'),
107 + 'help' => esc_html__('Dark mode will not be applied to these pages.', 'darkify'),
108 + 'desc' => esc_html__('Choose the pages where dark mode and floating switch can not work. Other pages will be able to process dark mode.', 'darkify'),
109 + 'placeholder' => esc_html__('Select some pages', 'darkify'),
110 + 'options' => 'pages',
111 + 'chosen' => true,
112 + 'multiple' => true,
113 + 'class' => 'only_pro',
114 + ),
116 115
117 - array(
118 - 'title' => esc_html__('Page/Posts Restriction', 'darkify'),
119 - 'icon' => 'icofont-eye-blocked',
120 - 'fields' => array(
121 - // Intro line, rendered plain above the section cards.
122 - array(
123 - 'type' => 'page_hint',
124 - 'content' => esc_html__('Limit where dark mode and the floating switch run, by specific pages or posts.', 'darkify'),
125 - ),
126 - array(
127 - 'type' => 'heading',
128 - 'title' => esc_html__('Pages Restriction', 'darkify'),
129 - 'section_start' => true,
130 - ),
131 - array(
132 - 'id' => 'allowed_pages',
133 - 'type' => 'select',
134 - 'title' => esc_html__('Allow Only Pages', 'darkify'),
135 - 'title_help' =>
136 - '<div class="darkify-info-label">' .
137 - __('Dark mode will be applied only to the selected pages.', 'darkify') .
138 - '</div><div class="darkify-short-content">' .
139 - __('Choose only the pages where dark mode and the floating switch should work. Dark mode will not be applied to any other pages.', 'darkify') .
140 - '</div>',
141 - 'placeholder' => esc_html__('Select pages', 'darkify'),
116 + // Post Restriction
142 117
143 - 'class' => 'only_pro',
144 - 'options' => 'pages',
145 - 'chosen' => true,
146 - 'multiple' => true,
147 - ),
118 + array(
119 + 'type' => 'heading',
120 + 'content' => esc_html__('Post Restriction', 'darkify'),
121 + ),
148 122
149 - array(
150 - 'id' => 'disallowed_pages',
151 - 'type' => 'select',
152 - 'title' => esc_html__('Disallowed Pages', 'darkify'),
153 - 'title_help' =>
154 - '<div class="darkify-info-label">' .
155 - __('Dark mode will not be applied to these pages.', 'darkify') .
156 - '</div><div class="darkify-short-content">' .
157 - __('Choose the pages where dark mode and the floating switch should not work. Dark mode will work on all other pages.', 'darkify') .
158 - '</div>',
123 + array(
124 + 'id' => 'allowed_posts',
125 + 'type' => 'select',
126 + 'title' => esc_html__('Allow Only Posts', 'darkify'),
127 + 'help' => esc_html__('Dark mode will be applied only to these posts.', 'darkify'),
128 + 'desc' => esc_html__('Choose the posts only where dark mode and floating switch can work. No other pages will be able to process dark mode.', 'darkify'),
129 + 'placeholder' => esc_html__('Select some posts', 'darkify'),
130 + 'options' => 'posts',
131 + 'chosen' => true,
132 + 'multiple' => true,
133 + 'class' => 'only_pro',
134 + ),
159 135
160 - 'class' => 'only_pro',
161 - 'placeholder' => esc_html__('Select pages', 'darkify'),
162 - 'options' => 'pages',
163 - 'chosen' => true,
164 - 'multiple' => true,
165 - 'dependency' => array('allowed_pages', '==', ''),
166 - ),
136 + array(
137 + 'id' => 'disallowed_posts',
138 + 'type' => 'select',
139 + 'title' => esc_html__('Disallowed Posts', 'darkify'),
140 + 'help' => esc_html__('Dark mode will not be applied to these posts.', 'darkify'),
141 + 'desc' => esc_html__('Choose the posts where dark mode and floating switch can not work. Other pages will be able to process dark mode.', 'darkify'),
142 + 'placeholder' => esc_html__('Select some posts', 'darkify'),
143 + 'options' => 'posts',
144 + 'chosen' => true,
145 + 'multiple' => true,
146 + 'class' => 'only_pro',
147 + ),
148 + array(
149 + 'type' => 'heading',
150 + 'content' => esc_html__('Custom CSS', 'darkify'),
151 + ),
167 152
168 - array(
169 - 'type' => 'heading',
170 - 'title' => esc_html__('Posts Restriction', 'darkify'),
171 - 'section_start' => true,
172 - ),
173 - array(
174 - 'id' => 'allowed_posts',
175 - 'type' => 'select',
176 - 'title' => esc_html__('Allow Only Posts', 'darkify'),
177 - 'title_help' =>
178 - '<div class="darkify-info-label">' .
179 - __('Dark mode will be applied only to these posts.', 'darkify') .
180 - '</div><div class="darkify-short-content">' .
181 - __('Choose only the posts where dark mode and the floating switch should work. Dark mode will not be applied to any other posts.', 'darkify') .
182 - '</div>',
153 + array(
154 + 'id' => 'custom_css',
155 + 'type' => 'code_editor',
156 + 'title' => esc_html__('Dark Mode CSS', 'darkify'),
157 + 'desc' => esc_html__('The CSS code will only be applied when dark mode is active.', 'darkify'),
158 + 'settings' => array(
159 + 'theme' => 'mbo',
160 + 'mode' => 'css',
161 + ),
162 + 'class' => 'only_pro',
163 + ),
183 164
184 - 'placeholder' => esc_html__('Select posts', 'darkify'),
185 - 'class' => 'only_pro',
186 - 'options' => 'posts',
187 - 'chosen' => true,
188 - 'multiple' => true,
189 - ),
190 - array(
191 - 'id' => 'disallowed_posts',
192 - 'type' => 'select',
193 - 'title' => esc_html__('Disallowed Posts', 'darkify'),
194 - 'title_help' =>
195 - '<div class="darkify-info-label">' .
196 - __('Dark mode will not be applied to these posts.', 'darkify') .
197 - '</div><div class="darkify-short-content">' .
198 - __('Choose the posts where dark mode and the floating switch cannot work. Other posts will be able to process dark mode.', 'darkify') .
199 - '</div>',
200 - 'placeholder' => esc_html__('Select posts', 'darkify'),
201 - 'class' => 'only_pro',
202 - 'options' => 'posts',
203 - 'chosen' => true,
204 - 'multiple' => true,
205 - 'dependency' => array('allowed_posts', '==', ''),
206 - ),
207 - )
208 - ),
209 - array(
210 - 'title' => esc_html__('Custom CSS', 'darkify'),
211 - 'icon' => 'icofont-file-css',
212 - 'fields' => array(
213 - // Intro line, rendered plain above the section card.
214 - array(
215 - 'type' => 'page_hint',
216 - 'content' => esc_html__('Add your own CSS for dark mode, and CSS that applies in both modes.', 'darkify'),
217 - ),
218 - // ===== CUSTOM CSS =====
219 - array(
220 - 'type' => 'heading',
221 - 'title' => esc_html__('Custom CSS', 'darkify'),
222 - 'section_start' => true,
223 - ),
224 - array(
225 - 'id' => 'custom_css',
226 - 'type' => 'code_editor',
227 - 'title' => esc_html__('Dark Mode CSS', 'darkify'),
228 - 'title_help' =>
229 - '<div class="darkify-info-label">' .
230 - __('The CSS code will only be applied when dark mode is active.', 'darkify') .
231 - '</div>',
165 + array(
166 + 'id' => 'css_rules',
167 + 'type' => 'switcher',
168 + 'title' => esc_html__('CSS Rules', 'darkify'),
169 + 'help' => esc_html__('CSS rules should be applied to all children of the CSS selectors.', 'darkify'),
170 + 'desc' => esc_html__('Custom CSS selectors are automatically identified as Disallowed Elements, to ignore, use :not-disallowed pseudo class. i.e. body:not-disallowed{...}', 'darkify'),
171 + 'text_on' => esc_html__('Yes', 'darkify'),
172 + 'text_off' => esc_html__('No', 'darkify'),
173 + 'class' => 'switcher_pro_only',
174 + 'default' => true,
175 + ),
232 176
233 - 'settings' => array(
234 - 'theme' => 'default',
235 - 'mode' => 'css',
236 - ),
237 - ),
238 - array(
239 - 'id' => 'custom_css_rules',
240 - 'type' => 'switcher',
241 - 'title' => esc_html__('CSS Rules', 'darkify'),
242 -
243 - 'title_help' =>
244 - '<div class="darkify-info-label">' .
245 - __('CSS rules will be applied to all child elements of the specified CSS selectors.', 'darkify') .
246 - '</div>' .
247 - '<div class="darkify-short-content">' .
248 - __('Custom CSS selectors are automatically treated as Disallowed Elements. To override this behavior, use the :not-disallowed pseudo-class. Example: body:not-disallowed { ... }', 'darkify') .
249 - '</div>' .
250 - '' .
251 - '',
252 -
253 - 'text_on' => esc_html__('Yes', 'darkify'),
254 - 'text_off' => esc_html__('No', 'darkify'),
255 -
256 - 'class' => 'switcher_pro_only',
257 - ),
258 - array(
259 - 'id' => 'normal_custom_css',
260 - 'type' => 'code_editor',
261 - 'title' => esc_html__('Normal Mode CSS', 'darkify'),
262 - 'title_help' =>
263 - '<div class="darkify-info-label">' .
264 - __('The CSS code will be applied in both normal mode and dark mode.', 'darkify') .
265 - '</div>' .
266 - '' .
267 - '',
268 -
269 - 'settings' => array(
270 - 'theme' => 'default',
271 - 'mode' => 'css',
272 - ),
273 - ),
274 - )
275 - ),
276 - // "Extras" — the Frontend Iframe Dark Mode toggle lives here,
277 - // matching Pro's layout (moved out of Controls → Frontend). The
278 - // page's former Extras contents (Clean-up Data on Deletion +
279 - // Backup and Restore) now live on their own Tools page — see
280 - // Views/Tools.php.
281 - array(
282 - 'title' => esc_html__('Extras', 'darkify'),
283 - 'icon' => 'icofont-holding-hands',
284 - 'fields' => array(
285 - // Intro line, rendered plain above the section card.
286 - array(
287 - 'type' => 'page_hint',
288 - 'content' => esc_html__('Extra behaviors that don’t fit elsewhere.', 'darkify'),
289 - ),
290 - // ===== EXTRAS =====
291 - array(
292 - 'type' => 'heading',
293 - 'title' => esc_html__('Extras', 'darkify'),
294 - 'section_start' => true,
295 - ),
296 - array(
297 - 'id' => 'enable_frontend_iframe_dark_mode',
298 - 'type' => 'switcher',
299 - 'title' => esc_html__('Frontend Iframe Dark Mode', 'darkify'),
300 - 'title_help' =>
301 - '<div class="darkify-info-label">' .
302 - __('Apply dark mode to iframes when dark mode is active. Same-origin iframes receive full dark mode styling; cross-origin iframes (embedded third-party widgets) are dimmed to 60% brightness. Disable to keep all iframes at their original appearance.', 'darkify') .
303 - '</div>' .
304 - '' .
305 - '',
306 - 'text_on' => esc_html__('Enabled', 'darkify'),
307 - 'text_off' => esc_html__('Disabled', 'darkify'),
308 - 'text_width' => 100,
309 - 'default' => true,
310 - ),
311 - )
312 - ),
313 - )
177 + array(
178 + 'id' => 'normal_custom_css',
179 + 'type' => 'code_editor',
180 + 'title' => esc_html__('Normal Mode CSS', 'darkify'),
181 + 'desc' => esc_html__('The CSS code will be applied on both normal mode and dark mode.', 'darkify'),
182 + 'settings' => array(
183 + 'theme' => 'mbo',
184 + 'mode' => 'css',
185 + ),
186 + 'class' => 'only_pro',
314 187 ),
315 - ),
188 + )
316 189 ));
317 190 }
318 191 }