PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.0.2.5
Adminify – White Label, Admin Menu Editor, Login Customizer v4.0.2.5
4.3.2 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 All 165 releases
adminify / Inc / Modules / DashboardWidget / DashboardWidget_Setttings.php

DashboardWidget_Setttings.php in Adminify – White Label, Admin Menu Editor, Login Customizer 4.0.2.5, at Inc/Modules/DashboardWidget/DashboardWidget_Setttings.php

679 lines 24.5 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\Modules\DashboardWidget;
4
5 use WPAdminify\Inc\Utils;
6 // no direct access allowed
7 if (!defined('ABSPATH')) {
8 exit;
9 }
10
11 /**
12 * WPAdminify
13 *
14 * @package Module: Dashboard Widget
15 *
16 * @author Jewel Theme <[email protected]>
17 */
18
19 if (!class_exists('DashboardWidget_Setttings')) {
20
21 class DashboardWidget_Setttings extends DashboardWidgetModel
22 {
23
24 public function __construct()
25 {
26 // this should be first so the default values get stored
27 $this->dashboard_widget_settings();
28 parent::__construct((array) get_option($this->prefix));
29
30 add_action('admin_enqueue_scripts', [$this, 'dash_widget_setting_css']);
31 }
32
33
34 /**
35 * Dashboard Admin Custom CSS
36 *
37 * @return void
38 */
39 public function dash_widget_setting_css()
40 {
41 $css = '
42 .adminify-dashboard-widgets .adminify-header{
43 margin-top:30px;
44 }
45 .adminify-dashboard-widgets .adminify-header-right{
46 padding: 25px;
47 }
48 .adminify-dashboard-widgets .wp-adminify-dashboard-widgets form{
49 background: #fff;
50 }
51 .adminify-dashboard-widgets .adminify-section .adminify-field-subheading{
52 background-color: transparent;
53 }';
54
55 printf('<style>body.wp-adminify{%s}</style>', wp_strip_all_tags($css));
56 }
57
58
59
60 public function get_defaults()
61 {
62 return [
63 'dashboard_widget_types' => [
64 'dashboard_widgets' => [
65 'title' => '',
66 'widget_pos' => 'normal',
67 'widget_type' => 'editor',
68 'dashw_video' => [
69 'dashw_type_video_type' => 'self_hosted',
70 'dashw_type_video_title' => '',
71 'dashw_type_video_type_self_hosted' => [
72 'url' => '',
73 'id' => '',
74 'width' => '',
75 'height' => '',
76 'thumbnail' => '',
77 'alt' => '',
78 'title' => '',
79 'description' => '',
80 ],
81 'dashw_type_video_type_youtube' => '',
82 'dashw_type_video_type_vimeo' => '',
83 ],
84 'dashw_type_editor' => '',
85 'dashw_type_icon' => '',
86 'dashw_type_icon_tooltip' => '',
87 'dashw_type_icon_link' => [
88 'url' => 'https://wpadminify.com/',
89 'text' => __('WP Adminify', 'adminify'),
90 'target' => '_blank',
91 ],
92 'dashw_type_shortcode' => '',
93 'dashw_type_script' => '<script>
94 ;(function($) {
95 "use strict";
96 $(document).ready( function() {
97 // Write your JS code here
98 });
99 })( jQuery );
100 </script>',
101 'dashw_type_rss_feed' => '',
102 'dashw_type_rss_count' => 5,
103 'dashw_type_rss_excerpt' => true,
104 'dashw_type_rss_date' => true,
105 'dashw_type_rss_author' => true,
106 'user_roles' => '',
107
108 ],
109 'welcome_dash_widget' => [
110 'enable_custom_welcome_dash_widget' => false,
111 'widget_template_type' => 'specific_page',
112 'custom_page' => '',
113 'panel_height' => 600,
114 'elementor_section_id' => '',
115 'elementor_widget_id' => '',
116 'elementor_template_id' => '',
117 'oxygen_template_id' => '',
118 'dismissible' => true,
119 'user_roles' => '',
120 ],
121 ],
122 ];
123 }
124
125
126 /**
127 * Welcome Widget Settings
128 *
129 * @param [type] $welcome_widgets
130 *
131 * @return void
132 */
133 public function welcome_widgets_settings(&$welcome_widgets)
134 {
135 $welcome_widget_fields = [];
136 $this->welcome_widget_fields($welcome_widget_fields);
137 $welcome_widgets[] = [
138 'id' => 'welcome_dash_widget',
139 'type' => 'fieldset',
140 'class' => 'adminify-one-col',
141 'title' => '',
142 'fields' => $welcome_widget_fields,
143 ];
144 }
145
146 public function welcome_widget_fields(&$welcome_widget_fields)
147 {
148 $welcome_widget_fields[] = [
149 'id' => 'enable_custom_welcome_dash_widget',
150 'type' => 'switcher',
151 'title' => __('Enable Custom Welcome Panel?', 'adminify'),
152 'subtitle' => __('Enable if you want to show any Elementor Template/Page on Welcome Panel', 'adminify'),
153 'text_on' => __('Enable', 'adminify'),
154 'text_off' => __('Disable', 'adminify'),
155 'default' => $this->get_default_field('dashboard_widget_types')['welcome_dash_widget']['enable_custom_welcome_dash_widget'],
156 'text_width' => 100,
157 ];
158
159 // Default Page
160 $page_type_options = [
161 'specific_page' => __('Page', 'adminify'),
162 ];
163
164 // Oxygen Builder Support
165 if (Utils::is_plugin_active('oxygen/functions.php')) {
166 $page_oxygen_options = [];
167 $page_oxygen_options = [
168 'oxygen_template' => __('Oxygen Template', 'adminify'),
169 ];
170 $page_type_options = array_merge($page_type_options, $page_oxygen_options);
171 }
172
173 // Elementor Builder
174 if (Utils::is_plugin_active('elementor/elementor.php')) {
175 $page_elementory_options = [];
176 $page_elementory_options = [
177 'elementor_template' => __('Elementor Page Template', 'adminify'),
178 'elementor_section' => __('Elementor Saved Section', 'adminify'),
179 'elementor_widget' => __('Elementor Saved Widget', 'adminify'),
180 ];
181 $page_type_options = array_merge($page_type_options, $page_elementory_options);
182 }
183
184 $welcome_widget_fields[] = [
185 'id' => 'widget_template_type',
186 'type' => 'select',
187 'title' => __('Select Page/Template', 'adminify'),
188 'placeholder' => __('Select an option', 'adminify'),
189 'options' => $page_type_options,
190 'default' => $this->get_default_field('dashboard_widget_types')['welcome_dash_widget']['widget_template_type'],
191 'dependency' => ['enable_custom_welcome_dash_widget', '==', 'true', true],
192 ];
193
194 // Default Page
195 $welcome_widget_fields[] = [
196 'id' => 'custom_page',
197 'type' => 'select',
198 'title' => __('Select Page', 'adminify'),
199 'placeholder' => __('Select a Page', 'adminify'),
200 'options' => 'pages',
201 'default' => $this->get_default_field('dashboard_widget_types')['welcome_dash_widget']['custom_page'],
202 'dependency' => ['widget_template_type|enable_custom_welcome_dash_widget', '==|==', 'specific_page|true', true],
203 ];
204
205
206 $welcome_widget_fields[] = [
207 'id' => 'panel_height',
208 'type' => 'number',
209 'title' => __('Panel Height', 'adminify'),
210 'unit' => 'px',
211 'default' => 100,
212 'default' => $this->get_default_field('dashboard_widget_types')['welcome_dash_widget']['panel_height'],
213 'dependency' => ['widget_template_type|enable_custom_welcome_dash_widget', '==|==', 'specific_page|true', true],
214 ];
215
216 // Oxygen Builder
217 if (Utils::is_plugin_active('oxygen/functions.php')) {
218 $welcome_widget_fields[] = [
219 'id' => 'oxygen_template_id',
220 'type' => 'select',
221 'title' => __('Select Template', 'adminify'),
222 'placeholder' => __('Select a Template', 'adminify'),
223 'options' => 'posts',
224 'query_args' => [
225 'post_type' => 'ct_template',
226 ],
227 'default' => $this->get_default_field('dashboard_widget_types')['welcome_dash_widget']['oxygen_template_id'],
228 'dependency' => ['widget_template_type|enable_custom_welcome_dash_widget', '==|==', 'oxygen_template|true', true],
229 ];
230 }
231
232 // Elementor Builder
233 if (Utils::is_plugin_active('elementor/elementor.php')) {
234 $welcome_widget_fields[] = [
235 'id' => 'elementor_section_id',
236 'type' => 'select',
237 'title' => __('Saved Section', 'adminify'),
238 'options' => 'WPAdminify\Inc\Utils::get_section_template_options',
239 'default' => $this->get_default_field('dashboard_widget_types')['welcome_dash_widget']['elementor_section_id'],
240 'dependency' => ['widget_template_type|enable_custom_welcome_dash_widget', '==|==', 'elementor_section|true', true],
241 ];
242
243 $welcome_widget_fields[] = [
244 'id' => 'elementor_widget_id',
245 'type' => 'select',
246 'title' => __('Saved Widget', 'adminify'),
247 'options' => 'WPAdminify\Inc\Utils::get_widget_template_options',
248 'default' => $this->get_default_field('dashboard_widget_types')['welcome_dash_widget']['elementor_widget_id'],
249 'dependency' => ['widget_template_type|enable_custom_welcome_dash_widget', '==|==', 'elementor_widget|true', true],
250 ];
251
252 $welcome_widget_fields[] = [
253 'id' => 'elementor_template_id',
254 'type' => 'select',
255 'title' => __('Saved Template', 'adminify'),
256 'options' => 'WPAdminify\Inc\Utils::get_page_template_options',
257 'default' => $this->get_default_field('dashboard_widget_types')['welcome_dash_widget']['elementor_template_id'],
258 'dependency' => ['widget_template_type|enable_custom_welcome_dash_widget', '==|==', 'elementor_template|true', true],
259 ];
260 }
261
262
263 $welcome_widget_fields[] = [
264 'id' => 'dismissible',
265 'type' => 'switcher',
266 'title' => sprintf(__('Dismissible %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
267 'class' => 'adminify-pro-fieldset adminify-pro-notice',
268 'default' => $this->get_default_field('dashboard_widget_types')['welcome_dash_widget']['dismissible'],
269 'dependency' => ['enable_custom_welcome_dash_widget', '==', 'true', true],
270 ];
271
272 $welcome_widget_fields[] = [
273 'id' => 'user_roles',
274 'type' => 'select',
275 'title' => __('Allowed User Roles', 'adminify'),
276 'subtitle' => __('Allow users to access this section', 'adminify'),
277 'placeholder' => __('Select a role', 'adminify'),
278 'chosen' => true,
279 'multiple' => true,
280 'options' => 'roles',
281 'default' => $this->get_default_field('dashboard_widget_types')['welcome_dash_widget']['user_roles'],
282 'dependency' => ['enable_custom_welcome_dash_widget', '==', 'true', true],
283 ];
284 }
285
286 /**
287 * Dashboard Widgets Setting
288 *
289 * @param [type] $dash_widgets_setting
290 *
291 * @return void
292 */
293 public function dash_widget_setting_setup(&$dash_widgets_setting)
294 {
295 $dash_widgets = [];
296 $this->dashboard_widgets($dash_widgets);
297
298 $welcome_widgets = [];
299 $this->welcome_widgets_settings($welcome_widgets);
300
301 $dash_widgets_setting[] = [
302 'type' => 'subheading',
303 'id' => 'dashboard_widget_types_subheading',
304 'content' => Utils::adminfiy_help_urls(
305 __('Custom Dashboard & Welcome Widgets', 'adminify'),
306 'https://wpadminify.com/kb/wordpress-custom-dashboard-widget',
307 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
308 'https://www.facebook.com/groups/jeweltheme',
309 \WPAdminify\Inc\Admin\AdminSettings::support_url()
310 ),
311 ];
312
313 $dash_widgets_setting[] = [
314 'id' => 'dashboard_widget_types',
315 'type' => 'tabbed',
316 'title' => '',
317 'tabs' => [
318 [
319 'title' => __('Dashboard Widgets', 'adminify'),
320 'id' => 'dashboard_widgets_tab',
321 'fields' => $dash_widgets,
322 ],
323
324 [
325 'title' => __('Welcome Widget', 'adminify'),
326 'id' => 'welcome_widgets_tab',
327 'fields' => $welcome_widgets,
328 ],
329
330 ],
331 ];
332 }
333
334 /**
335 * Dashboard Widgets Section
336 *
337 * @param [type] $dash_widgets
338 *
339 * @return void
340 */
341 public function dashboard_widgets(&$dash_widgets)
342 {
343 $dashboard_group_fields = [];
344 $this->dashboard_widget_group_fields($dashboard_group_fields);
345
346 $dash_widgets[] = [
347 'id' => 'dashboard_widgets',
348 'type' => 'group',
349 'title' => '',
350 'max' => 2,
351 'max_text' => __('Get <strong>Pro Version</strong> to Unlock this feature. <a href="https://wpadminify.com/pricing" target="_blank">Upgrade to Pro Now!</a>', 'adminify'),
352 'accordion_title_title' => __('Dashboard Widget Name:', 'adminify'),
353 'accordion_title_prefix' => __('Dashboard Widget Name: ', 'adminify'),
354 'accordion_title_number' => true,
355 'accordion_title_auto' => true,
356 'button_title' => __('Add New Widget', 'adminify'),
357 'fields' => $dashboard_group_fields,
358 ];
359 }
360
361
362 public function dashboard_widget_group_fields(&$dashboard_group_fields)
363 {
364 $dashboard_widget_video = [];
365 $this->dashboard_widget_video($dashboard_widget_video);
366
367 $dashboard_group_fields[] = [
368 'id' => 'title',
369 'type' => 'text',
370 'title' => __('Widget Title', 'adminify'),
371 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['title'],
372 ];
373
374 $dashboard_group_fields[] = [
375 'id' => 'widget_pos',
376 'type' => 'button_set',
377 'title' => __('Widget Position', 'adminify'),
378 'options' => [
379 'side' => __('Side', 'adminify'),
380 'normal' => __('Normal', 'adminify'),
381 ],
382 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['widget_pos'],
383 ];
384
385 $dashboard_group_fields[] = [
386 'id' => 'widget_type',
387 'type' => 'button_set',
388 'title' => __('Content Type', 'adminify'),
389 'options' => [
390 'editor' => __('Editor', 'adminify'),
391 'icon' => __('Icon', 'adminify'),
392 'video' => __('Video', 'adminify'),
393 'shortcode' => __('Shortcode', 'adminify'),
394 'rss_feed' => __('RSS Feed', 'adminify'),
395 'script' => __('Script', 'adminify'),
396 ],
397 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['widget_type'],
398 ];
399
400 $dashboard_group_fields[] = [
401 'id' => 'dashw_video',
402 'type' => 'fieldset',
403 'title' => __('Video', 'adminify'),
404 'fields' => $dashboard_widget_video,
405 'dependency' => ['widget_type', '==', 'video'],
406 ];
407
408 $dashboard_group_fields[] = [
409 'id' => 'dashw_type_editor',
410 'type' => 'wp_editor',
411 'title' => __('Content', 'adminify'),
412 'subtitle' => __('Contents with Editor and HTML mode', 'adminify'),
413 'height' => '100px',
414 'dependency' => ['widget_type', '==', 'editor'],
415 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_type_editor'],
416 ];
417
418
419 $dashboard_group_fields[] = [
420 'id' => 'dashw_type_icon',
421 'type' => 'icon',
422 'title' => sprintf(__('Icon %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
423 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
424 'dependency' => ['widget_type', '==', 'icon'],
425 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_type_icon'],
426 ];
427
428 $dashboard_group_fields[] = [
429 'id' => 'dashw_type_icon_tooltip',
430 'type' => 'text',
431 'title' => sprintf(__('Tooltip Text %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
432 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
433 'dependency' => ['widget_type', '==', 'icon'],
434 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_type_icon_tooltip'],
435 ];
436
437
438 $dashboard_group_fields[] = [
439 'id' => 'dashw_type_icon_link',
440 'type' => 'link',
441 'title' => sprintf(__('Link %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
442 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
443 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_type_icon_link'],
444 'dependency' => ['widget_type', '==', 'icon'],
445 ];
446
447
448 $dashboard_group_fields[] = [
449 'id' => 'dashw_type_shortcode',
450 'type' => 'textarea',
451 'title' => sprintf(__('Shortcode %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
452 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
453 'dependency' => ['widget_type', '==', 'shortcode'],
454 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_type_shortcode'],
455 ];
456
457
458 $dashboard_group_fields[] = [
459 'id' => 'dashw_type_script',
460 'type' => 'code_editor',
461 'title' => sprintf(__('Script %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
462 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
463 'subtitle' => __('Write Custom Script code inside <strong>&lt;script&gt;&lt;/script&gt;</strong> tag.', 'adminify'),
464 'settings' => [
465 'theme' => 'dracula',
466 'mode' => 'htmlmixed',
467 ],
468 'sanitize' => false,
469 'dependency' => ['widget_type', '==', 'script'],
470 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_type_script'],
471 ];
472
473 $dashboard_group_fields[] = [
474 'id' => 'dashw_type_rss_feed',
475 'type' => 'text',
476 'title' => sprintf(__('RSS Feed URL %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
477 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
478 'dependency' => ['widget_type', '==', 'rss_feed'],
479 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_type_rss_feed'],
480 ];
481
482 $dashboard_group_fields[] = [
483 'id' => 'dashw_type_rss_count',
484 'type' => 'number',
485 'title' => sprintf(__('No. of Feed Posts %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
486 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
487 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_type_rss_count'],
488 'dependency' => ['widget_type', '==', 'rss_feed'],
489 ];
490
491 $dashboard_group_fields[] = [
492 'id' => 'dashw_type_rss_excerpt',
493 'type' => 'switcher',
494 'title' => sprintf(__('Show Excerpt? %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
495 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
496 'text_on' => __('Yes', 'adminify'),
497 'text_off' => __('No', 'adminify'),
498 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_type_rss_excerpt'],
499 'dependency' => ['widget_type', '==', 'rss_feed'],
500 ];
501
502 $dashboard_group_fields[] = [
503 'id' => 'dashw_type_rss_date',
504 'type' => 'switcher',
505 'title' => sprintf(__('Show Date? %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
506 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
507 'text_on' => __('Yes', 'adminify'),
508 'text_off' => __('No', 'adminify'),
509 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_type_rss_date'],
510 'dependency' => ['widget_type', '==', 'rss_feed'],
511 ];
512
513
514 $dashboard_group_fields[] = [
515 'id' => 'dashw_type_rss_author',
516 'type' => 'switcher',
517 'title' => sprintf(__('Show Author? %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
518 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
519 'text_on' => __('Yes', 'adminify'),
520 'text_off' => __('No', 'adminify'),
521 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_type_rss_author'],
522 'dependency' => ['widget_type', '==', 'rss_feed'],
523 ];
524
525
526 $dashboard_group_fields[] = [
527 'id' => 'user_roles',
528 'type' => 'select',
529 'title' => __('Allowed User Roles', 'adminify'),
530 'subtitle' => __('Allow users to access this section', 'adminify'),
531 'placeholder' => __('Select a role', 'adminify'),
532 'chosen' => true,
533 'multiple' => true,
534 'options' => 'roles',
535 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['user_roles'],
536 ];
537 }
538
539 public function dashboard_widget_video(&$dashboard_widget_video)
540 {
541 $dashboard_widget_video[] = [
542 'id' => 'dashw_type_video_type',
543 'type' => 'button_set',
544 'title' => __('Video Type', 'adminify'),
545 'options' => [
546 'self_hosted' => __('Self Hosted ', 'adminify'),
547 'youtube' => __('Youtube', 'adminify'),
548 'vimeo' => __('Vimeo', 'adminify'),
549 ],
550 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_video']['dashw_type_video_type'],
551 ];
552
553
554 $dashboard_widget_video[] = [
555 'id' => 'dashw_type_video_title',
556 'type' => 'text',
557 'title' => sprintf(__('Text %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
558 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
559 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_video']['dashw_type_video_title'],
560 ];
561
562
563 $dashboard_widget_video[] = [
564 'id' => 'dashw_type_video_type_self_hosted',
565 'type' => 'media',
566 'title' => sprintf(__('Upload Video %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
567 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
568 'library' => 'video',
569 'preview' => true,
570 'dependency' => ['dashw_type_video_type', '==', 'self_hosted'],
571 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_video']['dashw_type_video_type_self_hosted'],
572 ];
573
574 $dashboard_widget_video[] = [
575 'id' => 'dashw_type_video_type_youtube',
576 'type' => 'text',
577 'title' => sprintf(__('Youtube URL %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
578 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
579 'validate' => 'adminify_validate_url',
580 'dependency' => ['dashw_type_video_type', '==', 'youtube'],
581 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_video']['dashw_type_video_type_youtube'],
582 ];
583
584 $dashboard_widget_video[] = [
585 'id' => 'dashw_type_video_type_vimeo',
586 'type' => 'text',
587 'title' => sprintf(__('Vimeo URL %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
588 'class' => 'adminify-pro-fieldset adminify-pro-notice adminify-pro-pointer',
589 'validate' => 'adminify_validate_url',
590 'dependency' => ['dashw_type_video_type', '==', 'vimeo'],
591 'default' => $this->get_default_field('dashboard_widget_types')['dashboard_widgets']['dashw_video']['dashw_type_video_type_vimeo'],
592 ];
593 }
594
595 public function dashboard_widget_settings()
596 {
597 if (!class_exists('ADMINIFY')) {
598 return;
599 }
600
601 // WP Adminify Dashboard Widgets Settings
602 \ADMINIFY::createOptions(
603 $this->prefix,
604 [
605
606 // Framework Title
607 'framework_title' => __('WP Adminify Dashboard Widget <small>by Jewel Theme</small>', 'adminify'),
608 'framework_class' => 'adminify-dashboard-widgets',
609
610 // menu settings
611 'menu_title' => __('Dashboard Widget', 'adminify'),
612 'menu_slug' => 'adminify-dashboard-widgets',
613 'menu_type' => 'submenu', // menu, submenu, options, theme, etc.
614 'menu_capability' => 'manage_options',
615 'menu_icon' => '',
616 'menu_position' => 18,
617 'menu_hook_priority' => 21,
618 'menu_hidden' => false,
619 'menu_parent' => 'wp-adminify-settings',
620
621 // footer
622 'footer_text' => ' ',
623 'footer_after' => ' ',
624 'footer_credit' => ' ',
625
626 // menu extras
627 'show_bar_menu' => false,
628 'show_sub_menu' => false,
629 'show_in_network' => false,
630 'show_in_customizer' => false,
631
632 'show_search' => false,
633 'show_reset_all' => false,
634 'show_reset_section' => false,
635 'show_footer' => true,
636 'show_all_options' => true,
637 'show_form_warning' => true,
638 'sticky_header' => false,
639 'save_defaults' => false,
640 'ajax_save' => true,
641
642 // admin bar menu settings
643 'admin_bar_menu_icon' => '',
644 'admin_bar_menu_priority' => 45,
645
646 // database model
647 'database' => 'options', // options, transient, theme_mod, network(multisite support)
648 'transient_time' => 0,
649
650 // typography options
651 'enqueue_webfont' => true,
652 'async_webfont' => false,
653
654 // others
655 'output_css' => false,
656
657 // theme and wrapper classname
658 'nav' => 'normal',
659 'theme' => 'dark',
660 'class' => 'wp-adminify-dashboard-widgets',
661 ]
662 );
663
664 $dash_widgets_setting = [];
665 $this->dash_widget_setting_setup($dash_widgets_setting);
666 $dash_widgets_setting = apply_filters('adminify_settings/dashboar_widgets', $dash_widgets_setting, $this);
667
668 \ADMINIFY::createSection(
669 $this->prefix,
670 [
671 'title' => __('Dashboard Widget', 'adminify'),
672 'icon' => 'fas fa-bolt',
673 'fields' => $dash_widgets_setting,
674 ]
675 );
676 }
677 }
678 }
679