PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 3.1.7
Adminify – White Label, Admin Menu Editor, Login Customizer v3.1.7
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.1.7, at Inc/Admin/Options/General_Layout_Mode.php

278 lines 9.4 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 {
13 public function __construct()
14 {
15 $this->general_layout_mode_settings();
16 }
17
18 public function get_defaults()
19 {
20 return [
21 'admin_bar_mode' => 'light',
22 'admin_bar_logo_type' => 'image_logo',
23 'admin_bar_light_mode' => [
24 'admin_bar_light_logo_text' => __( 'WP Adminify', 'adminify' ),
25 'admin_bar_light_logo_text_typo' => '',
26 'admin_bar_light_logo' => '',
27 'light_logo_size' => [
28 'width' => '150',
29 'height' => '45',
30 'unit' => 'px',
31 ],
32 ],
33 'admin_bar_dark_mode' => [
34 'admin_bar_dark_logo_text' => __( 'WP Adminify', 'adminify' ),
35 'admin_bar_dark_logo_text_typo' => '',
36 'admin_bar_dark_logo' => '',
37 'dark_logo_size' => [
38 'width' => '150',
39 'height' => '45',
40 'unit' => 'px',
41 ],
42 ],
43 'enable_schedule_dark_mode' => false,
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 {
57 $fields[] = [
58 'type' => 'subheading',
59 'content' => Utils::adminfiy_help_urls(
60 __( 'Logo Options Settings', 'adminify' ),
61 'https://wpadminify.com/kb/configure-wordpress-dashboard-dark-mode/',
62 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
63 'https://www.facebook.com/groups/jeweltheme',
64 'https://wpadminify.com/support/'
65 ),
66 ];
67 $fields[] = [
68 'id' => 'admin_bar_mode',
69 'type' => 'button_set',
70 'title' => __( 'Color Mode', 'adminify' ),
71 'options' => [
72 'light' => __( 'Light Mode', 'adminify' ),
73 'dark' => __( 'Dark Mode', 'adminify' ),
74 ],
75 'default' => $this->get_default_field( 'admin_bar_mode' ),
76 ];
77 $fields[] = [
78 'id' => 'admin_bar_logo_type',
79 'type' => 'button_set',
80 'title' => __( 'Logo Type', 'adminify' ),
81 'options' => [
82 'image_logo' => __( 'Image', 'adminify' ),
83 'text_logo' => __( 'Text', 'adminify' ),
84 ],
85 'default' => $this->get_default_field( 'admin_bar_logo_type' ),
86 'dependency' => [
87 'admin_ui',
88 '==',
89 'true',
90 'true'
91 ],
92 ];
93 $fields[] = [
94 'id' => 'admin_bar_light_mode',
95 'type' => 'fieldset',
96 'fields' => [
97 [
98 'id' => 'admin_bar_light_logo_text',
99 'type' => 'text',
100 'title' => __( 'Logo Text', 'adminify' ),
101 'dependency' => [
102 'admin_bar_logo_type',
103 '==',
104 'text_logo',
105 'true'
106 ],
107 'default' => $this->get_default_field( 'admin_bar_light_mode' )['admin_bar_light_logo_text'],
108 ],
109 [
110 'id' => 'admin_bar_light_logo_text_typo',
111 'type' => 'typography',
112 'title' => __( 'Logo Text Typography', 'adminify' ),
113 'font_family' => true,
114 'font_weight' => true,
115 'font_style' => true,
116 'font_size' => true,
117 'line_height' => true,
118 'letter_spacing' => true,
119 'text_align' => false,
120 'text-transform' => true,
121 'color' => true,
122 'subset' => false,
123 'word_spacing' => true,
124 'text_decoration' => true,
125 'dependency' => [
126 'admin_bar_logo_type',
127 '==',
128 'text_logo',
129 'true'
130 ],
131 'default' => $this->get_default_field( 'admin_bar_light_mode' )['admin_bar_light_logo_text_typo'],
132 ],
133 [
134 'id' => 'admin_bar_light_logo',
135 'type' => 'media',
136 'title' => __( 'Light Logo', 'adminify' ),
137 'library' => 'image',
138 'preview_size' => 'thumbnail',
139 'button_title' => __( 'Add Light Logo', 'adminify' ),
140 'remove_title' => __( 'Remove Light Logo', 'adminify' ),
141 'default' => $this->get_default_field( 'admin_bar_light_mode' )['admin_bar_light_logo'],
142 'dependency' => [
143 'admin_bar_logo_type',
144 '==',
145 'image_logo',
146 'true'
147 ],
148 ],
149 [
150 'id' => 'light_logo_size',
151 'type' => 'dimensions',
152 'title' => __( 'Logo Size', 'adminify' ),
153 'default' => $this->get_default_field( 'admin_bar_light_mode' )['light_logo_size'],
154 'dependency' => [
155 'admin_bar_logo_type',
156 '==',
157 'image_logo',
158 'true'
159 ],
160 ]
161 ],
162 'dependency' => [
163 'admin_ui|admin_bar_mode',
164 '==|==',
165 'true|light',
166 'true'
167 ],
168 ];
169 $fields[] = [
170 'id' => 'admin_bar_dark_mode',
171 'type' => 'fieldset',
172 'fields' => [
173 [
174 'id' => 'admin_bar_dark_logo_text',
175 'type' => 'text',
176 'title' => __( 'Logo Text', 'adminify' ),
177 'default' => $this->get_default_field( 'admin_bar_dark_mode' )['admin_bar_dark_logo_text'],
178 'dependency' => [
179 'admin_bar_logo_type',
180 '==',
181 'text_logo',
182 'true'
183 ],
184 ],
185 [
186 'id' => 'admin_bar_dark_logo_text_typo',
187 'type' => 'typography',
188 'title' => __( 'Logo Text Typography', 'adminify' ),
189 'font_family' => true,
190 'font_weight' => true,
191 'font_style' => true,
192 'font_size' => true,
193 'line_height' => true,
194 'letter_spacing' => true,
195 'text_align' => false,
196 'text-transform' => true,
197 'color' => true,
198 'subset' => false,
199 'backup_font_family' => false,
200 'font_variant' => false,
201 'word_spacing' => true,
202 'text_decoration' => true,
203 'dependency' => [
204 'admin_bar_logo_type',
205 '==',
206 'text_logo',
207 'true'
208 ],
209 'default' => $this->get_default_field( 'admin_bar_dark_mode' )['admin_bar_dark_logo_text_typo'],
210 ],
211 [
212 'id' => 'admin_bar_dark_logo',
213 'type' => 'media',
214 'title' => __( 'Dark Logo', 'adminify' ),
215 'library' => 'image',
216 'preview_size' => 'thumbnail',
217 'button_title' => __( 'Add Dark Logo', 'adminify' ),
218 'remove_title' => __( 'Remove Dark Logo', 'adminify' ),
219 'default' => $this->get_default_field( 'admin_bar_dark_mode' )['admin_bar_dark_logo'],
220 'dependency' => [
221 'admin_bar_logo_type',
222 '==',
223 'image_logo',
224 'true'
225 ],
226 ],
227 [
228 'id' => 'dark_logo_size',
229 'type' => 'dimensions',
230 'title' => __( 'Logo Size', 'adminify' ),
231 'default' => $this->get_default_field( 'admin_bar_dark_mode' )['dark_logo_size'],
232 'dependency' => [
233 'admin_bar_logo_type',
234 '==',
235 'image_logo',
236 'true'
237 ],
238 ]
239 ],
240 'dependency' => [
241 'admin_ui|admin_bar_mode',
242 '==|==',
243 'true|dark',
244 'true'
245 ],
246 ];
247 }
248
249 public function schedule_dark_mode_fields( &$fields )
250 {
251 $fields[] = [
252 'type' => 'subheading',
253 'content' => __( 'Schedule Dark Mode', 'adminify' ),
254 ];
255 $fields[] = [
256 'type' => 'notice',
257 'title' => __( 'Enable Schedule Dark Mode', 'adminify' ),
258 'style' => 'warning',
259 'content' => Utils::adminify_upgrade_pro(),
260 ];
261 }
262
263 public function general_layout_mode_settings()
264 {
265 if ( !class_exists( 'ADMINIFY' ) ) {
266 return;
267 }
268 $fields = [];
269 $this->layout_mode_setting_fields( $fields );
270 $this->schedule_dark_mode_fields( $fields );
271 \ADMINIFY::createSection( $this->prefix, [
272 'title' => __( 'Logo Options', 'adminify' ),
273 'icon' => 'fas fa-adjust',
274 'fields' => $fields,
275 ] );
276 }
277
278 }