PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 3.1.6
Adminify – White Label, Admin Menu Editor, Login Customizer v3.1.6
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_Settings.php

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

272 lines 9.3 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_Settings extends AdminSettingsModel
12 {
13 public function __construct()
14 {
15 $this->general_settings();
16 }
17
18 public function get_defaults()
19 {
20 return [
21 'adminify_theme' => 'preset1',
22 'adminify_theme_custom_colors' => [
23 '--adminify-preset-background' => '#F9F9F9',
24 '--adminify-menu-bg' => '#4738a6',
25 '--adminify-menu-text-color' => '#ffffff',
26 '--adminify-admin-bar-bg' => '#4738a6',
27 '--adminify-admin-bar-icon' => '#ffffff',
28 '--adminify-admin-bar-input-bg' => '#594caf',
29 '--adminify-admin-bar-input-text' => '#ffffff',
30 '--adminify-notif-bg-color' => '#FD49A0',
31 '--adminify-btn-bg' => '#48c7fd',
32 ],
33 'admin_general_google_font' => [
34 'font-family' => 'Nunito Sans',
35 'font-weight' => '400',
36 'type' => 'google',
37 'font-size' => '',
38 'line-height' => '',
39 'color' => '',
40 'output' => 'body',
41 ],
42 'admin_general_bg' => 'color',
43 'admin_general_bg_color' => '',
44 'admin_general_bg_gradient' => [
45 'background-color' => '#0347FF',
46 'background-gradient-color' => '#fd1919',
47 'background-gradient-direction' => '135deg',
48 ],
49 'admin_general_bg_image' => '',
50 'admin_general_bg_slideshow' => '',
51 'admin_general_bg_video_type' => 'youtube',
52 'admin_general_bg_video_self_hosted' => '',
53 'admin_general_bg_video_youtube' => '',
54 'admin_general_bg_video_loop' => true,
55 'admin_general_bg_video_poster' => '',
56 'admin_glass_effect' => true,
57 'admin_danger_button_color' => [
58 'primary_color' => '#c30052',
59 'secondary_color' => '#fff',
60 ],
61 ];
62 }
63
64 public function general_template_preset_google_fonts( &$fields )
65 {
66 $fields[] = [
67 'type' => 'subheading',
68 'content' => Utils::adminfiy_help_urls(
69 __( 'Customize Settings', 'adminify' ),
70 'https://wpadminify.com/kb/admin-customization/',
71 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
72 'https://www.facebook.com/groups/jeweltheme',
73 'https://wpadminify.com/support/'
74 ),
75 ];
76 $fields[] = [
77 'id' => 'adminify_theme',
78 'type' => 'image_select',
79 'title' => __( 'Adminify UI Templates', 'adminify' ),
80 'options' => [
81 'preset1' => WP_ADMINIFY_ASSETS_IMAGE . 'presets/preset-1.png',
82 'preset2' => WP_ADMINIFY_ASSETS_IMAGE . 'presets/preset-2.png',
83 'preset3' => WP_ADMINIFY_ASSETS_IMAGE . 'presets/preset-3.png',
84 'preset4' => WP_ADMINIFY_ASSETS_IMAGE . 'presets/preset-4.png',
85 'preset5' => WP_ADMINIFY_ASSETS_IMAGE . 'presets/preset-5.png',
86 'preset6' => WP_ADMINIFY_ASSETS_IMAGE . 'presets/preset-6.png',
87 'preset7' => WP_ADMINIFY_ASSETS_IMAGE . 'presets/preset-7.png',
88 'preset8' => WP_ADMINIFY_ASSETS_IMAGE . 'presets/preset-8.png',
89 'preset9' => WP_ADMINIFY_ASSETS_IMAGE . 'presets/preset-9.png',
90 'custom' => WP_ADMINIFY_ASSETS_IMAGE . 'presets/preset-10.png',
91 ],
92 'default' => $this->get_default_field( 'adminify_theme' ),
93 ];
94 $fields[] = [
95 'title' => '',
96 'type' => 'notice',
97 'style' => 'warning',
98 'content' => Utils::adminify_upgrade_pro(),
99 'dependency' => [
100 'adminify_theme|adminify_theme',
101 '!=|!=',
102 'preset1|preset2',
103 'any'
104 ],
105 ];
106 $fields[] = [
107 'title' => 'Body Font',
108 'type' => 'notice',
109 'style' => 'warning',
110 'content' => Utils::adminify_upgrade_pro(),
111 ];
112 }
113
114 public function general_gradient_bg( &$fields )
115 {
116 $fields[] = [
117 'title' => '',
118 'type' => 'notice',
119 'style' => 'warning',
120 'content' => Utils::adminify_upgrade_pro(),
121 'dependency' => [
122 'admin_general_bg',
123 '==',
124 'gradient',
125 true
126 ],
127 ];
128 }
129
130 public function general_image_bg( &$fields )
131 {
132 $fields[] = [
133 'title' => '',
134 'type' => 'notice',
135 'style' => 'warning',
136 'content' => Utils::adminify_upgrade_pro(),
137 'dependency' => [
138 'admin_general_bg',
139 '==',
140 'image',
141 true
142 ],
143 ];
144 }
145
146 public function general_slideshow_bg( &$fields )
147 {
148 $fields[] = [
149 'title' => '',
150 'type' => 'notice',
151 'style' => 'warning',
152 'content' => Utils::adminify_upgrade_pro(),
153 'dependency' => [
154 'admin_general_bg',
155 '==',
156 'slideshow',
157 true
158 ],
159 ];
160 }
161
162 public function general_glass_effect_bg( &$fields )
163 {
164 $fields[] = [
165 'title' => __( 'Glass Effect', 'adminify' ),
166 'type' => 'notice',
167 'style' => 'warning',
168 'content' => Utils::adminify_upgrade_pro(),
169 ];
170 }
171
172 public function general_video_bg( &$fields )
173 {
174 $fields[] = [
175 'title' => '',
176 'type' => 'notice',
177 'style' => 'warning',
178 'content' => Utils::adminify_upgrade_pro(),
179 'dependency' => [
180 'admin_general_bg',
181 '==',
182 'video',
183 true
184 ],
185 ];
186 }
187
188 public function general_fields( &$fields )
189 {
190 $fields[] = [
191 'type' => 'subheading',
192 'content' => __( 'Body Background', 'adminify' ),
193 ];
194 $fields[] = [
195 'id' => 'admin_general_bg',
196 'type' => 'button_set',
197 'title' => 'Background Type',
198 'options' => [
199 'color' => __( 'Color', 'adminify' ),
200 'gradient' => __( 'Gradient', 'adminify' ),
201 'image' => __( 'Image', 'adminify' ),
202 'slideshow' => __( 'Slideshow', 'adminify' ),
203 'video' => __( 'Video', 'adminify' ),
204 ],
205 'default' => 'color',
206 ];
207 $fields[] = [
208 'id' => 'admin_general_bg_color',
209 'type' => 'color',
210 'title' => __( 'Background Color', 'adminify' ),
211 'default' => '',
212 'dependency' => [
213 'admin_general_bg',
214 '==',
215 'color',
216 true
217 ],
218 ];
219 }
220
221 public function general_customization( &$fields )
222 {
223 $fields[] = [
224 'type' => 'subheading',
225 'content' => __( 'Button Customization', 'adminify' ),
226 ];
227 // $fields[] = [
228 // 'id' => 'admin_general_button_color',
229 // 'type' => 'color_group',
230 // 'title' => __('Button', 'adminify'),
231 // 'subtitle' => __('Change Admin Button Colors', 'adminify'),
232 // 'options' => [
233 // 'primary_color' => __('Primary Color', 'adminify'),
234 // 'secondary_color' => __('Secondary Color', 'adminify'),
235 // ],
236 // 'default' => $this->get_default_field('admin_general_button_color'),
237 // ];
238 $fields[] = [
239 'id' => 'admin_danger_button_color',
240 'type' => 'color_group',
241 'title' => __( 'Danger Button', 'adminify' ),
242 'subtitle' => __( 'Change Admin Delete Button Colors', 'adminify' ),
243 'options' => [
244 'primary_color' => __( 'Background Color', 'adminify' ),
245 'secondary_color' => __( 'Hover Background Color', 'adminify' ),
246 ],
247 'default' => $this->get_default_field( 'admin_danger_button_color' ),
248 ];
249 }
250
251 public function general_settings()
252 {
253 if ( !class_exists( 'ADMINIFY' ) ) {
254 return;
255 }
256 $fields = [];
257 $this->general_template_preset_google_fonts( $fields );
258 $this->general_fields( $fields );
259 $this->general_gradient_bg( $fields );
260 $this->general_image_bg( $fields );
261 $this->general_slideshow_bg( $fields );
262 $this->general_video_bg( $fields );
263 // self::general_glass_effect_bg($fields);
264 $this->general_customization( $fields );
265 \ADMINIFY::createSection( $this->prefix, [
266 'title' => __( 'Customize', 'adminify' ),
267 'icon' => 'fas fa-fill-drip',
268 'fields' => $fields,
269 ] );
270 }
271
272 }