PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 3.2.4.5
Adminify – White Label, Admin Menu Editor, Login Customizer v3.2.4.5
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / Admin / Options / General_Layout_Mode.php

General_Layout_Mode.php in Adminify – White Label, Admin Menu Editor, Login Customizer 3.2.4.5, at Inc/Admin/Options/General_Layout_Mode.php

317 lines 12.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPAdminify\Inc\Admin\Options;
4
5 use WPAdminify\Inc\Utils;
6 use WPAdminify\Inc\Admin\AdminSettingsModel;
7 if ( !defined( 'ABSPATH' ) ) {
8 die;
9 }
10 // Cannot access directly.
11 class General_Layout_Mode extends AdminSettingsModel {
12 public function __construct() {
13 $this->general_layout_mode_settings();
14 }
15
16 public function get_defaults() {
17 return [
18 'admin_bar_mode' => 'light',
19 'admin_bar_logo_type' => 'image_logo',
20 'admin_bar_light_mode' => [
21 'admin_bar_light_logo_text' => __( 'WP Adminify', 'adminify' ),
22 'admin_bar_light_logo_text_typo' => '',
23 'admin_bar_light_logo' => '',
24 'mini_admin_bar_light_logo' => '',
25 'light_logo_size' => [
26 'width' => '150',
27 'height' => '45',
28 'unit' => 'px',
29 ],
30 ],
31 'admin_bar_dark_mode' => [
32 'admin_bar_dark_logo_text' => __( 'WP Adminify', 'adminify' ),
33 'admin_bar_dark_logo_text_typo' => '',
34 'admin_bar_dark_logo' => '',
35 'mini_admin_bar_dark_logo' => '',
36 'dark_logo_size' => [
37 'width' => '150',
38 'height' => '45',
39 'unit' => 'px',
40 ],
41 ],
42 'enable_schedule_dark_mode' => false,
43 'gutenberg_editor_logo' => '',
44 'schedule_dark_mode_type' => 'system',
45 'schedule_dark_mode_start_time' => '',
46 'schedule_dark_mode_end_time' => '',
47 ];
48 }
49
50 /**
51 * Logo Options Settings
52 *
53 * @return void
54 */
55 public function layout_mode_setting_fields( &$fields ) {
56 $fields[] = [
57 'type' => 'subheading',
58 'content' => Utils::adminfiy_help_urls(
59 __( 'Logo Options Settings', 'adminify' ),
60 'https://wpadminify.com/kb/configure-wordpress-dashboard-dark-mode/',
61 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
62 'https://www.facebook.com/groups/jeweltheme',
63 'https://wpadminify.com/support/'
64 ),
65 ];
66 $fields[] = [
67 'id' => 'admin_bar_mode',
68 'type' => 'button_set',
69 'title' => __( 'Color Mode', 'adminify' ),
70 'options' => [
71 'light' => __( 'Light Mode', 'adminify' ),
72 'dark' => __( 'Dark Mode', 'adminify' ),
73 ],
74 'default' => $this->get_default_field( 'admin_bar_mode' ),
75 ];
76 $fields[] = [
77 'id' => 'admin_bar_logo_type',
78 'type' => 'button_set',
79 'title' => __( 'Logo Type', 'adminify' ),
80 'options' => [
81 'image_logo' => __( 'Image', 'adminify' ),
82 'text_logo' => __( 'Text', 'adminify' ),
83 ],
84 'default' => $this->get_default_field( 'admin_bar_logo_type' ),
85 'dependency' => [
86 'admin_ui',
87 '==',
88 'true',
89 'true'
90 ],
91 ];
92 $fields[] = [
93 'id' => 'admin_bar_light_mode',
94 'type' => 'fieldset',
95 'fields' => [
96 [
97 'id' => 'admin_bar_light_logo_text',
98 'type' => 'text',
99 'title' => __( 'Logo Text', 'adminify' ),
100 'dependency' => [
101 'admin_bar_logo_type',
102 '==',
103 'text_logo',
104 'true'
105 ],
106 'default' => $this->get_default_field( 'admin_bar_light_mode' )['admin_bar_light_logo_text'],
107 ],
108 [
109 'id' => 'admin_bar_light_logo_text_typo',
110 'type' => 'typography',
111 'title' => __( 'Logo Text Typography', 'adminify' ),
112 'font_family' => true,
113 'font_weight' => true,
114 'font_style' => true,
115 'font_size' => true,
116 'line_height' => true,
117 'letter_spacing' => true,
118 'text_align' => false,
119 'text-transform' => true,
120 'color' => true,
121 'subset' => false,
122 'word_spacing' => true,
123 'text_decoration' => true,
124 'dependency' => [
125 'admin_bar_logo_type',
126 '==',
127 'text_logo',
128 'true'
129 ],
130 'default' => $this->get_default_field( 'admin_bar_light_mode' )['admin_bar_light_logo_text_typo'],
131 ],
132 [
133 'id' => 'admin_bar_light_logo',
134 'type' => 'media',
135 'title' => __( 'Light Logo', 'adminify' ),
136 'library' => 'image',
137 'preview_size' => 'thumbnail',
138 'button_title' => __( 'Add Light Logo', 'adminify' ),
139 'remove_title' => __( 'Remove Light Logo', 'adminify' ),
140 'default' => $this->get_default_field( 'admin_bar_light_mode' )['admin_bar_light_logo'],
141 'dependency' => [
142 'admin_bar_logo_type',
143 '==',
144 'image_logo',
145 'true'
146 ],
147 ],
148 [
149 'id' => 'light_logo_size',
150 'type' => 'dimensions',
151 'title' => __( 'Logo Size', 'adminify' ),
152 'default' => $this->get_default_field( 'admin_bar_light_mode' )['light_logo_size'],
153 'dependency' => [
154 'admin_bar_logo_type',
155 '==',
156 'image_logo',
157 'true'
158 ],
159 ],
160 [
161 'id' => 'mini_admin_bar_light_logo',
162 'type' => 'media',
163 'title' => __( 'Mini Logo', 'adminify' ),
164 'library' => 'image',
165 'preview_size' => 'thumbnail',
166 'button_title' => __( 'Add Mini Light Logo', 'adminify' ),
167 'remove_title' => __( 'Remove Mini Light Logo', 'adminify' ),
168 'dependency' => [
169 'admin_bar_logo_type|admin_ui|layout_type|menu_mode',
170 '==|==|==|==',
171 'image_logo|true|vertical|icon_menu',
172 'true'
173 ],
174 ]
175 ],
176 'dependency' => [
177 'admin_ui|admin_bar_mode',
178 '==|==',
179 'true|light',
180 'true'
181 ],
182 ];
183 $fields[] = [
184 'id' => 'admin_bar_dark_mode',
185 'type' => 'fieldset',
186 'fields' => [
187 [
188 'id' => 'admin_bar_dark_logo_text',
189 'type' => 'text',
190 'title' => __( 'Logo Text', 'adminify' ),
191 'default' => $this->get_default_field( 'admin_bar_dark_mode' )['admin_bar_dark_logo_text'],
192 'dependency' => [
193 'admin_bar_logo_type',
194 '==',
195 'text_logo',
196 'true'
197 ],
198 ],
199 [
200 'id' => 'admin_bar_dark_logo_text_typo',
201 'type' => 'typography',
202 'title' => __( 'Logo Text Typography', 'adminify' ),
203 'font_family' => true,
204 'font_weight' => true,
205 'font_style' => true,
206 'font_size' => true,
207 'line_height' => true,
208 'letter_spacing' => true,
209 'text_align' => false,
210 'text-transform' => true,
211 'color' => true,
212 'subset' => false,
213 'backup_font_family' => false,
214 'font_variant' => false,
215 'word_spacing' => true,
216 'text_decoration' => true,
217 'dependency' => [
218 'admin_bar_logo_type',
219 '==',
220 'text_logo',
221 'true'
222 ],
223 'default' => $this->get_default_field( 'admin_bar_dark_mode' )['admin_bar_dark_logo_text_typo'],
224 ],
225 [
226 'id' => 'admin_bar_dark_logo',
227 'type' => 'media',
228 'title' => __( 'Dark Logo', 'adminify' ),
229 'library' => 'image',
230 'preview_size' => 'thumbnail',
231 'button_title' => __( 'Add Dark Logo', 'adminify' ),
232 'remove_title' => __( 'Remove Dark Logo', 'adminify' ),
233 'default' => $this->get_default_field( 'admin_bar_dark_mode' )['admin_bar_dark_logo'],
234 'dependency' => [
235 'admin_bar_logo_type',
236 '==',
237 'image_logo',
238 'true'
239 ],
240 ],
241 [
242 'id' => 'dark_logo_size',
243 'type' => 'dimensions',
244 'title' => __( 'Logo Size', 'adminify' ),
245 'default' => $this->get_default_field( 'admin_bar_dark_mode' )['dark_logo_size'],
246 'dependency' => [
247 'admin_bar_logo_type',
248 '==',
249 'image_logo',
250 'true'
251 ],
252 ],
253 [
254 'id' => 'mini_admin_bar_dark_logo',
255 'type' => 'media',
256 'title' => __( 'Mini Menu Logo', 'adminify' ),
257 'library' => 'image',
258 'preview_size' => 'thumbnail',
259 'button_title' => __( 'Add Dark Mini Menu Logo', 'adminify' ),
260 'remove_title' => __( 'Remove Dark Mini Menu Logo', 'adminify' ),
261 'default' => $this->get_default_field( 'admin_bar_dark_mode' )['mini_admin_bar_dark_logo'],
262 'dependency' => [
263 'admin_bar_logo_type|admin_ui|layout_type|menu_mode',
264 '==|==|==|==',
265 'image_logo|true|vertical|icon_menu',
266 'true'
267 ],
268 ]
269 ],
270 'dependency' => [
271 'admin_ui|admin_bar_mode',
272 '==|==',
273 'true|dark',
274 'true'
275 ],
276 ];
277 $fields[] = [
278 'id' => 'gutenberg_editor_logo',
279 'type' => 'media',
280 'title' => __( 'Gutenberg Editor Logo', 'adminify' ),
281 'library' => 'image',
282 'preview_size' => 'thumbnail',
283 'button_title' => __( 'Add Gutenberg Editor Logo', 'adminify' ),
284 'remove_title' => __( 'Remove Gutenberg Editor Logo', 'adminify' ),
285 'default' => $this->get_default_field( 'gutenberg_editor_logo' ),
286 ];
287 }
288
289 public function schedule_dark_mode_fields( &$fields ) {
290 $fields[] = [
291 'type' => 'subheading',
292 'content' => __( 'Schedule Dark Mode', 'adminify' ),
293 ];
294 $fields[] = [
295 'type' => 'notice',
296 'title' => __( 'Enable Schedule Dark Mode', 'adminify' ),
297 'style' => 'warning',
298 'content' => Utils::adminify_upgrade_pro(),
299 ];
300 }
301
302 public function general_layout_mode_settings() {
303 if ( !class_exists( 'ADMINIFY' ) ) {
304 return;
305 }
306 $fields = [];
307 $this->layout_mode_setting_fields( $fields );
308 $this->schedule_dark_mode_fields( $fields );
309 \ADMINIFY::createSection( $this->prefix, [
310 'title' => __( 'Dark/Light Mode', 'adminify' ),
311 'icon' => 'fas fa-adjust',
312 'fields' => $fields,
313 ] );
314 }
315
316 }
317