PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.2.10
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.2.10
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 / Core / QuickBuild.php

QuickBuild.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 3.2.10, at includes/Core/QuickBuild.php

285 lines 9.9 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\Core;
10
11 use NotificationX\Admin\Admin;
12 use NotificationX\Core\Rules;
13 use NotificationX\Core\Database;
14 use NotificationX\Core\Locations;
15 use NotificationX\GetInstance;
16 use NotificationX\Core\Modules;
17 use NotificationX\Extensions\GlobalFields;
18 use NotificationX\NotificationX;
19 use NotificationX\Types\TypeFactory;
20
21 /**
22 * @method static QuickBuild get_instance($args = null)
23 */
24 class QuickBuild {
25 /**
26 * Instance of QuickBuild
27 *
28 * @var QuickBuild
29 */
30 use GetInstance;
31
32 /**
33 * Initially Invoked when initialized.
34 */
35 public function __construct() {
36 add_action('admin_menu', [$this, 'menu'], 27);
37
38 }
39
40 /**
41 * This method is responsible for Admin Menu of
42 * NotificationX
43 *
44 * @return void
45 */
46 public function menu() {
47 add_submenu_page('nx-admin', __('Quick Builder', 'notificationx'), __('Quick Builder', 'notificationx'), 'edit_notificationx', 'nx-builder', [Admin::get_instance(), 'views'], 5);
48 }
49
50 public function tabs($configs = []) {
51 if(empty($configs)){
52 $configs = GlobalFields::get_instance()->tabs();
53 }
54
55 $tabs = [
56 'source_tab' => $configs['tabs']['source_tab'],
57 'design_tab' => $configs['tabs']['design_tab'],
58 'content_tab' => [],
59 'manager_tab' => $configs['tabs']['manager_tab'],
60 'display_tab' => $configs['tabs']['display_tab'],
61 'finalize' => [
62 'label' => "Finalize",
63 'id' => "finalize",
64 'icon' => [
65 'type' => 'tabs',
66 'name' => 'source'
67 ],
68 'classes' => "finalize",
69 'fields' => [
70 'finalize_message' => [
71 'type' => 'action',
72 'action' => 'nx_quick_build_finalize',
73 ],
74 ],
75
76 ],
77 ];
78
79 if(!empty($configs['tabs']['content_tab']['fields']['content']['fields']['custom_contents'])){
80 $tabs['content_tab'] = [
81 'label' => "Content",
82 'id' => "content_tab",
83 'name' => "content_tab",
84 'icon' => [
85 'type' => 'tabs',
86 'name' => 'content'
87 ],
88 'classes' => "content_tab",
89 'rules' => Rules::includes('source', ['custom_notification', 'custom_notification_conversions']),
90 'fields' => [
91 'content' => [
92 'label' => __("Content", 'notificationx'),
93 'name' => "content",
94 'type' => "section",
95 'priority' => 90,
96 'fields' => [
97 'custom_contents' => $configs['tabs']['content_tab']['fields']['content']['fields']['custom_contents'],
98 ],
99 ],
100 ]
101 ];
102
103 unset($configs['tabs']['content_tab']['fields']['content']['fields']['custom_contents']);
104 }
105 else{
106 unset($tabs['content_tab']);
107 }
108
109 $tabs['source_tab']['fields'] = array_merge($tabs['source_tab']['fields'], $configs['tabs']['content_tab']['fields']);
110 $tabs['display_tab']['fields'] = array_merge($tabs['display_tab']['fields'], $configs['tabs']['customize_tab']['fields']);
111
112 return apply_filters('nx_quick_builder_tabs', [
113 'id' => 'notificationx_metabox_quick_builder_wrapper',
114 'redirect' => !current_user_can( 'edit_notificationx' ),
115 'title' => __('NotificationX', 'notificationx'),
116 'is_pro_active' => NotificationX::get_instance()->is_pro(),
117 'config' => [
118 'active' => "source_tab",
119 'completionTrack' => true,
120 'sidebar' => false,
121 'step' => [
122 'show' => true,
123 'buttons' => [
124 'prev' => 'Previous',
125 'next' => 'Next',
126 'quick-builder-publish' => [
127 'name' => 'quick-builder-publish',
128 'type' => 'action',
129 'action' => 'nx_quick_build_launch',
130 ],
131 ]
132 ],
133 ],
134 'submit' => [
135 'show' => false,
136 ],
137 'tabs' => $tabs,
138 'quickBuilder' => true,
139 'show' => [
140 'source_error',
141 'finalize_message',
142 'youtube_channel_id',
143 'youtube_video_id',
144 'type_section',
145 'themes_section',
146 'for_desktop',
147 'for_mobile',
148 'is_mobile_responsive',
149 'responsive_themes',
150 'desktop_themes',
151 'type',
152 'source_section',
153 'source',
154 'themes',
155 'gdpr_theme',
156 'gdpr_position',
157 'gdpr_title',
158 'gdpr_message',
159 'cookies_list_section',
160 'content',
161 'combine_multiorder',
162 'freemius_item_type',
163 'freemius_themes',
164 'freemius_plugins',
165 'wp_reviews_product_type',
166 'wp_reviews_slug',
167 'wp_stats_product_type',
168 'wp_stats_slug',
169 'press_content',
170 'form_list',
171 'mailchimp_list',
172 'convertkit_form',
173 'custom_contents',
174 'title',
175 'post_title',
176 'post_comment',
177 'username',
178 'name',
179 'first_name',
180 'last_name',
181 'email',
182 'city',
183 'country',
184 'sales_count',
185 'donation_count',
186 'image',
187 'link',
188 'rated',
189 'plugin_name',
190 'plugin_review',
191 'rating',
192 'today',
193 'last_week',
194 'all_time',
195 'active_installs',
196 'timestamp',
197 'appearance',
198 'position',
199 'visibility',
200 'show_on',
201 'all_locations',
202 'show_on_display',
203
204 'google_reviews_place_data',
205 'google_reviews_custom_place_id',
206
207 'ft_theme_one_icons',
208 'ft_theme_one_message',
209 'ft_theme_three_line_one',
210 'ft_theme_three_line_two',
211 'ft_theme_four_line_two',
212 'close_button',
213 'close_button_tab',
214 'close_button_mobile',
215 'hide_on_desktop',
216 'hide_on_tab',
217 'hide_on_mobile',
218 'notification-template',
219 'first_param',
220 'custom_first_param',
221 'second_param',
222 'third_param',
223 'custom_third_param',
224 'fourth_param',
225 'custom_fourth_param',
226 'fifth_param',
227 'custom_fifth_param',
228 'sixth_param',
229 'custom_sixth_param',
230 'activecampaign_form',
231 'announcement_entries',
232 'offer_title',
233 'offer_discount',
234 'image',
235 'expire_time',
236 'offer_description',
237 'press_sliding_text',
238 'sliding_text',
239 'bar_content_type',
240 'sliding_content',
241 'countdown_timer',
242 'enable_countdown',
243 'evergreen_timer',
244 'countdown_text',
245 'countdown_expired_text',
246 'countdown_start_date',
247 'countdown_end_date',
248 'time_randomize',
249 'time_randomize_between',
250 'time_rotation',
251 'time_reset',
252 'nxbar_build_with_ai',
253 // Exit Intent Popup — Custom (Elementor) tab controls. The Quick
254 // Builder hides any field name not listed here, so without these the
255 // "Build With Elementor" button (and the rest of the Custom-tab flow)
256 // never render in the Quick Builder.
257 'exit_intent_custom_preview',
258 'build_with_elementor',
259 'nx-exit-intent_with_elementor',
260 'nx-exit-intent_with_elementor-remove',
261 'nx-exit-intent_with_elementor_install',
262 'elementor_edit_link',
263 'elementor_exit_theme',
264 'import_elementor_theme',
265 'import_elementor_theme_next',
266 ],
267 'types_title' => apply_filters( 'nx_source_types_title', array(
268 'notification_bar' => __('Notification Bar', 'notificationx'),
269 'comments' => __('Comments', 'notificationx'),
270 'conversions' => __('Sales Notification', 'notificationx'),
271 'video' => __('Video','notificationx'),
272 'reviews' => __('Reviews', 'notificationx'),
273 'download_stats' => __('Download Stats', 'notificationx'),
274 'elearning' => __('eLearning', 'notificationx'),
275 'donation' => __('Donation', 'notificationx'),
276 'form' => __('Contact Form', 'notificationx'),
277 'inline' => __('Growth Alert', 'notificationx'),
278 'gdpr' => __('Cookie Notice', 'notificationx'),
279 )),
280 ]);
281 }
282
283 }
284
285