PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.4.2
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.4.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
darkify / src / Admin / Views / Control.php

Control.php in Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) 1.4.2, at src/Admin/Views/Control.php

230 lines 16.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Views class for Shortcode generator options.
5 *
6 * @link https://themeatelier.net
7 * @since 1.0.0
8 *
9 * @package darkify
10 * @subpackage darkify/src/Admin/Views/Control
11 * @author ThemeAtelier<themeatelierbd@gmail.com>
12 */
13
14 namespace ThemeAtelier\Darkify\Admin\Views;
15
16 use ThemeAtelier\Darkify\Admin\Framework\Classes\Darkify;
17
18 class Control
19 {
20 /**
21 * Create Option fields for the setting options.
22 *
23 * @param string $prefix Option setting key prefix.
24 * @return void
25 */
26 public static function options($prefix)
27 {
28 Darkify::createSection(
29 $prefix,
30 array(
31 'title' => esc_html__('CONTROLS', 'darkify'),
32 'icon' => 'icofont-ui-settings',
33 'fields' => array(
34 array(
35 'type' => 'section_tab',
36 'tabs' => array(
37
38 array(
39 'title' => esc_html__('Frontend', 'darkify'),
40 'icon' => 'icofont-computer',
41 'fields' => array(
42 array(
43 'type' => 'heading',
44 'content' => esc_html__('Basic Control', 'darkify'),
45 ),
46 array(
47 'id' => 'enable_dark_mode_switch',
48 'type' => 'switcher',
49 'title' => esc_html__('Frontend Dark Mode', 'darkify'),
50 'title_help' => '<div class="darkify-info-label">' . __('Show the dark mode floating switch in your Website\'s frontend.', 'darkify') . '</div><a class="tooltip_btn_primary" href="https://darkifywp.com/controls/" target="_blank">' . __('Live Demo', 'darkify') . '</a><a class="tooltip_btn_secondary" href="https://docs.themeatelier.net/docs/darkify-pro/darkify-settings/control/" target="_blank">' . __('Open Docs', 'darkify') . '</a>',
51 'text_on' => esc_html__('Enabled', 'darkify'),
52 'text_off' => esc_html__('Disabled', 'darkify'),
53 'text_width' => 100,
54 'default' => true,
55 ),
56 array(
57 'id' => 'enable_default_dark_mode',
58 'type' => 'switcher',
59 'title' => esc_html__('Default Dark Mode', 'darkify'),
60 'title_help' => '<div class="darkify-info-label">' . __('Automatically turn your website dark by default.', 'darkify') . '</div>',
61 'text_on' => esc_html__('Enabled', 'darkify'),
62 'text_off' => esc_html__('Disabled', 'darkify'),
63 'text_width' => 100,
64 // 'title_video' => '<div class="darkify-img-tag">
65 // <video autoplay loop muted playsinline>
66 // <source src="https://plugins.svn.wordpress.org/darkify/assets/video/os-aware-darkmode.webm" type="video/webm">
67 // </video>
68 // </div><div class="darkify-info-label">Auto Convert Dropdowns to Button</div>',
69 ),
70 array(
71 'id' => 'enable_os_aware',
72 'type' => 'switcher',
73 'title' => esc_html__('OS Aware Dark Mode', 'darkify'),
74 'title_video' => '<div class="darkify-img-tag">
75 <video autoplay loop muted playsinline>
76 <source src="https://plugins.svn.wordpress.org/darkify/assets/videos/os-aware-darkmode.webm" type="video/webm">
77 </video>
78 </div><div class="darkify-info-label">Dark Mode toggling based on OS setting</div>',
79 'text_on' => esc_html__('Enabled', 'darkify'),
80 'text_off' => esc_html__('Disabled', 'darkify'),
81 'text_width' => 100,
82 'default' => true,
83 ),
84 array(
85 'id' => 'enable_keyboard_shortcut',
86 'type' => 'switcher',
87 'title' => esc_html__('Keyboard Shortcut', 'darkify'),
88 'title_help' => '<div class="darkify-info-label">' . __('Enable to dark mode by pressing Ctrl+Alt+D on windows keyboard & Ctrl+Opt|Start+D on mac.', 'darkify') . '</div>',
89 'text_on' => esc_html__('Enabled', 'darkify'),
90 'text_off' => esc_html__('Disabled', 'darkify'),
91 'text_width' => 100,
92 'default' => true,
93 ),
94 array(
95 'type' => 'heading',
96 'title' => esc_html__('Advanced Control', 'darkify'),
97 ),
98 // Enable Time Based Auto Dark Mode
99 array(
100 'id' => 'enable_time',
101 'type' => 'fieldset',
102 'fields' => array(
103 array(
104 'id' => 'enable_time_based_dark',
105 'type' => 'switcher',
106 'title' => esc_html__('Time Based Auto Dark Mode', 'darkify'),
107 'title_help' => '<div class="darkify-info-label">' . __('Automatically turn dark mode ON based on users’ localtime.', 'darkify') . '</div>',
108 'text_on' => esc_html__('Enabled', 'darkify'),
109 'text_off' => esc_html__('Disabled', 'darkify'),
110 'text_width' => 100,
111 ),
112 array(
113 'id' => 'time_based_dark_start',
114 'type' => 'datetime',
115 'title' => esc_html__('Pick a Time', 'darkify'),
116 'from_to' => true,
117 'text_from' => esc_html__('Form', 'darkify'),
118 'text_to' => esc_html__('To', 'darkify'),
119 'settings' => array(
120 'noCalendar' => true,
121 'enableTime' => true,
122 'dateFormat' => 'H:i',
123 'time_24hr' => false,
124 ),
125 'dependency' => array('enable_time_based_dark', '==', 'true'),
126 ),
127 ),
128 ),
129 array(
130 'id' => 'hide_on_desktop',
131 'type' => 'switcher',
132 'title' => esc_html__('Hide Dark Mode Switch On Desktop', 'darkify'),
133 'title_help' => '<div class="darkify-info-label">' . __('Hide the Dark Mode Floating Switch if users’ are using desktop or laptop.', 'darkify') . '</div>',
134 'text_on' => esc_html__('Yes', 'darkify'),
135 'text_off' => esc_html__('No', 'darkify'),
136 ),
137 array(
138 'id' => 'hide_on_mobile',
139 'type' => 'fieldset',
140 'fields' => array(
141 array(
142 'id' => 'hide_dark_mode_on_mobile',
143 'type' => 'switcher',
144 'title' => esc_html__('Hide Dark Mode On Mobile', 'darkify'),
145 'title_help' => '<div class="darkify-info-label">' . __('Hide the Dark Mode Floating Switch if users’ are using mobile.', 'darkify') . '</div>',
146 'text_on' => esc_html__('Yes', 'darkify'),
147 'text_off' => esc_html__('No', 'darkify'),
148 ),
149 array(
150 'id' => 'type_of_hide_by',
151 'type' => 'button_set',
152 'title' => esc_html__('Hide By', 'darkify'),
153 'options' => array(
154 'user_agent' => esc_html__('User Agent', 'darkify'),
155 'screen_size' => esc_html__('Screen Size', 'darkify'),
156 'both' => esc_html__('Both', 'darkify'),
157 ),
158 'default' => 'both',
159 'dependency' => array('hide_dark_mode_on_mobile', '==', 'true'),
160 ),
161 ),
162 ),
163 array(
164 'id' => 'show_in_menu',
165 'type' => 'fieldset',
166 'fields' => array(
167 array(
168 'id' => 'enable_switch_in_menu',
169 'type' => 'switcher',
170 'title' => esc_html__('Show Switch In Menu', 'darkify'),
171 'title_help' => '<div class="darkify-info-label">' . __('Show the dark mode toggle switch in specific menu.', 'darkify') . '</div>',
172 'text_on' => esc_html__('Yes', 'darkify'),
173 'text_off' => esc_html__('No', 'darkify'),
174 ),
175 array(
176 'id' => 'switch_in_menu_location',
177 'type' => 'select',
178 'title' => esc_html__('Select Menu', 'darkify'),
179 'options' => 'menus',
180 'empty_message' => esc_html__('You haven\'t created a menu yet. If you\'re using an FSE theme, copy the shortcode below and paste it where you want the switch to appear.', 'darkify'),
181 'dependency' => array('enable_switch_in_menu', '==', 'true'),
182 ),
183 array(
184 'id' => 'darkify_menu_shortcode_helper',
185 'type' => 'textarea',
186 'title' => esc_html__('Shortcode To Add On Menu', 'darkify'),
187 'title_help' => '<div class="darkify-info-label">' . __('You can change shortcode options value based on your pereference.', 'darkify') . '</div><div class="darkify-short-content">' . __('"switch" value can be use between 1-4 on free version. Upgrade to pro for unlocking 12 different switches.', 'darkify') . '</div>',
188 'dependency' => array('enable_switch_in_menu', '==', 'true'),
189 'default' => '[darkify switch="1" width="60px" height="60px" icon_size="40px" light_mode_bg="#121116" dark_mode_bg="#ffffff" light_mode_color="#ffffff" dark_mode_color="#121116" border="0px" border_light_color="#121119" border_dark_color="#ffffff" border_radius="7px"]'
190 ),
191 ),
192 ),
193 ),
194 ),
195 array(
196 'title' => esc_html__('Admin', 'darkify'),
197 'icon' => 'icofont-dashboard-web',
198 'fields' => array(
199
200 array(
201 'id' => 'enable_admin_panel_dark_mode',
202 'type' => 'switcher',
203 'title' => esc_html__('Admin Panel Dark Mode', 'darkify'),
204 'title_help' => '<div class="darkify-info-label">' . __( 'Switch to enable Dark Mode in WordPress Admin Panel.', 'darkify' ) . '</div><a class="tooltip_btn_primary" href="https://darkifywp.com/controls/" target="_blank">' . __( 'Live Demo', 'darkify' ) . '</a><a class="tooltip_btn_secondary" href="https://docs.themeatelier.net/docs/darkify-pro/darkify-settings/controls/#admin_controls" target="_blank">' . __( 'Open Docs', 'darkify' ) . '</a>',
205 'default' => false,
206 'text_on' => esc_html__('Enabled', 'darkify'),
207 'text_off' => esc_html__('Disabled', 'darkify'),
208 'text_width' => 100,
209 ),
210
211 array(
212 'id' => 'disallowed_admin_pages',
213 'type' => 'textarea',
214 'title' => esc_html__('Disallowed Pages', 'darkify'),
215 'title_help' => '<div class="darkify-info-label">' . __( 'If the admin page URL is like http://example.com/wp-admin/admin.php?page=darkify then darkify is it\'s page slug.', 'darkify' ) . '</div>',
216 'placeholder' => esc_html__('Enter comma separated page slugs. Example: darkify-dashboard, elementor', 'darkify'),
217 'dependency' => array('enable_admin_panel_dark_mode', '==', 'true'),
218 'class' => 'only_pro'
219 ),
220
221 ),
222 ),
223 ),
224 ),
225 ),
226 ),
227 );
228 }
229 }
230