PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.2.8
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.2.8
3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 All 156 releases
notificationx / includes / Extensions / GlobalFields.php

GlobalFields.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 3.2.8, at includes/Extensions/GlobalFields.php

2,323 lines 151.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Register Global Fields
5 *
6 * @package NotificationX\Extensions
7 */
8
9 namespace NotificationX\Extensions;
10
11 use NotificationX\Admin\InfoTooltipManager;
12 use NotificationX\Admin\Settings;
13 use NotificationX\Core\Rules;
14 use NotificationX\Core\Database;
15 use NotificationX\Core\Helper;
16 use NotificationX\Core\Locations;
17 use NotificationX\GetInstance;
18 use NotificationX\Core\Modules;
19 use NotificationX\NotificationX;
20 use NotificationX\Types\TypeFactory;
21 use Sabberworm\CSS\Value\Value;
22
23 /**
24 * @method static GlobalFields get_instance($args = null)
25 */
26 class GlobalFields {
27 /**
28 * Instance of GlobalFields
29 *
30 * @var GlobalFields
31 */
32 use GetInstance;
33
34 /**
35 * Initially Invoked when initialized.
36 */
37 public function __construct() {
38
39 // dump(Rules::logicalRule([ Rules::is('test'), Rules::is('test2') ]));
40 }
41
42 public function tabs() {
43 if(defined('NX_DEBUG') && NX_DEBUG){
44 do_action( 'qm/start', __METHOD__ );
45 do_action( 'qm/debug', __METHOD__ );
46 }
47
48 do_action('nx_before_metabox_load');
49
50 $tabs = [
51 'id' => 'notificationx_metabox_wrapper',
52 'title' => __('NotificationX', 'notificationx'),
53 'object_types' => array('notificationx'),
54 'context' => 'normal',
55 'priority' => 'high',
56 'show_header' => false,
57 'tabnumber' => true,
58 'layout' => 'horizontal',
59 'version' => defined('NOTIFICATIONX_VERSION') ? NOTIFICATIONX_VERSION : null,
60 'pro_version' => defined('NOTIFICATIONX_PRO_VERSION') ? NOTIFICATIONX_PRO_VERSION : null,
61 'is_pro_active' => NotificationX::get_instance()->is_pro(),
62 'cus_imp_limit' => Settings::get_instance()->get('settings.custom_notification_import_limit', 100),
63 'is_pro_sources' => apply_filters('nx_is_pro_sources', []),
64 'config' => [
65 'active' => "source_tab",
66 'completionTrack' => true,
67 'sidebar' => true,
68 'content_heading' => [],
69 'step' => [
70 'show' => true,
71 'buttons' => [
72 'prev' => __('Previous', 'notificationx'),
73 'next' => __('Next', 'notificationx'),
74 ]
75 ],
76
77 ],
78 'submit' => [
79 'show' => false,
80 ],
81 'tabs' => [
82 "source_tab" => [
83 'label' => __("Source", 'notificationx'),
84 'id' => "source_tab",
85 'name' => "source_tab",
86 'icon' => [
87 'type' => 'tabs',
88 'name' => 'source'
89 ],
90 'classes' => "source_tab",
91 'fields' => apply_filters('nx_source_fields', [
92 'type_section' => [
93 'label' => __("Notification Type", 'notificationx'),
94 'name' => "type_section",
95 'type' => "section",
96 'fields' => [
97 'type' => [
98 // 'label' => "Notification Type",
99 'name' => "type",
100 'type' => "radio-card",
101 'default' => "notification_bar",
102 'style' => [
103 'label' => [
104 'position' => 'top'
105 ]
106 ],
107 'options' => (array) array_map(function ($type) {
108 return [
109 'value' => $type->id,
110 'label' => $type->title,
111 'is_pro' => $type->is_pro && ! NotificationX::is_pro(),
112 'priority' => $type->priority,
113 'popup' => apply_filters('nx_pro_alert_popup', $type->popup),
114 ];
115 }, array_values(TypeFactory::get_instance()->get_all())),
116 'validation_rules' => [
117 'required' => true,
118 'label' => "Type",
119 ],
120 // 'trigger' => [
121 // 'defaults' => apply_filters( 'nx_type_trigger', [] ),
122 // ]
123 ],
124 ]
125 ],
126 'source_section' => [
127 'label' => __("Source", 'notificationx'),
128 'name' => "source_section",
129 'type' => "section",
130 'fields' => [
131 'source_error' => [
132 'type' => 'message',
133 'name' => 'source_error',
134 'messages' => apply_filters('source_error_message', []),
135 'rules' => '',
136 ],
137 'source' => [
138 // 'label' => "Source",
139 'name' => "source",
140 'type' => "radio-card",
141 'options' => apply_filters('nx_sources', []),
142 'default' => 'woocommerce',
143 'style' => [
144 'label' => [
145 'position' => 'top'
146 ]
147 ],
148 'validation_rules' => [
149 'required' => true,
150 'label' => "Source",
151 ],
152 'trigger' => [
153 'defaults' => apply_filters( 'nx_source_trigger', [
154 "custom_notification" => [
155 'show_notification_image' => '@show_notification_image:featured_image',
156 ],
157 "custom_notification_conversions" => [
158 'show_notification_image' => '@show_notification_image:featured_image',
159 ],
160 "edd" => [
161 'show_notification_image' => '@show_notification_image:featured_image',
162 ],
163 "envato" => [
164 'show_notification_image' => '@show_notification_image:featured_image',
165 ],
166 "give" => [
167 'show_notification_image' => '@show_notification_image:featured_image',
168 ],
169 "learndash" => [
170 'show_notification_image' => '@show_notification_image:featured_image',
171 ],
172 "tutor" => [
173 'show_notification_image' => '@show_notification_image:featured_image',
174 ],
175 "reviewx" => [
176 'show_notification_image' => '@show_notification_image:featured_image',
177 ],
178 "woocommerce" => [
179 'show_notification_image' => '@show_notification_image:featured_image',
180 ],
181 "surecart" => [
182 'show_notification_image' => '@show_notification_image:featured_image',
183 ],
184 "woo_reviews" => [
185 'show_notification_image' => '@show_notification_image:featured_image',
186 ],
187 "wp_reviews" => [
188 'show_notification_image' => '@show_notification_image:featured_image',
189 ],
190 "freemius_conversions" => [
191 'show_notification_image' => '@show_notification_image:featured_image',
192 ],
193 "freemius_reviews" => [
194 'show_notification_image' => '@show_notification_image:featured_image',
195 ],
196 "freemius_stats" => [
197 'show_notification_image' => '@show_notification_image:featured_image',
198 ],
199 "convertkit" => [
200 'show_notification_image' => '@show_notification_image:gravatar',
201 ],
202 "zapier" => [
203 'show_notification_image' => '@show_notification_image:gravatar',
204 ],
205 "mailchimp" => [
206 'show_notification_image' => '@show_notification_image:gravatar',
207 ],
208 "wp_comments" => [
209 'show_notification_image' => '@show_notification_image:gravatar',
210 ],
211 "cf7" => [
212 'show_notification_image' => '@show_notification_image:gravatar',
213 ],
214 "njf" => [
215 'show_notification_image' => '@show_notification_image:gravatar',
216 ],
217 "grvf" => [
218 'show_notification_image' => '@show_notification_image:gravatar',
219 ],
220 "wpf" => [
221 'show_notification_image' => '@show_notification_image:gravatar',
222 ],
223 "woocommerce_sales" => [
224 'show_notification_image' => '@show_notification_image:featured_image',
225 ],
226 ] ),
227 ]
228 ],
229 ],
230 // 'rules' => Rules::logicalRule([
231 // Rules::is('type', 'notification_bar', true),
232 // ]),
233 ],
234 ]),
235 // 'rules' => Rules::is('source', false)
236 ],
237 "design_tab" => [
238 'label' => __("Design", 'notificationx'),
239 'id' => "design_tab",
240 'name' => "design_tab",
241 'icon' => [
242 'type' => 'tabs',
243 'name' => 'design'
244 ],
245 'classes' => "design_tab",
246 'fields' => apply_filters('nx_design_tab_fields', [
247 'design_error' => [
248 'type' => 'message',
249 'name' => 'design_error',
250 'messages' => apply_filters('design_error_message', []),
251 'rules' => '',
252 ],
253 "main_preview" => [
254 'label' => __("Preview", 'notificationx'),
255 'name' => "main_preview",
256 'type' => "section",
257 'priority' => 1,
258 'fields' => [
259 'preview_field' => [
260 'name' => "preview_field",
261 'type' => "preview",
262 'label' => __('Preview', 'notificationx'),
263 'priority' => 10,
264 ],
265 ],
266 'rules' => Rules::logicalRule([
267 Rules::is( 'type', 'notification_bar' ),
268 ]),
269 ],
270 "themes" => [
271 'label' => __("Themes", 'notificationx'),
272 'name' => "themes",
273 'type' => "section",
274 'fields' => [
275 // [
276 // 'label' => __("Select Theme", 'notificationx'),
277 // 'name' => "gdpr_s_theme",
278 // 'type' => "select",
279 // 'default' => 'light',
280 // 'options' => GlobalFields::get_instance()->normalize_fields([
281 // 'light' => __('Light', 'notificationx'),
282 // 'dark' => __('Dark', 'notificationx'),
283 // ]),
284 // 'rules' => Rules::logicalRule([
285 // Rules::is( 'type', 'gdpr' ),
286 // ]),
287 // ],
288 [
289 'label' => __("Select Theme", 'notificationx'),
290 'name' => "gdpr_theme",
291 'type' => "better-toggle",
292 'default' => false,
293 'toggle_label' => ['toggle_label_1' => __('Light', 'notificationx'), 'toggle_label_2' => __('Dark', 'notificationx')],
294 'rules' => Rules::logicalRule([
295 Rules::is( 'type', 'gdpr' ),
296 ]),
297 ],
298 "themes_section" => [
299 'type' => 'section',
300 'name' => 'themes_section',
301 'classes' => NotificationX::is_pro() ? 'pro-activated' : 'pro-deactivated','rules' => Rules::logicalRule([
302 Rules::is( 'type', 'gdpr', true ),
303 ]),
304 'fields' => [
305 'themes_tab' => [
306 'type' => 'tab',
307 'name' => 'themes_tab',
308 'submit' => [
309 'show' => false,
310 ],
311 'default' => 'for_desktop',
312 'fields' => [
313 'for_desktop' => [
314 'label' => __("For Desktop", 'notificationx'),
315 'name' => 'for_desktop',
316 'id' => 'for_desktop',
317 'type' => 'section',
318 'icon' => NOTIFICATIONX_ADMIN_URL . 'images/responsive/desktop.svg',
319 ],
320 'for_mobile' => [
321 'label' => __("For Mobile", 'notificationx'),
322 'type' => 'section',
323 'name' => 'for_mobile',
324 'id' => 'for_mobile',
325 'icon' => NOTIFICATIONX_ADMIN_URL . 'images/responsive/mobile.svg',
326 'rules' => Rules::logicalRule([
327 Rules::is( 'source', ['woocommerce_sales_inline'], true ),
328 Rules::includes('type', [ 'notification_bar', 'flashing_tab', 'inline', 'sales_inline', 'offer_announcement', 'custom' ], true),
329 ]),
330 ],
331 ]
332 ],
333 ],
334 ],
335 'themes' => [
336 // 'label' => "Themes",
337 'name' => "themes",
338 'type' => "radio-card",
339 // 'default' => "conversions_theme-one",
340 'options' => apply_filters('nx_themes', []),
341 'priority' => 10,
342 'style' => [
343 'label' => [
344 'position' => 'top'
345 ]
346 ],
347 'validation_rules' => [
348 'required' => true,
349 'label' => "Theme",
350 ],
351 'trigger' => [
352 'defaults' => apply_filters('nx_themes_trigger', []),
353 ],
354 'rules' => Rules::logicalRule([
355 Rules::is('themes_tab', 'for_desktop'),
356 ]),
357 ],
358 "responsive_themes" => [
359 // 'label' => __("Mobile Responsive Themes", 'notificationx'),
360 'name' => "responsive_themes",
361 'type' => "section",
362 'priority' => 10,
363 'classes' => NotificationX::is_pro() ? 'pro-activated' : 'pro-deactivated',
364 'rules' => Rules::logicalRule([
365 Rules::is('themes_tab', 'for_mobile'),
366 ]),
367 'fields' => [
368 'res_get_pro_btn' => array(
369 'name' => 'res_get_pro_btn',
370 'text' => __( 'Get PRO to Unlock', 'notificationx' ),
371 'type' => 'button',
372 'href' => esc_url('https://notificationx.com/#pricing'),
373 'target' => '_blank',
374 'classes' => 'res_get_pro_btn',
375 ),
376 'responsive_themes' => [
377 'name' => "responsive_themes",
378 'type' => "radio-card",
379 'options' => apply_filters('nx_res_themes', []),
380 'priority' => 10,
381 'style' => [
382 'label' => [
383 'position' => 'top'
384 ]
385 ],
386 'validation_rules' => [
387 'required' => true,
388 'label' => __("Mobile Responsive Themes",'notificationx'),
389 ],
390 'trigger' => [
391 'defaults' => apply_filters('nx_themes_trigger_for_responsive', []),
392 ],
393 ],
394 'is_mobile_responsive' => [
395 'label' => __("Enable Mobile Responsive", 'notificationx'),
396 'name' => "is_mobile_responsive",
397 'type' => "toggle",
398 'default' => true,
399 'priority' => 20,
400 'is_pro' => true,
401 ],
402 ]
403 ],
404 [
405 'label' => __("Position", 'notificationx'),
406 'name' => "gdpr_position",
407 'type' => "select",
408 'default' => 'cookie_notice_bottom_right',
409 'options' => GlobalFields::get_instance()->normalize_fields([
410 'cookie_notice_bottom_left' => __('Bottom Left', 'notificationx'),
411 'cookie_notice_bottom_right' => __('Bottom Right', 'notificationx'),
412 'cookie_notice_center' => __('Center', 'notificationx'),
413 ]),
414 'rules' => Rules::logicalRule([
415 Rules::is( 'type', 'gdpr' ),
416 Rules::includes('themes', [ 'gdpr_theme-light-one', 'gdpr_theme-light-two', 'gdpr_theme-light-three',
417 'gdpr_theme-light-four', 'gdpr_theme-dark-one', 'gdpr_theme-dark-two', 'gdpr_theme-dark-three', 'gdpr_theme-dark-four' ], false),
418 ]),
419 ],
420 [
421 'label' => __("Position", 'notificationx'),
422 'name' => "gdpr_banner_position",
423 'type' => "select",
424 'default' => 'cookie_banner_bottom',
425 'options' => GlobalFields::get_instance()->normalize_fields([
426 'cookie_banner_bottom' => __('Bottom', 'notificationx'),
427 'cookie_banner_top' => __('Top', 'notificationx'),
428 ]),
429 'rules' => Rules::logicalRule([
430 Rules::is( 'type', 'gdpr' ),
431 Rules::includes('themes', [ 'gdpr_theme-banner-light-one', 'gdpr_theme-banner-light-two', 'gdpr_theme-banner-dark-one', 'gdpr_theme-banner-dark-two' ], false),
432 ]),
433 ],
434 'advance_edit' => [
435 'label' => __("Advanced Design", 'notificationx'),
436 'name' => "advance_edit",
437 'type' => "toggle",
438 'default' => false,
439 'priority' => 20,
440 'rules' => Rules::logicalRule([
441 Rules::is('themes_tab', 'for_desktop'),
442 Rules::is('themes_tab', 'nxbar_build_with_ai'),
443 ], 'or'),
444 ],
445 ]
446 ],
447 'advance_design_section' => [
448 'label' => __('Advanced Design', 'notificationx'),
449 'type' => 'section',
450 'name' => 'advance_design_section',
451 'dependency_class' => [
452 'name' => 'advance_edit',
453 'is' => true,
454 'classes' => 'advanced_active',
455 'selector' => '#advance_design_section',
456 ],
457 'fields' => [
458 "advance_edit" => [
459 'label' => __("Advanced Toggle", 'notificationx'),
460 'name' => "advance_edit",
461 'type' => "toggle",
462 'default' => false,
463 'priority' => 1,
464 ],
465 "design" => [
466 'label' => __("Design", 'notificationx'),
467 'name' => "design",
468 'type' => "section",
469 'priority' => 5,
470 'rules' => Rules::is('advance_edit', true),
471 // 'rules' => Rules::is( 'advance_edit', true ),
472 'fields' => [
473 [
474 'label' => __("Background Color", 'notificationx'),
475 'name' => "bg_color",
476 'type' => "colorpicker",
477 'default' => "#fff",
478 ],
479 [
480 'label' => __("Text Color", 'notificationx'),
481 'name' => "text_color",
482 'type' => "colorpicker",
483 'default' => "#000",
484 ],
485 [
486 'label' => __("Want Border?", 'notificationx'),
487 'name' => "border",
488 'type' => "checkbox",
489 'default' => 0,
490 ],
491 [
492 'label' => __("Border Size", 'notificationx'),
493 'name' => "border_size",
494 'type' => "number",
495 'default' => 1,
496 'rules' => Rules::is( 'border', true ),
497 ],
498 [
499 'label' => __("Border Style", 'notificationx'),
500 'name' => "border_style",
501 'type' => "select",
502 'default' => 'solid',
503 'options' => $this->normalize_fields([
504 'solid' => __('Solid', 'notificationx'),
505 'dashed' => __('Dashed', 'notificationx'),
506 'dotted' => __('Dotted', 'notificationx'),
507 ]),
508 'rules' => Rules::is( 'border', true ),
509 ],
510 [
511 'label' => __('Border Color', 'notificationx'),
512 'name' => "border_color",
513 'type' => "colorpicker",
514 'default' => "#000",
515 'rules' => Rules::is( 'border', true ),
516 ],
517 [
518 'label' => __('Discount Text Color', 'notificationx'),
519 'name' => "discount_text_color",
520 'type' => "colorpicker",
521 'default' => "#fff",
522 'rules' => Rules::logicalRule([
523 Rules::is( 'type', 'offer_announcement' ),
524 Rules::includes('themes', [ 'announcements_theme-1', 'announcements_theme-2' ], false),
525 ]),
526 ],
527 [
528 'label' => __('Discount Background', 'notificationx'),
529 'name' => "discount_background",
530 'type' => "colorpicker",
531 'rules' => Rules::logicalRule([
532 Rules::is( 'type', 'offer_announcement' ),
533 Rules::includes('themes', [ 'announcements_theme-1', 'announcements_theme-2' ], false),
534 ]),
535 ],
536 ]
537 ],
538 "typography" => [
539 'label' => __('Typography', 'notificationx'),
540 'name' => "typography",
541 'type' => "section",
542 'priority' => 10,
543 'rules' => Rules::is( 'advance_edit', true ),
544 'fields' => [
545 [
546 'label' => __('Font Size', 'notificationx'),
547 'name' => "first_font_size",
548 'type' => "number",
549 'default' => '13',
550 'description' => 'px',
551 'help' => __('This font size will be applied for <mark>first</mark> row', 'notificationx'),
552 ],
553 [
554 'label' => __('Font Size', 'notificationx'),
555 'name' => "second_font_size",
556 'type' => "number",
557 'default' => '14',
558 'description' => 'px',
559 'help' => __('This font size will be applied for <mark>second</mark> row', 'notificationx'),
560 ],
561 [
562 'label' => __('Font Size', 'notificationx'),
563 'name' => "third_font_size",
564 'type' => "number",
565 'default' => '11',
566 'description' => 'px',
567 'help' => __('This font size will be applied for <mark>third</mark> row', 'notificationx'),
568 ],
569 ]
570 ],
571 "image-appearance" => [
572 'label' => __('Image Appearance', 'notificationx'),
573 'name' => "image-appearance",
574 'type' => "section",
575 'priority' => 15,
576 'rules' => Rules::is( 'advance_edit', true ),
577 'fields' => [
578 'image_shape' => [
579 'label' => __('Image Shape', 'notificationx'),
580 'name' => "image_shape",
581 'type' => "select",
582 'default' => 'circle',
583 'priority' => 5,
584 'options' => $this->normalize_fields([
585 'circle' => __('Circle', 'notificationx'),
586 'rounded' => __('Rounded', 'notificationx'),
587 'square' => __('Square', 'notificationx'),
588 ]),
589 ],
590 'image_position' => [
591 'label' => __('Position', 'notificationx'),
592 'name' => "image_position",
593 'type' => "select",
594 'default' => 'left',
595 'priority' => 15,
596 'options' => $this->normalize_fields([
597 'left' => __('Left', 'notificationx'),
598 'right' => __('Right', 'notificationx'),
599 ]),
600 ],
601 ]
602 ],
603 "custom_css" => [
604 'label' => __('Custom CSS', 'notificationx'),
605 'name' => "custom_css",
606 'type' => "section",
607 'priority' => 150,
608 'rules' => Rules::is( 'advance_edit', true ),
609 'fields' => [
610 [
611 'label' => __('Add Custom CSS', 'notificationx'),
612 'name' => "add_custom_css",
613 'type' => "advanced-codeviewer",
614 'button_text' => __( 'Click to Copy', 'notificationx' ),
615 'success_text' => __( 'Copied to clipboard.', 'notificationx' ),
616 'is_pro' => true,
617 'copyOnClick' => false,
618 'priority' => 5,
619 'info' => InfoTooltipManager::get_instance()->render('custom_css'),
620 'help' => __('Use custom CSS to style this Notification.', 'notificationx'),
621 ],
622 ]
623 ],
624 ]
625 ]
626 ])
627 ],
628 "content_tab" => [
629 'label' => __("Content", 'notificationx'),
630 'id' => "content_tab",
631 'name' => "content_tab",
632 'icon' => [
633 'type' => 'tabs',
634 'name' => 'content'
635 ],
636 'classes' => "content_tab",
637 'fields' => apply_filters('nx_content_fields', [
638 "main_preview" => [
639 'label' => __("Preview", 'notificationx'),
640 'name' => "main_preview",
641 'type' => "section",
642 'priority' => 1,
643 'fields' => [
644 'preview_field' => [
645 'name' => "preview_field",
646 'type' => "preview",
647 'label' => __('Preview', 'notificationx'),
648 'priority' => 10,
649 ],
650 ],
651 'rules' => Rules::logicalRule([
652 Rules::is( 'type', 'notification_bar' ),
653 ]),
654 ],
655 'content' => apply_filters('nx_content_field', [
656 'label' => __("Content", 'notificationx'),
657 'name' => "content",
658 'type' => "section",
659 'priority' => 90,
660 'fields' => [
661 "notification-template" => [
662 'label' => __("Notification Template", 'notificationx'),
663 'name' => "notification-template",
664 'type' => "group",
665 'display' => 'inline',
666 'priority' => 90,
667 'fields' => apply_filters('nx_notification_template', [
668 "first_param" => [
669 // 'label' => __("First Parameter", 'notificationx'),
670 'name' => "first_param",
671 'type' => "select",
672 'priority' => 3,
673 'default' => 'tag_name',
674 'options' => $this->normalize_fields([
675 'tag_custom' => __('Custom', 'notificationx'),
676 ]),
677 ],
678 "custom_first_param" => [
679 // 'label' => __("Custom First Parameter", 'notificationx'),
680 'name' => "custom_first_param",
681 'type' => "text",
682 'priority' => 5,
683 'default' => __('Someone', 'notificationx'),
684 'rules' => Rules::is( 'notification-template.first_param', 'tag_custom' ),
685 ],
686 "second_param" => [
687 // 'label' => __("Second Param", 'notificationx'),
688 'name' => "second_param",
689 'type' => "text",
690 'priority' => 10,
691 'default' => __('recently purchased', 'notificationx'),
692 ],
693 "third_param" => [
694 // 'label' => __("Third Parameter", 'notificationx'),
695 'name' => "third_param",
696 'type' => "select",
697 'priority' => 20,
698 'default' => 'tag_title',
699 'options' => $this->normalize_fields([
700 'tag_custom' => __('Custom', 'notificationx'),
701 ]),
702 ],
703 "custom_third_param" => [
704 // 'label' => __("Custom Third Param", 'notificationx'),
705 'name' => "custom_third_param",
706 'type' => "text",
707 'priority' => 25,
708 'default' => __('Some time ago', 'notificationx'),
709 'rules' => Rules::is( 'notification-template.third_param', 'tag_custom' ),
710 ],
711 "fourth_param" => [
712 // 'label' => __("Fourth Parameter", 'notificationx'),
713 'name' => "fourth_param",
714 'type' => "select",
715 'priority' => 30,
716 'default' => 'tag_time',
717 'options' => $this->normalize_fields([
718 'tag_custom' => __('Custom', 'notificationx'),
719 ]),
720 ],
721 "custom_fourth_param" => [
722 // 'label' => __("Custom Fourth Parameter", 'notificationx'),
723 'name' => "custom_fourth_param",
724 'type' => "text",
725 'priority' => 35,
726 'default' => __('Some time ago', 'notificationx'),
727 'rules' => Rules::is( 'notification-template.fourth_param', 'tag_custom' ),
728 ],
729 "fifth_param" => [
730 // 'label' => __("Fifth Parameter", 'notificationx'),
731 'name' => "fifth_param",
732 'type' => "select",
733 'priority' => 40,
734 'options' => $this->normalize_fields([
735 'tag_custom' => __('Custom', 'notificationx'),
736 ]),
737 ],
738 "custom_fifth_param" => [
739 // 'label' => __("Custom Fifth Parameter", 'notificationx'),
740 'name' => "custom_fifth_param",
741 'type' => "text",
742 'priority' => 45,
743 'rules' => Rules::is( 'notification-template.fifth_param', 'tag_custom' ),
744 ],
745 "sixth_param" => [
746 // 'label' => __("Sixth Parameter", 'notificationx'),
747 'name' => "sixth_param",
748 'type' => "select",
749 'priority' => 50,
750 // 'default' => 'tag_custom',
751 'options' => $this->normalize_fields([
752 'tag_custom' => __('Custom', 'notificationx'),
753 ]),
754 ],
755 "custom_sixth_param" => [
756 // 'label' => __("Custom Sixth Parameter", 'notificationx'),
757 'name' => "custom_sixth_param",
758 'type' => "text",
759 'priority' => 55,
760 'rules' => Rules::is( 'notification-template.sixth_param', 'tag_custom' ),
761 ],
762
763 ]),
764 'rules' => Rules::includes( 'source', apply_filters('nx_notification_template_dependency', []) ),
765 ],
766 'template_adv' => [
767 'label' => __("Advanced Template", 'notificationx'),
768 'name' => "template_adv",
769 'type' => "toggle",
770 'default' => false,
771 'is_pro' => true,
772 'priority' => 91,
773 'info' => InfoTooltipManager::get_instance()->render('advanced_template'),
774 ],
775 'advanced_template' => [
776 'name' => 'advanced_template',
777 'type' => 'advanced-template',
778 'label' => __('Advanced Template', 'notificationx'),
779 'priority' => 92,
780 'rules' => ['is', 'template_adv', true],
781 ],
782 'random_order' => array(
783 'name' => 'random_order',
784 'label' => __('Random Order', 'notificationx'),
785 'type' => 'checkbox',
786 'priority' => 93,
787 'default' => 0,
788 'is_pro' => true,
789 'description' => __('Enable to show notification in random order.', 'notificationx'),
790 'rules' => Rules::includes('source', ['woocommerce', 'woo_reviews', "edd", "reviewx", "woo_inline", "edd_inline","surecart","custom_notification", 'woocommerce_sales','woocommerce_sales_reviews','woocommerce_sales_inline','fluentcart']),
791 'info' => InfoTooltipManager::get_instance()->render('random_order'),
792 ),
793 'product_control' => array(
794 'label' => __('Show Purchase Of', 'notificationx'),
795 'name' => 'product_control',
796 'type' => 'select',
797 'priority' => 94,
798 'default' => 'none',
799 // 'is_pro' => true,
800 // 'disable' => true,
801 'options' => GlobalFields::get_instance()->normalize_fields([
802 'none' => __('All', 'notificationx'),
803 'product_category' => __('Product Category', 'notificationx'),
804 'manual_selection' => __('Selected Product', 'notificationx'),
805 ]),
806 'info' => InfoTooltipManager::get_instance()->render('show_purchase_of'),
807 'rules' => Rules::includes('source', ['woocommerce','woocommerce_sales', 'woo_reviews', "edd", "reviewx", "woo_inline", "edd_inline","surecart",'woocommerce_sales_reviews','woocommerce_sales_inline','fluentcart','fluentcart_inline']),
808 ),
809 'category_list' => array(
810 'label' => __('Select Product Category', 'notificationx'),
811 'name' => 'category_list',
812 'type' => 'select',
813 'multiple' => true,
814 'priority' => 95,
815 'options' => apply_filters('nx_conversion_category_list', []),
816 'rules' => Rules::logicalRule([
817 Rules::includes('source', ['woocommerce' , 'woo_reviews', "edd", "reviewx", "woo_inline", "edd_inline", "surecart", 'woocommerce_sales','woocommerce_sales_reviews','woocommerce_sales_inline','fluentcart','fluentcart_inline']),
818 Rules::is( 'product_control', 'product_category' ),
819 ]),
820 ),
821 'product_list' => array(
822 'label' => __('Select Product', 'notificationx'),
823 'name' => 'product_list',
824 'type' => 'select-async',
825 'multiple' => true,
826 'priority' => 96,
827 'options' => apply_filters('nx_conversion_product_list', [
828 [
829 'label' => "Type for more result...",
830 'value' => null,
831 'disabled' => true,
832 ],
833 ]),
834 'rules' => Rules::logicalRule([
835 Rules::includes('source', ['woocommerce', 'woocommerce_sales', 'woo_reviews', "edd", "reviewx", "woo_inline", "edd_inline","surecart",'woocommerce_sales_reviews','woocommerce_sales_inline','fluentcart','fluentcart_inline']),
836 Rules::is( 'product_control', 'manual_selection' ),
837 ]),
838 'ajax' => [
839 'api' => "/notificationx/v1/get-data",
840 'data' => [
841 'type' => "@type",
842 'source' => "@source",
843 'field' => "product_list",
844 ],
845 // 'target' => "product_list",
846 'rules' => Rules::logicalRule([
847 Rules::includes('source', ['woocommerce', 'woo_reviews', "edd", "reviewx", "woo_inline", "edd_inline", "surecart", 'woocommerce_sales','woocommerce_sales_reviews','woocommerce_sales_inline','fluentcart','fluentcart_inline']),
848 Rules::is( 'product_control', 'manual_selection' ),
849 ]),
850 ],
851 ),
852 'product_exclude_by' => array(
853 'label' => __('Exclude By', 'notificationx'),
854 'name' => 'product_exclude_by',
855 'type' => 'select',
856 'priority' => 97,
857 'default' => 'none',
858 // 'is_pro' => true,
859 // 'disable' => true,
860 'options' => GlobalFields::get_instance()->normalize_fields([
861 'none' => __('None', 'notificationx'),
862 'product_category' => __('Product Category', 'notificationx'),
863 'manual_selection' => __('Selected Product', 'notificationx'),
864 ]),
865 'info' => InfoTooltipManager::get_instance()->render('exclude_by'),
866 'rules' => Rules::includes('source', ['woocommerce', 'woo_reviews', "edd", "reviewx", "woo_inline", "edd_inline","surecart", 'woocommerce_sales','woocommerce_sales_reviews','woocommerce_sales_inline','fluentcart','fluentcart_inline']),
867 ),
868 'exclude_categories' => array(
869 'label' => __('Select Product Category', 'notificationx'),
870 'name' => 'exclude_categories',
871 'type' => 'select',
872 'multiple' => true,
873 'priority' => 98,
874 'options' => apply_filters('nx_conversion_category_list', []),
875 'rules' => Rules::logicalRule([
876 Rules::includes('source', ['woocommerce', 'woo_reviews', "edd", "reviewx", "woo_inline", "edd_inline", "surecart", 'woocommerce_sales','woocommerce_sales_reviews','woocommerce_sales_inline','fluentcart','fluentcart_inline']),
877 Rules::is( 'product_exclude_by', 'product_category' ),
878 ]),
879 ),
880 'exclude_products' => array(
881 'label' => __('Select Product', 'notificationx'),
882 'name' => 'exclude_products',
883 'type' => 'select-async',
884 'multiple' => true,
885 'priority' => 99,
886 'options' => apply_filters('nx_conversion_product_list', [
887 [
888 'label' => "Type for more result...",
889 'value' => null,
890 'disabled' => true,
891 ],
892 ]),
893 'rules' => Rules::logicalRule([
894 Rules::includes('source', ['woocommerce', 'woocommerce_sales', 'woo_reviews', "edd", "reviewx", "woo_inline", "edd_inline","surecart",'woocommerce_sales_reviews','woocommerce_sales_inline','fluentcart','fluentcart_inline']),
895 Rules::is( 'product_exclude_by', 'manual_selection' ),
896 ]),
897 'ajax' => [
898 'api' => "/notificationx/v1/get-data",
899 'data' => [
900 'type' => "@type",
901 'source' => "@source",
902 'field' => "exclude_products",
903 ],
904 'rules' => Rules::logicalRule([
905 Rules::includes('source', ['woocommerce', 'woo_reviews', "edd", "reviewx", "woo_inline", "edd_inline", 'woocommerce_sales','woocommerce_sales_reviews','woocommerce_sales_inline','fluentcart','fluentcart_inline']),
906 Rules::is( 'product_exclude_by', 'manual_selection' ),
907 ]),
908 ],
909 ),
910 'order_status' => array(
911 'label' => __('Order Status', 'notificationx'),
912 'name' => 'order_status',
913 'type' => 'select',
914 'multiple' => true,
915 'is_pro' => true,
916 'priority' => 99.5,
917 'default' => ['wc-completed', 'wc-processing'],
918 'help' => __("By default it will show Processing & Completed status.",'notificationx'),
919 'options' => apply_filters('nx_woo_order_status', []),
920 'info' => InfoTooltipManager::get_instance()->render('order_status'),
921 'rules' => Rules::logicalRule([
922 Rules::includes('source', ['woocommerce', 'woocommerce_sales', "woo_inline","woocommerce_sales_inline"]),
923 Rules::includes('themes', [ 'woo_inline_stock-theme-one', 'woo_inline_stock-theme-two', 'woocommerce_sales_inline_stock-theme-one', 'woocommerce_sales_inline_stock-theme-two'], true),
924 ]),
925
926 ),
927 'surecart_order_status' => array(
928 'label' => __('Order Status', 'notificationx'),
929 'name' => 'surecart_order_status',
930 'type' => 'select',
931 'multiple' => true,
932 'is_pro' => true,
933 'priority' => 99.6,
934 'default' => ['processing','fulfilled'],
935 'help' => __("By default it will show Processing & Fulfilled status.",'notificationx'),
936 'options' => apply_filters('nx_surecart_order_status', []),
937 'info' => InfoTooltipManager::get_instance()->render('order_status'),
938 'rules' => Rules::logicalRule([
939 Rules::includes('source', ["surecart"]),
940 ]),
941 ),
942 'fluentcart_order_status' => array(
943 'label' => __('Order Status', 'notificationx'),
944 'name' => 'fluentcart_order_status',
945 'type' => 'select',
946 'multiple' => true,
947 'is_pro' => true,
948 'priority' => 99.8,
949 'default' => ['on-hold','completed','processing'],
950 'help' => __("By default it will show Processing & Fulfilled status.",'notificationx'),
951 'options' => apply_filters('nx_fluentcart_order_status', []),
952 'info' => InfoTooltipManager::get_instance()->render('order_status'),
953 'rules' => Rules::logicalRule([
954 Rules::includes('source', ["fluentcart"]),
955 ]),
956 ),
957 'combine_multiorder' => [
958 'label' => __('Combine Multi Order', 'notificationx'),
959 'name' => 'combine_multiorder',
960 'type' => 'checkbox',
961 'priority' => 99.7,
962 'default' => true,
963 'description' => __('Combine order like, 2 more products.', 'notificationx'),
964 'rules' => Rules::logicalRule([
965 Rules::is('notification-template.first_param', 'tag_sales_count', true),
966 Rules::includes('source', [ 'woocommerce', 'edd', 'woocommerce_sales' ]),
967 ]),
968 ],
969 ],
970 ]),
971 'gdpr_content' => apply_filters('nx_content_gdpr', [
972 'label' => __("Cookies Content", 'notificationx'),
973 'name' => "content",
974 'type' => "section",
975 'priority' => 95,
976 'fields' => apply_filters('nx_content_fields_gdpr', []),
977 'rules' => Rules::is('type', 'gdpr' ),
978 ]),
979 'link_options' => [
980 'label' => __('Link Options', 'notificationx'),
981 'name' => "link_options",
982 'type' => "section",
983 'priority' => 105,
984 'fields' => [
985 "link_type" => [
986 'label' => __("Link Type", 'notificationx'),
987 'name' => "link_type",
988 'type' => "select",
989 'default' => 'none',
990 'options' => apply_filters('nx_link_types', $this->normalize_fields([
991 'none' => __('None', 'notificationx'),
992 ])),
993 ],
994 'link_button' => [
995 'label' => __('Button', 'notificationx'),
996 'name' => 'link_button',
997 'type' => 'checkbox',
998 'priority' => 100,
999 'is_pro' => true,
1000 'default' => false,
1001 // 'default' => [
1002 // 'youtube_channel-1' => true,
1003 // 'youtube_channel-2' => true,
1004 // 'youtube_video-3' => true,
1005 // 'youtube_video-4' => true,
1006 // ],
1007 'info' => InfoTooltipManager::get_instance()->render('button'),
1008 'description' => __('Enable button with link', 'notificationx'),
1009 'rules' => Rules::logicalRule([
1010 Rules::includes('type', ['conversions','video','woocommerce', 'woocommerce_sales','page_analytics']),
1011 Rules::is('link_type','none',true),
1012 ]),
1013 ],
1014 ],
1015 // must be called after nx_link_types filter.
1016 'rules' => Rules::logicalRule([
1017 [ 'includes', 'source', apply_filters('nx_link_types_dependency', []) ],
1018 Rules::is( 'type', 'gdpr', true ),
1019 ]),
1020 ],
1021 ]),
1022 ],
1023 "manager_tab" => [
1024 'label' => __("Manager", 'notificationx'),
1025 'id' => "manager_tab",
1026 'name' => "manager_tab",
1027 'rules' => Rules::is('type', 'gdpr'),
1028 'icon' => [
1029 'type' => 'tabs',
1030 'name' => 'manager'
1031 ],
1032 'classes' => "manager_tab",
1033 'fields' => apply_filters('nx_manager_fields', [
1034 "main_preview" => [
1035 'label' => __("Preview", 'notificationx'),
1036 'name' => "main_preview",
1037 'type' => "section",
1038 'priority' => 1,
1039 'fields' => [
1040 'preview_field' => [
1041 'name' => "preview_field",
1042 'type' => "preview",
1043 'label' => __('Preview', 'notificationx'),
1044 'priority' => 10,
1045 ],
1046 ],
1047 'rules' => Rules::logicalRule([
1048 Rules::is( 'type', 'notification_bar' ),
1049 ]),
1050 ],
1051 'general_settngs' => [
1052 'label' => __("General Settings", 'notificationx'),
1053 'id' => "general_settngs",
1054 'name' => "general_settngs",
1055 'type' => 'section',
1056 'fields'=> [
1057 'gdpr_force_reload' => [
1058 'label' => __("Force Reload", 'notificationx'),
1059 'name' => "gdpr_force_reload",
1060 'type' => "better-toggle",
1061 'default' => false,
1062 'toggle_label' => ['toggle_label_1' => __('Enable Force Reload', 'notificationx'), 'toggle_label_2' => __('', 'notificationx')],
1063 'rules' => Rules::logicalRule([
1064 Rules::is( 'type', 'gdpr' ),
1065 ]),
1066 'info' => __('Choose whether the page should reload after the user accepts cookies. If not, your analytics software won’t register the current page visit, as cookies will only be loaded during the next page load', 'notificationx'),
1067 ],
1068 'gdpr_cookie_removal' => [
1069 'label' => __("Cookie Removal", 'notificationx'),
1070 'name' => "gdpr_cookie_removal",
1071 'type' => "better-toggle",
1072 'default' => false,
1073 'toggle_label' => ['toggle_label_1' => __('Enable Cookie Removal', 'notificationx'), 'toggle_label_2' => __('', 'notificationx')],
1074 'rules' => Rules::logicalRule([
1075 Rules::is( 'type', 'gdpr' ),
1076 ]),
1077 'info' => __('When cookies are not accepted, non-essential cookies are removed, ensuring compliance with GDPR requirements.', 'notificationx'),
1078 ],
1079 'gdpr_consent_expiry' => [
1080 'label' => __("Consent Expiry", 'notificationx'),
1081 'name' => "gdpr_consent_expiry",
1082 'type' => "number",
1083 'min' => 1,
1084 'description' => __('Days', 'notificationx'),
1085 'default' => 30,
1086 'suggestions' => [
1087 [
1088 'value' => 30,
1089 'unit' => 'days',
1090 ],
1091 [
1092 'value' => 90,
1093 'unit' => 'days',
1094 ],
1095 [
1096 'value' => 180,
1097 'unit' => 'days',
1098 ],
1099 [
1100 'value' => 365,
1101 'unit' => 'days',
1102 ],
1103 ],
1104 'rules' => Rules::logicalRule([
1105 Rules::is( 'type', 'gdpr' ),
1106 ]),
1107 'info' => __('By default, consent expires after 30 days. If needed, you can adjust this number to your preference', 'notificationx'),
1108 ],
1109 ]
1110 ],
1111 'scan_cookies' => [
1112 'label' => 'Scan Cookies',
1113 'type' => 'section',
1114 'name' => 'scan_cookies',
1115 'fields' => [
1116 'cookie_scanner' => [
1117 'type' => 'cookie-scanner',
1118 'name' => 'cookie_scanner',
1119 'id' => 'cookie_scanner',
1120 'label' => 'Cookie Scanner',
1121 ],
1122 ]
1123 ],
1124 'cookies_list_section' => [
1125 'label' => 'Cookies List',
1126 'type' => 'section',
1127 'name' => 'cookies_list_section',
1128 'fields' => [
1129 'cookies_lists' => [
1130 'type' => 'tab',
1131 'name' => 'cookies_lists',
1132 'submit' => [
1133 'show' => false,
1134 ],
1135 'default' => 'necessary_tab',
1136 'dataShare' => true,
1137 'fields' => [
1138 'necessary_tab' => [
1139 'label' => __("Necessary", 'notificationx'),
1140 'name' => 'necessary_tab',
1141 'id' => 'necessary_tab',
1142 'type' => 'section',
1143 'icon' => [
1144 'type' => 'tabs',
1145 'name' => 'necessary'
1146 ],
1147 'fields' => [
1148 'necessary_tab_info_modal' => [
1149 'name' => 'necessary_tab_info_modal',
1150 'type' => 'modal',
1151 'show_body' => true,
1152 'close_on_body' => true,
1153 'button' => [
1154 'name' => 'tab_info_edit',
1155 'text' => __(' ', 'notificationx'),
1156 'icon' => [
1157 'type' => 'tabs',
1158 'name' => 'edit_modal'
1159 ],
1160 ],
1161 'confirm_button' => [
1162 'type' => 'button',
1163 'text' => 'Save',
1164 'name' => 'necessary_close_tab_info_modal',
1165 "default" => false,
1166 'close_action' => true,
1167 ],
1168 'cancel' => "necessary_close_tab_info_modal",
1169 'body' => [
1170 'header' => __('Edit Category ', 'notificationx'),
1171 'fields' => [
1172 'tab_title' => Helper::tab_info_title('necessary', 'Necessary'),
1173 'tab_description' => Helper::tab_info_desc('necessary', 'Necessary cookies are needed to ensure the basic functions of this site, like allowing secure log-ins and managing your consent settings. These cookies do not collect any personal information.'),
1174 ],
1175 ],
1176 ],
1177 'necessary_cookie_lists' => [
1178 'label' => __('', 'notificationx'),
1179 'name' => 'necessary_cookie_lists',
1180 'type' => 'better-repeater',
1181 'priority' => 10,
1182 'placeholder_img'=> NOTIFICATIONX_ADMIN_URL . 'images/extensions/empty-cookie.png',
1183 'button' => [
1184 'label' => __('Add New', 'notificationx'),
1185 'position' => 'top',
1186 ],
1187 'default' => Helper::default_cookie_list(),
1188 'visible_fields' => ['cookies_id','load_inside', 'script_url_pattern', 'description'],
1189 '_fields' => Helper::gdpr_common_fields(),
1190 ]
1191 ],
1192 ],
1193 'functional_tab' => [
1194 'label' => __("Functional", 'notificationx'),
1195 'type' => 'section',
1196 'name' => 'functional_tab',
1197 'id' => 'functional_tab',
1198 'icon' => [
1199 'type' => 'tabs',
1200 'name' => 'functional'
1201 ],
1202 'fields' => [
1203 'functional_tab_info_modal' => [
1204 'name' => 'functional_tab_info_modal',
1205 'type' => 'modal',
1206 'show_body' => true,
1207 'close_on_body' => true,
1208 'button' => [
1209 'name' => 'tab_info_edit',
1210 'text' => __(' ', 'notificationx'),
1211 'icon' => [
1212 'type' => 'tabs',
1213 'name' => 'edit_modal'
1214 ],
1215 ],
1216 'confirm_button' => [
1217 'type' => 'button',
1218 'text' => 'Save',
1219 'name' => 'functional_close_tab_info_modal',
1220 "default" => false,
1221 'close_action' => true,
1222 ],
1223 'cancel' => "functional_close_tab_info_modal",
1224 'body' => [
1225 'header' => __('Edit Category ', 'notificationx'),
1226 'fields' => [
1227 'tab_title' => Helper::tab_info_title('functional', 'Functional'),
1228 'tab_description' => Helper::tab_info_desc('functional', 'Functional cookies assist in performing tasks like sharing website content on social media, collecting feedback, and enabling other third-party features.'),
1229 ],
1230 ],
1231 ],
1232 'functional_cookie_lists' => [
1233 'label' => __('', 'notificationx'),
1234 'name' => 'functional_cookie_lists',
1235 'type' => 'better-repeater',
1236 'priority' => 10,
1237 'placeholder_img'=> NOTIFICATIONX_ADMIN_URL . 'images/extensions/empty-cookie.png',
1238 'button' => [
1239 'label' => __('Add New', 'notificationx'),
1240 'position' => 'top',
1241 ],
1242 'visible_fields' => Helper::gdpr_cookie_list_visible_fields(),
1243 '_fields' => Helper::gdpr_common_fields(),
1244 ]
1245 ],
1246 ],
1247 'analytics_tab' => [
1248 'label' => __("Analytics", 'notificationx'),
1249 'type' => 'section',
1250 'name' => 'analytics_tab',
1251 'id' => 'analytics_tab',
1252 'icon' => [
1253 'type' => 'tabs',
1254 'name' => 'analytics'
1255 ],
1256 'fields' => [
1257 'analytics_tab_info_modal' => [
1258 'name' => 'analytics_tab_info_modal',
1259 'type' => 'modal',
1260 'show_body' => true,
1261 'close_on_body' => true,
1262 'button' => [
1263 'name' => 'tab_info_edit',
1264 'text' => __(' ', 'notificationx'),
1265 'icon' => [
1266 'type' => 'tabs',
1267 'name' => 'edit_modal'
1268 ],
1269 ],
1270 'confirm_button' => [
1271 'type' => 'button',
1272 'text' => 'Save',
1273 'name' => 'analytics_close_tab_info_modal',
1274 "default" => false,
1275 'close_action' => true,
1276 ],
1277 'cancel' => "analytics_close_tab_info_modal",
1278 'body' => [
1279 'header' => __('Edit Category ', 'notificationx'),
1280 'fields' => [
1281 'tab_title' => Helper::tab_info_title('analytics', 'Analytics'),
1282 'tab_description' => Helper::tab_info_desc('analytics', 'Analytical cookies help us understand how visitors use the website. They provide data on metrics like the number of visitors, bounce rate, traffic sources etc.'),
1283 ],
1284 ],
1285 ],
1286 'analytics_cookie_lists' => [
1287 'label' => __('', 'notificationx'),
1288 'name' => 'analytics_cookie_lists',
1289 'type' => 'better-repeater',
1290 'priority' => 10,
1291 'placeholder_img'=> NOTIFICATIONX_ADMIN_URL . 'images/extensions/empty-cookie.png',
1292 'button' => [
1293 'label' => __('Add New', 'notificationx'),
1294 'position' => 'top',
1295 ],
1296 'visible_fields' => Helper::gdpr_cookie_list_visible_fields(),
1297 '_fields' => Helper::gdpr_common_fields(),
1298 ]
1299 ],
1300 ],
1301 'performance_tab' => [
1302 'label' => __("Performance", 'notificationx'),
1303 'type' => 'section',
1304 'name' => 'performance_tab',
1305 'id' => 'performance_tab',
1306 'icon' => [
1307 'type' => 'tabs',
1308 'name' => 'performance'
1309 ],
1310 'fields' => [
1311 'performance_tab_info_modal' => [
1312 'name' => 'performance_tab_info_modal',
1313 'type' => 'modal',
1314 'show_body' => true,
1315 'close_on_body' => true,
1316 'button' => [
1317 'name' => 'tab_info_edit',
1318 'text' => __(' ', 'notificationx'),
1319 'icon' => [
1320 'type' => 'tabs',
1321 'name' => 'edit_modal'
1322 ],
1323 ],
1324 'confirm_button' => [
1325 'type' => 'button',
1326 'text' => 'Save',
1327 'name' => 'performance_close_tab_info_modal',
1328 "default" => false,
1329 'close_action' => true,
1330 ],
1331 'cancel' => "performance_close_tab_info_modal",
1332 'body' => [
1333 'header' => __('Edit Category ', 'notificationx'),
1334 'fields' => [
1335 'tab_title' => Helper::tab_info_title('performance', 'Performance'),
1336 'tab_description' => Helper::tab_info_desc('performance', "Performance cookies help analyze the website's key performance indicators, which in turn helps improve the user experience for visitors."),
1337 ],
1338 ],
1339 ],
1340 'performance_cookie_lists' => [
1341 'label' => __('', 'notificationx'),
1342 'name' => 'performance_cookie_lists',
1343 'type' => 'better-repeater',
1344 'priority' => 10,
1345 'placeholder_img'=> NOTIFICATIONX_ADMIN_URL . 'images/extensions/empty-cookie.png',
1346 'button' => [
1347 'label' => __('Add New', 'notificationx'),
1348 'position' => 'top',
1349 ],
1350 'visible_fields' => Helper::gdpr_cookie_list_visible_fields(),
1351 '_fields' => Helper::gdpr_common_fields(),
1352 ]
1353 ],
1354 ],
1355 'advertisement_tab' => [
1356 'label' => __("Advertisement", 'notificationx'),
1357 'type' => 'section',
1358 'name' => 'advertisement_tab',
1359 'id' => 'advertisement_tab',
1360 'icon' => [
1361 'type' => 'tabs',
1362 'name' => 'performance'
1363 ],
1364 'fields' => [
1365 'advertising_tab_info_modal' => [
1366 'name' => 'advertising_tab_info_modal',
1367 'type' => 'modal',
1368 'show_body' => true,
1369 'close_on_body' => true,
1370 'button' => [
1371 'name' => 'tab_info_edit',
1372 'text' => __(' ', 'notificationx'),
1373 'icon' => [
1374 'type' => 'tabs',
1375 'name' => 'edit_modal'
1376 ],
1377 ],
1378 'confirm_button' => [
1379 'type' => 'button',
1380 'text' => 'Save',
1381 'name' => 'advertising_close_tab_info_modal',
1382 "default" => false,
1383 'close_action' => true,
1384 ],
1385 'cancel' => "advertising_close_tab_info_modal",
1386 'body' => [
1387 'header' => __('Edit Category ', 'notificationx'),
1388 'fields' => [
1389 'tab_title' => Helper::tab_info_title('advertising', 'Advertisement'),
1390 'tab_description' => Helper::tab_info_desc('advertising', "Advertisement cookies help analyze the website's key performance indicators, which in turn helps improve the user experience for visitors."),
1391 ],
1392 ],
1393 ],
1394 'advertising_cookie_lists' => [
1395 'label' => __('', 'notificationx'),
1396 'name' => 'advertising_cookie_lists',
1397 'type' => 'better-repeater',
1398 'priority' => 10,
1399 'placeholder_img'=> NOTIFICATIONX_ADMIN_URL . 'images/extensions/empty-cookie.png',
1400 'button' => [
1401 'label' => __('Add New', 'notificationx'),
1402 'position' => 'top',
1403 ],
1404 'visible_fields' => Helper::gdpr_cookie_list_visible_fields(),
1405 '_fields' => Helper::gdpr_common_fields(),
1406 ]
1407 ],
1408 ],
1409 'uncategorized_tab' => [
1410 'label' => __("Uncategorized", 'notificationx'),
1411 'type' => 'section',
1412 'name' => 'uncategorized_tab',
1413 'id' => 'uncategorized_tab',
1414 'icon' => [
1415 'type' => 'tabs',
1416 'name' => 'uncategorized'
1417 ],
1418 'fields' => [
1419 'uncategorized_tab_info_modal' => [
1420 'name' => 'uncategorized_tab_info_modal',
1421 'type' => 'modal',
1422 'show_body' => true,
1423 'close_on_body' => true,
1424 'button' => [
1425 'name' => 'tab_info_edit',
1426 'text' => __(' ', 'notificationx'),
1427 'icon' => [
1428 'type' => 'tabs',
1429 'name' => 'edit_modal'
1430 ],
1431 ],
1432 'confirm_button' => [
1433 'type' => 'button',
1434 'text' => 'Save',
1435 'name' => 'uncategorized_close_tab_info',
1436 "default" => false,
1437 'close_action' => true,
1438 ],
1439 'cancel' => "uncategorized_close_tab_info",
1440 'body' => [
1441 'header' => __('Edit Category ', 'notificationx'),
1442 'fields' => [
1443 'tab_title' => Helper::tab_info_title('uncategorized', 'Uncategorized'),
1444 'tab_description' => Helper::tab_info_desc('uncategorized', "Uncategorized cookies are those that don't fall into any specific category but may still be used for various purposes on the site. These cookies help us improve user experience by tracking interactions that don't fit into other cookie types."),
1445 ],
1446 ],
1447 ],
1448 'uncategorized_cookie_lists' => [
1449 'label' => __('', 'notificationx'),
1450 'name' => 'uncategorized_cookie_lists',
1451 'type' => 'better-repeater',
1452 'priority' => 10,
1453 'placeholder_img'=> NOTIFICATIONX_ADMIN_URL . 'images/extensions/empty-cookie.png',
1454 'button' => [
1455 'label' => __('Add New', 'notificationx'),
1456 'position' => 'top',
1457 ],
1458 'visible_fields' => Helper::gdpr_cookie_list_visible_fields(),
1459 '_fields' => Helper::gdpr_common_fields(),
1460 ]
1461 ],
1462 ],
1463 ]
1464 ],
1465 ]
1466 ]
1467 ]),
1468 ],
1469 "display_tab" => [
1470 'label' => __("Display", 'notificationx'),
1471 'id' => "display_tab",
1472 'name' => "display_tab",
1473 'rules' => Rules::is('type', 'gdpr', true),
1474 'icon' => [
1475 'type' => 'tabs',
1476 'name' => 'display'
1477 ],
1478 'classes' => "display_tab",
1479 'fields' => apply_filters('nx_display_fields', [
1480 "main_preview" => [
1481 'label' => __("Preview", 'notificationx'),
1482 'name' => "main_preview",
1483 'type' => "section",
1484 'priority' => 1,
1485 'fields' => [
1486 'preview_field' => [
1487 'name' => "preview_field",
1488 'type' => "preview",
1489 'label' => __('Preview', 'notificationx'),
1490 'priority' => 10,
1491 ],
1492 ],
1493 'rules' => Rules::logicalRule([
1494 Rules::is( 'type', 'notification_bar' ),
1495 ]),
1496 ],
1497 "image-section" => [
1498 'label' => __("IMAGE", 'notificationx'),
1499 'name' => "image-section",
1500 'type' => "section",
1501 // 'condition' => [
1502 // 'type' => '',
1503 // ],
1504 'fields' => [
1505 'show_default_image' => [
1506 'label' => __("Show Default Image", 'notificationx'),
1507 'name' => "show_default_image",
1508 'type' => "checkbox",
1509 'default' => false,
1510 ],
1511 'default_avatar' => [
1512 'label' =>__( "Choose an Image", 'notificationx'),
1513 'name' => "default_avatar",
1514 'type' => "radio-card",
1515 'default' => "verified.svg",
1516 'description' => __('If checked, this will show in notifications.', 'notificationx'),
1517 'rules' => Rules::is( 'show_default_image', true ),
1518 'style' => [
1519 'size' => 'medium'
1520 ],
1521 'options' => array(
1522 array(
1523 'value' => 'verified.svg',
1524 'label' => __('Verified', 'notificationx'),
1525 'icon' => NOTIFICATIONX_PUBLIC_URL . 'image/icons/verified.svg',
1526 ),
1527 array(
1528 'value' => 'flames.svg',
1529 'label' => __('Flames', 'notificationx'),
1530 'icon' => NOTIFICATIONX_PUBLIC_URL . 'image/icons/flames.svg',
1531 ),
1532 array(
1533 'value' => 'flames.gif',
1534 'label' => __('Flames GIF', 'notificationx'),
1535 'icon' => NOTIFICATIONX_PUBLIC_URL . 'image/icons/flames.gif',
1536 ),
1537 array(
1538 'value' => 'pink-face-looped.gif',
1539 'label' => __('Pink Face', 'notificationx'),
1540 'icon' => NOTIFICATIONX_PUBLIC_URL . 'image/icons/pink-face-looped.gif',
1541 ),
1542 array(
1543 'value' => 'blue-face-non-looped.gif',
1544 'label' => __('Blue Face', 'notificationx'),
1545 'icon' => NOTIFICATIONX_PUBLIC_URL . 'image/icons/blue-face-non-looped.gif',
1546 ),
1547 //TODO: none
1548 )
1549 ],
1550 [
1551 'label' => __("Upload an Image", 'notificationx'),
1552 'name' => "image_url",
1553 'button' => __('Upload', 'notificationx'),
1554 'type' => "media",
1555 'default' => "",
1556 'rules' => Rules::is( 'show_default_image', true ),
1557 ],
1558 'show_notification_image' => [
1559 'label' => __("Image", 'notificationx'),
1560 'name' => "show_notification_image",
1561 'type' => "select",
1562 'default' => "none",
1563 'rules' => Rules::includes( 'source', [
1564 "fluentform",
1565 "cf7",
1566 "custom_notification",
1567 "custom_notification_conversions",
1568 "edd",
1569 "envato",
1570 "grvf",
1571 "give",
1572 // "ifttt",
1573 "learndash",
1574 "njf",
1575 "tutor",
1576 "wpf",
1577 "reviewx",
1578 "woocommerce",
1579 "surecart",
1580 "woo_reviews",
1581 "wp_comments",
1582 "wp_reviews",
1583 "zapier",
1584 "mailchimp",
1585 "convertkit",
1586 "freemius_conversions",
1587 "freemius_reviews",
1588 "freemius_stats",
1589 "youtube",
1590 "woocommerce_sales",
1591 'woocommerce_sales_reviews',
1592 ] ),
1593 'options' => apply_filters('nx_show_image_options', array(
1594 'none' => [
1595 'value' => 'none',
1596 'label' => __('None', 'notificationx'),
1597 ],
1598 'featured_image' => [
1599 'value' => 'featured_image',
1600 'label' => __('Featured Image', 'notificationx'),
1601 'rules' => [
1602 'includes',
1603 'source',
1604 [
1605 "cf7",
1606 "custom_notification",
1607 "custom_notification_conversions",
1608 "edd",
1609 "envato",
1610 "grvf",
1611 "give",
1612 // "ifttt",
1613 "learndash",
1614 "njf",
1615 "tutor",
1616 "wpf",
1617 "reviewx",
1618 "woocommerce",
1619 "surecart",
1620 "woo_reviews",
1621 "wp_reviews",
1622 "freemius_conversions",
1623 "freemius_reviews",
1624 "freemius_stats",
1625 "woocommerce_sales",
1626 'woocommerce_sales_reviews',
1627 ]
1628 ],
1629 ],
1630 'gravatar' => [
1631 // @todo move the rules to a filter.
1632 'value' => 'gravatar',
1633 'label' => __('Gravatar', 'notificationx'),
1634 'rules' => [
1635 'includes',
1636 'source',[
1637 "fluentform",
1638 "cf7",
1639 "custom_notification",
1640 "custom_notification_conversions",
1641 "edd",
1642 "grvf",
1643 "give",
1644 // "ifttt",
1645 "learndash",
1646 "njf",
1647 "tutor",
1648 "wpf",
1649 "reviewx",
1650 "woocommerce",
1651 "surecart",
1652 "woo_reviews",
1653 "wp_comments",
1654 "wp_reviews",
1655 "zapier",
1656 "mailchimp",
1657 "convertkit",
1658 "freemius_conversions",
1659 "freemius_reviews",
1660 "freemius_stats",
1661 "woocommerce_sales",
1662 'woocommerce_sales_reviews',
1663 ],
1664 ],
1665 ],
1666 )),
1667 ],
1668 ],
1669 ],
1670 "visibility" => [
1671 'label' => __("Visibility", 'notificationx'),
1672 'name' => "visibility",
1673 'type' => "section",
1674 'fields' => [
1675 "show_on" => [
1676 'label' => __("Show On", 'notificationx'),
1677 'name' => "show_on",
1678 'type' => "select",
1679 'default' => "everywhere",
1680 'priority' => 5,
1681 'options' => apply_filters('nx_show_on_options', $this->normalize_fields([
1682 'everywhere' => __('Show Everywhere', 'notificationx'),
1683 'on_selected' => __('Show On Selected', 'notificationx'),
1684 'hide_on_selected' => __('Hide On Selected', 'notificationx'),
1685 ])),
1686 ],
1687 "all_locations" => [
1688 'label' => __("Locations", 'notificationx'),
1689 'name' => "all_locations",
1690 'type' => "select",
1691 'default' => "",
1692 'multiple' => true,
1693 'priority' => 10,
1694 'rules' => [ 'includes', 'show_on', [
1695 'on_selected',
1696 'hide_on_selected',
1697 ] ],
1698 'options' => $this->normalize_fields(Locations::get_instance()->get_locations()),
1699 ],
1700 "show_on_display" => [
1701 'label' => __("Display For", 'notificationx'),
1702 'name' => "show_on_display",
1703 'type' => "select",
1704 'default' => "always",
1705 'priority' => 15,
1706 'options' => $this->normalize_fields([
1707 'always' => __('Everyone', 'notificationx'),
1708 'logged_out_user' => __('Logged Out User', 'notificationx'),
1709 'logged_in_user' => __('Logged In User', 'notificationx'),
1710 ]),
1711 'help' => sprintf('<a target="_blank" rel="nofollow" href="https://notificationx.com/in/pro-display-control">%s</a>', __('More Control in Pro', 'notificationx')),
1712 ],
1713 ],
1714 ],
1715 ]),
1716 ],
1717 "customize_tab" => [
1718 'label' => __("Customize", 'notificationx'),
1719 'id' => "customize_tab",
1720 'name' => "customize_tab",
1721 'icon' => [
1722 'type' => 'tabs',
1723 'name' => 'customize'
1724 ],
1725 'classes' => "customize_tab",
1726 'fields' => apply_filters('nx_customize_fields', [
1727 "main_preview" => [
1728 'label' => __("Preview", 'notificationx'),
1729 'name' => "main_preview",
1730 'type' => "section",
1731 'priority' => 1,
1732 'fields' => [
1733 'preview_field' => [
1734 'name' => "preview_field",
1735 'type' => "preview",
1736 'label' => __('Preview', 'notificationx'),
1737 'priority' => 10,
1738 ],
1739 ],
1740 'rules' => Rules::logicalRule([
1741 Rules::is( 'type', 'notification_bar' ),
1742 ]),
1743 ],
1744 'appearance' => [
1745 'label' => __("Appearance", 'notificationx'),
1746 'name' => "appearance",
1747 'type' => "section",
1748 'fields' => [
1749 'position' => [
1750 'label' => __("Position", 'notificationx'),
1751 'name' => "position", // combined "pressbar_position" && "conversion_position"
1752 'type' => "select",
1753 'default' => 'bottom_left',
1754 'priority' => 50,
1755 'options' => [
1756 'bottom_left' => [
1757 'label' => __('Bottom Left', 'notificationx'),
1758 'value' => 'bottom_left',
1759 ],
1760 'bottom_right' => [
1761 'label' => __('Bottom Right', 'notificationx'),
1762 'value' => 'bottom_right',
1763 ],
1764 ],
1765 ],
1766 'close_icon_position' => [
1767 'label' => __("Close Icon Position", 'notificationx'),
1768 'name' => "close_icon_position",
1769 'type' => "select",
1770 'default' => 'top_right',
1771 'priority' => 51,
1772 'options' => [
1773 'top_right' => [
1774 'label' => __('Top Right', 'notificationx'),
1775 'value' => 'top_right',
1776 ],
1777 'top_left' => [
1778 'label' => __('Top Left', 'notificationx'),
1779 'value' => 'top_left',
1780 ]
1781 ],
1782 'rules' => Rules::includes('source', ['press_bar']),
1783 ],
1784 'size' => [
1785 'label' => __("Notification Size", 'notificationx'),
1786 'name' => "size",
1787 'type' => "responsive-number",
1788 'default' => [
1789 "desktop" => 500,
1790 "tablet" => 500,
1791 "mobile" => 500,
1792 ],
1793 'priority' => 51,
1794 'min' => 300,
1795 'controls' => [
1796 "desktop" => [
1797 "icon" => NOTIFICATIONX_ADMIN_URL . 'images/responsive/desktop.svg',
1798 'size' => 18,
1799 ],
1800 "tablet" => [
1801 "icon" => NOTIFICATIONX_ADMIN_URL . 'images/responsive/tablet.svg',
1802 'size' => 14,
1803 ],
1804 "mobile" => [
1805 "icon" => NOTIFICATIONX_ADMIN_URL . 'images/responsive/mobile.svg',
1806 'size' => 12,
1807 ],
1808 ],
1809 'help' => __('Set a max width for notification.', 'notificationx'),
1810 ],
1811 'close_button' => [
1812 'label' => __("Display Close Option", 'notificationx'),
1813 'name' => "close_button",
1814 'type' => "checkbox",
1815 'default' => 1,
1816 'priority' => 70,
1817 'description' => __('Display a close button.', 'notificationx'),
1818 ],
1819 'hide_on_mobile' => [
1820 'label' => __("Mobile Visibility", 'notificationx'),
1821 'name' => "hide_on_mobile",
1822 'type' => "checkbox",
1823 'default' => false,
1824 'priority' => 200,
1825 'description' => __('Hide NotificationX on mobile.', 'notificationx'),
1826 ],
1827 ]
1828 ],
1829 'appearance' => [
1830 'label' => __("Appearance", 'notificationx'),
1831 'name' => "appearance",
1832 'type' => "section",
1833 'fields' => [
1834 'position' => [
1835 'label' => __("Position", 'notificationx'),
1836 'name' => "position", // combined "pressbar_position" && "conversion_position"
1837 'type' => "select",
1838 'default' => 'bottom_left',
1839 'priority' => 50,
1840 'options' => [
1841 'bottom_left' => [
1842 'label' => __('Bottom Left', 'notificationx'),
1843 'value' => 'bottom_left',
1844 ],
1845 'bottom_right' => [
1846 'label' => __('Bottom Right', 'notificationx'),
1847 'value' => 'bottom_right',
1848 ],
1849 ],
1850 ],
1851 'size' => [
1852 'label' => __("Notification Size", 'notificationx'),
1853 'name' => "size",
1854 'type' => "responsive-number",
1855 'default' => [
1856 "desktop" => 500,
1857 "tablet" => 500,
1858 "mobile" => 500,
1859 ],
1860 'priority' => 51,
1861 'min' => 300,
1862 'controls' => [
1863 "desktop" => [
1864 "icon" => NOTIFICATIONX_ADMIN_URL . 'images/responsive/desktop.svg',
1865 'size' => 18,
1866 ],
1867 "tablet" => [
1868 "icon" => NOTIFICATIONX_ADMIN_URL . 'images/responsive/tablet.svg',
1869 'size' => 14,
1870 ],
1871 "mobile" => [
1872 "icon" => NOTIFICATIONX_ADMIN_URL . 'images/responsive/mobile.svg',
1873 'size' => 12,
1874 ],
1875 ],
1876 'help' => __('Set a max width for notification.', 'notificationx'),
1877 ],
1878 'close_button_control' => [
1879 'label' => __("Display Close Button", 'notificationx'),
1880 'name' => "close_button_control",
1881 'type' => "section",
1882 'fields' => [
1883 'close_button' => [
1884 'name' => "close_button",
1885 'type' => "checkbox",
1886 'default' => 1,
1887 'priority' => 70,
1888 'description' => __('Desktop', 'notificationx'),
1889 ],
1890 'close_button_tab' => [
1891 'name' => "close_button_tab",
1892 'type' => "checkbox",
1893 'default' => 1,
1894 'priority' => 71,
1895 'description' => __('Tablet', 'notificationx'),
1896 ],
1897 'close_button_mobile' => [
1898 'name' => "close_button_mobile",
1899 'type' => "checkbox",
1900 'default' => 1,
1901 'priority' => 72,
1902 'description' => __('Mobile', 'notificationx'),
1903 ],
1904 ]
1905 ],
1906 'nx_visibility_control' => [
1907 'label' => __("Notification Visibility", 'notificationx'),
1908 'name' => "close_button_control",
1909 'type' => "section",
1910 'fields' => [
1911 'hide_on_desktop' => [
1912 'name' => "hide_on_desktop",
1913 'type' => "checkbox",
1914 'default' => true,
1915 'priority' => 201,
1916 'description' => __('Desktop', 'notificationx'),
1917 ],
1918 'hide_on_tab' => [
1919 'name' => "hide_on_tab",
1920 'type' => "checkbox",
1921 'default' => true,
1922 'priority' => 202,
1923 'description' => __('Tablet', 'notificationx'),
1924 ],
1925 'hide_on_mobile' => [
1926 'name' => "hide_on_mobile",
1927 'type' => "checkbox",
1928 'default' => true,
1929 'priority' => 205,
1930 'description' => __('Mobile', 'notificationx'),
1931 ],
1932 ]
1933 ],
1934 'notification_reappearance' => array(
1935 'label' => __( 'Notification Reappearance', 'notificationx' ),
1936 'type' => 'select',
1937 'name' => 'notification_reappearance',
1938 'default' => 'show_notification_next_visit',
1939 'rules' => Rules::logicalRule([
1940 Rules::is('source', 'press_bar', true),
1941 ]),
1942 'options' => GlobalFields::get_instance()->normalize_fields([
1943 'dont_show_notification' => __( "Don't show the Notification again for the user", 'notificationx' ),
1944 'show_notification_next_visit' => __( 'Show the Notification again when the user visits the website next time', 'notificationx' ),
1945 'show_notification_every_page' => __( 'Show the Notification when the user refreshes/goes to another page', 'notificationx' ),
1946 ]),
1947 ),
1948 'cache_duration_for_dont_show' => [
1949 'label' => __( 'Cache Duration for "Don\'t show again"', 'notificationx' ),
1950 'name' => 'cache_duration_for_dont_show',
1951 'type' => 'number',
1952 'default' => 10,
1953 'min' => 1,
1954 'max' => 365,
1955 'step' => 1,
1956 'description' => __('Days', 'notificationx'),
1957 'rules' => Rules::logicalRule([
1958 Rules::is('notification_reappearance', 'dont_show_notification'),
1959 ]),
1960 ],
1961 ]
1962 ],
1963 'animation' => [
1964 'label' => __("Animation", 'notificationx'),
1965 'name' => "animation",
1966 'type' => "section",
1967 'priority'=> 15,
1968 'fields' => [
1969 'animation_notification_show' => [
1970 'label' => __("Notification Show", 'notificationx'),
1971 'name' => "animation_notification_show",
1972 'type' => "select",
1973 'default' => 'default',
1974 'classes' => NotificationX::is_pro() ? '' : 'animation-pro-disabled',
1975 'priority' => 5,
1976 'info' => InfoTooltipManager::get_instance()->render('animation'),
1977 'options' => [
1978 'default' => [
1979 'label' => __('Default', 'notificationx'),
1980 'value' => 'default',
1981 'selected' => 'selected',
1982 ],
1983 'animate__fadeIn' => [
1984 'label' => __('Fade In', 'notificationx'),
1985 'value' => 'animate__fadeIn',
1986 'disabled' => NotificationX::is_pro() ? false : true,
1987 ],
1988 'animate__fadeInUp' => [
1989 'label' => __('Fade In Up', 'notificationx'),
1990 'value' => 'animate__fadeInUp',
1991 'disabled' => NotificationX::is_pro() ? false : true,
1992 ],
1993 'animate__fadeInDown' => [
1994 'label' => __('Fade In Down', 'notificationx'),
1995 'value' => 'animate__fadeInDown',
1996 'disabled' => NotificationX::is_pro() ? false : true,
1997 ],
1998 'animate__fadeInDownBig' => [
1999 'label' => __('Fade In Down Big', 'notificationx'),
2000 'value' => 'animate__fadeInDownBig',
2001 'disabled' => NotificationX::is_pro() ? false : true,
2002 ],
2003 'animate__fadeInLeft' => [
2004 'label' => __('Fade In Left', 'notificationx'),
2005 'value' => 'animate__fadeInLeft',
2006 'disabled' => NotificationX::is_pro() ? false : true,
2007 ],
2008 'animate__fadeInRight' => [
2009 'label' => __('Fade In Right', 'notificationx'),
2010 'value' => 'animate__fadeInRight',
2011 'disabled' => NotificationX::is_pro() ? false : true,
2012 ],
2013 'animate__lightSpeedInLeft' => [
2014 'label' => __('Light Speed In Left', 'notificationx'),
2015 'value' => 'animate__lightSpeedInLeft',
2016 'disabled' => NotificationX::is_pro() ? false : true,
2017 ],
2018 'animate__lightSpeedInRight' => [
2019 'label' => __('Light Speed In Right', 'notificationx'),
2020 'value' => 'animate__lightSpeedInRight',
2021 'disabled' => NotificationX::is_pro() ? false : true,
2022 ],
2023 'animate__zoomIn' => [
2024 'label' => __('Zoom In', 'notificationx'),
2025 'value' => 'animate__zoomIn',
2026 'disabled' => NotificationX::is_pro() ? false : true,
2027 ],
2028 'animate__slideInUp' => [
2029 'label' => __('Slide In Up', 'notificationx'),
2030 'value' => 'animate__slideInUp',
2031 'disabled' => NotificationX::is_pro() ? false : true,
2032 ],
2033 'animate__slideInLeft' => [
2034 'label' => __('Slide In Left', 'notificationx'),
2035 'value' => 'animate__slideInLeft',
2036 'disabled' => NotificationX::is_pro() ? false : true,
2037 ],
2038 'animate__slideInRight' => [
2039 'label' => __('Slide In Right', 'notificationx'),
2040 'value' => 'animate__slideInRight',
2041 'disabled' => NotificationX::is_pro() ? false : true,
2042 ],
2043 'animate__slideInDown' => [
2044 'label' => __('Slide In Down', 'notificationx'),
2045 'value' => 'animate__slideInDown',
2046 'disabled' => NotificationX::is_pro() ? false : true,
2047 ],
2048 ],
2049 ],
2050 'animation_notification_hide' => [
2051 'label' => __("Notification Hide", 'notificationx'),
2052 'name' => "animation_notification_hide",
2053 'type' => "select",
2054 'default' => 'default',
2055 'classes' => NotificationX::is_pro() ? '' : 'animation-pro-disabled',
2056 'priority' => 10,
2057 'info' => InfoTooltipManager::get_instance()->render('animation'),
2058 'options' => [
2059 'default' => [
2060 'label' => __('Default', 'notificationx'),
2061 'value' => 'default',
2062 ],
2063 'animate__fadeOut' => [
2064 'label' => __('Fade Out', 'notificationx'),
2065 'value' => 'animate__fadeOut',
2066 'disabled' => NotificationX::is_pro() ? false : true,
2067 ],
2068 'animate__fadeOutDown' => [
2069 'label' => __('Fade Out Down', 'notificationx'),
2070 'value' => 'animate__fadeOutDown',
2071 'disabled' => NotificationX::is_pro() ? false : true,
2072 ],
2073 'animate__fadeOutRight' => [
2074 'label' => __('Fade Out Right', 'notificationx'),
2075 'value' => 'animate__fadeOutRight',
2076 'disabled' => NotificationX::is_pro() ? false : true,
2077 ],
2078 'animate__fadeOutUp' => [
2079 'label' => __('Fade Out Up', 'notificationx'),
2080 'value' => 'animate__fadeOutUp',
2081 'disabled' => NotificationX::is_pro() ? false : true,
2082 ],
2083 'animate__lightSpeedOutLeft' => [
2084 'label' => __('Light Speed Out Left', 'notificationx'),
2085 'value' => 'animate__lightSpeedOutLeft',
2086 'disabled' => NotificationX::is_pro() ? false : true,
2087 ],
2088 'animate__zoomOut' => [
2089 'label' => __('Zoom Out', 'notificationx'),
2090 'value' => 'animate__zoomOut',
2091 'disabled' => NotificationX::is_pro() ? false : true,
2092 ],
2093 'animate__slideOutDown' => [
2094 'label' => __('Slide Out Down', 'notificationx'),
2095 'value' => 'animate__slideOutDown',
2096 'disabled' => NotificationX::is_pro() ? false : true,
2097 ],
2098 'animate__slideOutLeft' => [
2099 'label' => __('Slide Out Left', 'notificationx'),
2100 'value' => 'animate__slideOutLeft',
2101 'disabled' => NotificationX::is_pro() ? false : true,
2102 ],
2103 'animate__slideOutRight' => [
2104 'label' => __('Slide Out Right', 'notificationx'),
2105 'value' => 'animate__slideOutRight',
2106 'disabled' => NotificationX::is_pro() ? false : true,
2107 ],
2108 'animate__slideOutUp' => [
2109 'label' => __('Slide Out Up', 'notificationx'),
2110 'value' => 'animate__slideOutUp',
2111 'disabled' => NotificationX::is_pro() ? false : true,
2112 ],
2113 ],
2114 ],
2115 // 'animation_notification_duration' => [
2116 // 'label' => __("Duration", 'notificationx'),
2117 // 'name' => "animation_notification_duration",
2118 // 'type' => "select",
2119 // 'default' => 'default',
2120 // 'priority' => 15,
2121 // 'options' => [
2122 // 'default' => [
2123 // 'label' => __('Default', 'notificationx'),
2124 // 'value' => 'default',
2125 // ],
2126 // 'animate__faster' => [
2127 // 'label' => __('Faster', 'notificationx'),
2128 // 'value' => 'animate__faster',
2129 // 'disabled' => NotificationX::is_pro() ? false : true,
2130 // ],
2131 // 'animate__fast' => [
2132 // 'label' => __('Fast', 'notificationx'),
2133 // 'value' => 'animate__fast',
2134 // 'disabled' => NotificationX::is_pro() ? false : true,
2135 // ],
2136 // ],
2137 // ],
2138 ]
2139 ],
2140 'queue_management' => [
2141 'label' => __("Queue Management", 'notificationx'),
2142 'name' => "queue_management",
2143 'type' => "section",
2144 'priority' => 150,
2145 // @todo is_pro
2146 'is_pro' => true,
2147 'fields' => [
2148 [
2149 'label' => __("Enable Global Queue", 'notificationx'),
2150 'name' => "global_queue",
2151 'type' => "checkbox",
2152 'priority' => 0,
2153 'default' => false,
2154 'is_pro' => true,
2155 'info' => InfoTooltipManager::get_instance()->render('global_queue_management'),
2156 'description' => sprintf('%s <a href="%s" target="_blank">%s</a>', __('Activate global queue system for this notification.', 'notificationx'), 'https://notificationx.com/docs/centralized-queue', __('Check out this doc.', 'notificationx')),
2157 ],
2158 ]
2159 ],
2160 'timing' => [
2161 'label' => __("Timing", 'notificationx'),
2162 'name' => "timing",
2163 'type' => "section",
2164 'priority' => 200,
2165 // 'rules' => Rules::is( 'global_queue', false ),
2166 'rules' => Rules::is( 'global_queue', true, true ),
2167 'fields' => [
2168 'delay_before' => [
2169 'label' => __("Delay Before First Notification", 'notificationx'),
2170 'name' => "delay_before",
2171 'type' => "number",
2172 'priority' => 40,
2173 'default' => defined('NX_DEBUG') && NX_DEBUG ? 1 : 5,
2174 'help' => __('Initial Delay', 'notificationx'),
2175 'description' => __('seconds', 'notificationx'),
2176
2177 ],
2178 'display_for' => [
2179 'name' => "display_for",
2180 'type' => "number",
2181 'label' => __("Display For", 'notificationx'),
2182 'description' => __('seconds', 'notificationx'),
2183 'help' => __('Display each notification for * seconds', 'notificationx'),
2184 'priority' => 60,
2185 'default' => defined('NX_DEBUG') && NX_DEBUG ? 2 : 5,
2186 ],
2187 'delay_between' => [
2188 'name' => "delay_between",
2189 'type' => "number",
2190 'label' => __("Delay Between", 'notificationx'),
2191 'description' => __('seconds', 'notificationx'),
2192 'help' => __('Delay between each notification', 'notificationx'),
2193 'priority' => 70,
2194 'default' => defined('NX_DEBUG') && NX_DEBUG ? 1 : 5,
2195 ],
2196 ]
2197 ],
2198 'behaviour' => [
2199 'label' => __("Behavior", 'notificationx'),
2200 'name' => "behaviour",
2201 'type' => "section",
2202 'priority' => 300,
2203 'collapsable' => true,
2204 'fields' => [
2205 "display_last" => [
2206 'name' => "display_last",
2207 'type' => 'number',
2208 'label' => __('Display The Last', 'notificationx'),
2209 'description' => 'conversions',
2210 'default' => 20,
2211 'priority' => 40,
2212 'max' => 20,
2213 ],
2214 'display_from' => [
2215 'name' => 'display_from',
2216 'type' => 'number',
2217 'label' => __('Display From The Last', 'notificationx'),
2218 'priority' => 45,
2219 'default' => 30,
2220 'description' => 'Days',
2221 'min' => 0,
2222 ],
2223 'hour_minutes_section' => [
2224 'name' => "hour_minutes_section",
2225 'type' => "section",
2226 'rules' => Rules::logicalRule([
2227 Rules::includes('source', ['woocommerce', 'woocommerce_sales', 'woocommerce_sales_reviews', 'custom_notification_conversions', 'surecart', 'edd', 'tutor', 'learndash', 'learnpress', 'cf7', 'wp_comments', 'njf', 'wpf', 'fluentform', 'elementor_form', 'custom_notification', 'grvf', 'mailchimp', 'convertkit', 'ActiveCampaign', 'zapier_email_subscription', 'give', 'woo_reviews', 'freemius_conversions', 'freemius_reviews', 'zapier_conversions', 'zapier_reviews']),
2228 ]),
2229 'fields' => [
2230 [
2231 'help' => __('Hours', 'notificationx'),
2232 'name' => "display_from_hour",
2233 'type' => "number",
2234 'default' => '0',
2235 'description' => '',
2236 'max' => 23,
2237 'min' => 0,
2238 ],
2239 [
2240 'help' => __('Minutes', 'notificationx'),
2241 'name' => "display_from_minute",
2242 'type' => "number",
2243 'default' => '0',
2244 'description' => '',
2245 'max' => 59,
2246 'min' => 0,
2247 ],
2248 ]
2249 ],
2250 'loop' => [
2251 'name' => 'loop',
2252 'type' => 'checkbox',
2253 'label' => __('Loop Notification', 'notificationx'),
2254 'priority' => 50,
2255 'default' => true,
2256 'rules' => Rules::is( 'global_queue', true, true ),
2257 ],
2258 'link_open' => [
2259 'name' => 'link_open',
2260 'type' => 'checkbox',
2261 'label' => __('Open Link In New Tab', 'notificationx'),
2262 'priority' => 60,
2263 'default' => false,
2264 ],
2265 ]
2266 ],
2267 ]),
2268 ],
2269 ],
2270 'instructions' => apply_filters( 'nx_instructions', [] ),
2271 'pro_popup' => apply_filters( 'nx_popup_alert', [] ),
2272 ];
2273
2274 $tabs['tabs'] = apply_filters('nx_metabox_tabs', $tabs['tabs']);
2275 $tabs = apply_filters('nx_metabox_config', $tabs);
2276
2277 if(defined('NX_DEBUG') && NX_DEBUG){
2278 do_action( 'qm/stop', __METHOD__ );
2279 }
2280 return $tabs;
2281 }
2282
2283
2284 public function normalize_fields($fields, $key = '', $value = [], $return = []) {
2285 foreach ($fields as $val => $label) {
2286 $val = !empty( $label['value'] ) ? $label['value'] : $val;
2287 if (empty($return[$val]) && !is_array($label)) {
2288 $return[$val] = [
2289 'value' => $val,
2290 'label' => $label,
2291 ];
2292 }
2293 elseif (empty($return[$val])){
2294 $return[$val] = $label;
2295 }
2296 if(!empty($key)){
2297 $return[$val] = Rules::includes($key, $value, false, $return[$val]);
2298 }
2299 }
2300
2301 return $return;
2302 }
2303
2304 public function common_name_fields($display_name = false) {
2305 $fields = [
2306 'tag_name' => __('Full Name', 'notificationx'),
2307 'tag_first_name' => __('First Name', 'notificationx'),
2308 'tag_last_name' => __('Last Name', 'notificationx'),
2309 ];
2310 if ($display_name)
2311 $fields['tag_display_name'] = __('Display Name', 'notificationx');
2312 return $fields;
2313 }
2314
2315 public function common_time_fields() {
2316 return [
2317 'tag_time' => __('Definite Time', 'notificationx'),
2318 'tag_custom' => __('Some time ago', 'notificationx'),
2319 ];
2320 }
2321
2322 }
2323