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 +143 -286 1.5.51.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
@@ -25,310 +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 - // ALLOWED ELEMENTS
40 - array(
41 - 'id' => 'allowed_elements',
42 - 'type' => 'textarea',
43 - 'title' => esc_html__('Allow Only Elements', 'darkify'),
44 - 'title_help' =>
45 - '<div class="darkify-info-label">' .
46 - __('Dark mode will be applied only to these elements.', 'darkify') .
47 - '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#element_targeting" target="_blank">' .
48 - __('Live Demo', 'darkify') .
49 - '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#html-css-restriction" target="_blank">' .
50 - __('Open Docs', 'darkify') .
51 - '</a>',
52 - 'placeholder' => esc_html__(
53 - 'Enter comma-separated HTML tags, CSS classes, or CSS IDs. Example: div, #site-header, .my-footer',
54 - 'darkify'
55 - ),
56 32
33 + // 'HTML/CSS Restriction
57 34
58 - 'class' => 'only_pro',
59 - ),
35 + array(
36 + 'type' => 'heading',
37 + 'content' => esc_html__('HTML/CSS Restriction', 'darkify'),
38 + ),
60 39
61 - array(
62 - 'id' => 'allowed_elements_force_to_correct',
63 - 'type' => 'switcher',
64 - 'title' => esc_html__('Force Design Correction', 'darkify'),
65 - 'title_help' =>
66 - '<div class="darkify-info-label">' .
67 - __('Force Darkify to preserve layout and readability when background or text colors are modified on allowed elements.', 'darkify') .
68 - '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#element_targeting" target="_blank">' .
69 - __('Live Demo', 'darkify') .
70 - '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#html-css-restriction" target="_blank">' .
71 - __('Open Docs', 'darkify') .
72 - '</a>',
40 + // ALLOWED ELEMENTS
73 41
74 - 'class' => 'switcher_pro_only',
75 - 'text_on' => esc_html__('Yes', 'darkify'),
76 - 'text_off' => esc_html__('No', 'darkify'),
77 - 'default' => true,
78 - ),
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 + ),
79 50
80 - // DISALLOWED ELEMENTS
81 - array(
82 - 'id' => 'disallowed_elements',
83 - 'type' => 'textarea',
84 - 'class' => 'only_pro',
85 - 'title' => esc_html__('Disallowed Elements', 'darkify'),
86 - 'title_help' =>
87 - '<div class="darkify-info-label">' .
88 - esc_html__('Dark mode will NOT be applied to the elements.', 'darkify') .
89 - '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#element_targeting" target="_blank">' .
90 - esc_html__('Live Demo', 'darkify') .
91 - '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#html-css-restriction" target="_blank">' .
92 - esc_html__('Open Docs', 'darkify') .
93 - '</a>',
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 + ),
94 82
95 - 'placeholder' => esc_html__(
96 - 'Enter comma-separated HTML tags, CSS classes, or CSS IDs. Example: div, #site-header, .my-footer',
97 - 'darkify'
98 - ),
83 + // Page Restriction
99 84
100 - ),
85 + array(
86 + 'type' => 'heading',
87 + 'content' => esc_html__('Page Restriction', 'darkify'),
88 + ),
101 89
102 - array(
103 - 'id' => 'disallowed_elements_force_to_correct',
104 - 'type' => 'switcher',
105 - 'title' => esc_html__('Force To Correct', 'darkify'),
106 - 'title_help' => '<div class="darkify-info-label">' .
107 - __('Force Darkify to keep the design correct when background or text colors do not work properly for disallowed elements.', 'darkify') .
108 - '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#element_targeting" target="_blank">' .
109 - __('Live Demo', 'darkify') .
110 - '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#html-css-restriction" target="_blank">' .
111 - __('Open Docs', 'darkify') .
112 - '</a>',
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 + ),
113 102
114 - 'class' => 'switcher_pro_only',
115 - 'text_on' => esc_html__('Yes', 'darkify'),
116 - 'text_off' => esc_html__('No', 'darkify'),
117 - 'default' => true,
118 - ),
119 - )
120 - ),
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 + ),
121 115
122 - array(
123 - 'title' => esc_html__('Page/Posts Restriction', 'darkify'),
124 - 'icon' => 'icofont-eye-blocked',
125 - 'fields' => array(
126 - array(
127 - 'type' => 'heading',
128 - 'title' => esc_html__('Pages Restriction', 'darkify'),
129 - ),
130 - array(
131 - 'id' => 'allowed_pages',
132 - 'type' => 'select',
133 - 'title' => esc_html__('Allow Only Pages', 'darkify'),
134 - 'title_help' =>
135 - '<div class="darkify-info-label">' .
136 - __('Dark mode will be applied only to the selected pages.', 'darkify') .
137 - '</div><div class="darkify-short-content">' .
138 - __('Choose only the pages where dark mode and the floating switch should work. Dark mode will not be applied to any other pages.', 'darkify') .
139 - '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#granular_control" target="_blank">' .
140 - __('Live Demo', 'darkify') .
141 - '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#pages-restriction" target="_blank">' .
142 - __('Open Docs', 'darkify') .
143 - '</a>',
144 - 'placeholder' => esc_html__('Select pages', 'darkify'),
116 + // Post Restriction
145 117
146 - 'class' => 'only_pro',
147 - 'options' => 'pages',
148 - 'chosen' => true,
149 - 'multiple' => true,
150 - ),
118 + array(
119 + 'type' => 'heading',
120 + 'content' => esc_html__('Post Restriction', 'darkify'),
121 + ),
151 122
152 - array(
153 - 'id' => 'disallowed_pages',
154 - 'type' => 'select',
155 - 'title' => esc_html__('Disallowed Pages', 'darkify'),
156 - 'title_help' =>
157 - '<div class="darkify-info-label">' .
158 - __('Dark mode will not be applied to these pages.', 'darkify') .
159 - '</div><div class="darkify-short-content">' .
160 - __('Choose the pages where dark mode and the floating switch should not work. Dark mode will work on all other pages.', 'darkify') .
161 - '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#granular_control" target="_blank">' .
162 - __('Live Demo', 'darkify') .
163 - '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#pages-restriction" target="_blank">' .
164 - __('Open Docs', 'darkify') .
165 - '</a>',
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 + ),
166 135
167 - 'class' => 'only_pro',
168 - 'placeholder' => esc_html__('Select pages', 'darkify'),
169 - 'options' => 'pages',
170 - 'chosen' => true,
171 - 'multiple' => true,
172 - 'dependency' => array('allowed_pages', '==', ''),
173 - ),
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 + ),
174 152
175 - array(
176 - 'type' => 'heading',
177 - 'title' => esc_html__('Posts Restriction', 'darkify'),
178 - ),
179 - array(
180 - 'id' => 'allowed_posts',
181 - 'type' => 'select',
182 - 'title' => esc_html__('Allow Only Posts', 'darkify'),
183 - 'title_help' =>
184 - '<div class="darkify-info-label">' .
185 - __('Dark mode will be applied only to these posts.', 'darkify') .
186 - '</div><div class="darkify-short-content">' .
187 - __('Choose only the posts where dark mode and the floating switch should work. Dark mode will not be applied to any other posts.', 'darkify') .
188 - '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#granular_control" target="_blank">' .
189 - __('Live Demo', 'darkify') .
190 - '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#posts-restriction" target="_blank">' .
191 - __('Open Docs', 'darkify') .
192 - '</a>',
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 + ),
193 164
194 - 'placeholder' => esc_html__('Select posts', 'darkify'),
195 - 'class' => 'only_pro',
196 - 'options' => 'posts',
197 - 'chosen' => true,
198 - 'multiple' => true,
199 - ),
200 - array(
201 - 'id' => 'disallowed_posts',
202 - 'type' => 'select',
203 - 'title' => esc_html__('Disallowed Posts', 'darkify'),
204 - 'title_help' =>
205 - '<div class="darkify-info-label">' .
206 - __('Dark mode will not be applied to these posts.', 'darkify') .
207 - '</div><div class="darkify-short-content">' .
208 - __('Choose the posts where dark mode and the floating switch cannot work. Other posts will be able to process dark mode.', 'darkify') .
209 - '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#granular_control" target="_blank">' .
210 - __('Live Demo', 'darkify') .
211 - '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#posts-restriction" target="_blank">' .
212 - __('Open Docs', 'darkify') .
213 - '</a>',
214 - 'placeholder' => esc_html__('Select posts', 'darkify'),
215 - 'class' => 'only_pro',
216 - 'options' => 'posts',
217 - 'chosen' => true,
218 - 'multiple' => true,
219 - 'dependency' => array('allowed_posts', '==', ''),
220 - ),
221 - )
222 - ),
223 - array(
224 - 'title' => esc_html__('Custom CSS', 'darkify'),
225 - 'icon' => 'icofont-file-css',
226 - 'fields' => array(
227 - array(
228 - 'id' => 'custom_css',
229 - 'type' => 'code_editor',
230 - 'title' => esc_html__('Dark Mode CSS', 'darkify'),
231 - 'title_help' =>
232 - '<div class="darkify-info-label">' .
233 - __('The CSS code will only be applied when dark mode is active.', 'darkify') .
234 - '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#custom_css" target="_blank">' .
235 - __('Live Demo', 'darkify') .
236 - '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#custom-css" target="_blank">' .
237 - __('Open Docs', 'darkify') .
238 - '</a>',
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 + ),
239 176
240 - 'settings' => array(
241 - 'theme' => 'default',
242 - 'mode' => 'css',
243 - ),
244 - ),
245 - array(
246 - 'id' => 'custom_css_rules',
247 - 'type' => 'switcher',
248 - 'title' => esc_html__('CSS Rules', 'darkify'),
249 -
250 - 'title_help' =>
251 - '<div class="darkify-info-label">' .
252 - __('CSS rules will be applied to all child elements of the specified CSS selectors.', 'darkify') .
253 - '</div>' .
254 - '<div class="darkify-short-content">' .
255 - __('Custom CSS selectors are automatically treated as Disallowed Elements. To override this behavior, use the :not-disallowed pseudo-class. Example: body:not-disallowed { ... }', 'darkify') .
256 - '</div>' .
257 - '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#custom_css" target="_blank">' .
258 - __('Live Demo', 'darkify') .
259 - '</a>' .
260 - '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#custom-css" target="_blank">' .
261 - __('Open Docs', 'darkify') .
262 - '</a>',
263 -
264 - 'text_on' => esc_html__('Yes', 'darkify'),
265 - 'text_off' => esc_html__('No', 'darkify'),
266 -
267 - 'class' => 'switcher_pro_only',
268 - ),
269 - array(
270 - 'id' => 'normal_custom_css',
271 - 'type' => 'code_editor',
272 - 'title' => esc_html__('Normal Mode CSS', 'darkify'),
273 - 'title_help' =>
274 - '<div class="darkify-info-label">' .
275 - __('The CSS code will be applied in both normal mode and dark mode.', 'darkify') .
276 - '</div>' .
277 - '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#custom_css" target="_blank">' .
278 - __('Live Demo', 'darkify') .
279 - '</a>' .
280 - '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#custom-css" target="_blank">' .
281 - __('Open Docs', 'darkify') .
282 - '</a>',
283 -
284 - 'settings' => array(
285 - 'theme' => 'default',
286 - 'mode' => 'css',
287 - ),
288 - ),
289 - )
290 - ),
291 - array(
292 - 'title' => esc_html__('Extras', 'darkify'),
293 - 'icon' => 'icofont-holding-hands',
294 - 'fields' => array(
295 - // Enable Tooltip On Floating Switch
296 - array(
297 - 'id' => 'darkify_data_remove',
298 - 'type' => 'checkbox',
299 - 'title' => esc_html__('Clean-up Data on Deletion', 'darkify'),
300 - 'title_help' =>
301 - '<div class="darkify-info-label">' .
302 - esc_html__('Enable this option to completely remove all Darkify data when the plugin is deleted.', 'darkify') .
303 - '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#backup" target="_blank">' .
304 - esc_html__('Live Demo', 'darkify') .
305 - '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#extras" target="_blank">' .
306 - esc_html__('Open Docs', 'darkify') .
307 - '</a>',
308 -
309 - ),
310 - array(
311 - 'type' => 'heading',
312 - 'title' => esc_html__('Backup', 'darkify'),
313 - ),
314 - array(
315 - 'title' => esc_html__('Backup and Restore Settings', 'darkify'),
316 - 'title_help' =>
317 - '<div class="darkify-info-label">' .
318 - esc_html__('Use these options to back up your settings for safekeeping or restore them when needed. You can export your current settings as a .json file and import it anytime to restore your configuration.', 'darkify') .
319 - '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#backup" target="_blank">' .
320 - __('Live Demo', 'darkify') .
321 - '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#extras" target="_blank">' .
322 - __('Open Docs', 'darkify') .
323 - '</a>',
324 -
325 - 'type' => 'backup',
326 - ),
327 - )
328 - ),
329 - )
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',
330 187 ),
331 - ),
188 + )
332 189 ));
333 190 }
334 191 }