PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 3.6.50
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v3.6.50
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Modules / Registerer / Menu.php

Menu.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 3.6.50, at app/Modules/Registerer/Menu.php

783 lines 25.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Modules\Registerer;
4
5 use FluentForm\App\Helpers\Helper;
6 use FluentForm\App\Modules\Activator;
7 use FluentForm\App\Modules\AddOnModule;
8 use FluentForm\App\Modules\DocumentationModule;
9 use FluentForm\Framework\Foundation\Application;
10 use FluentForm\View;
11
12 class Menu
13 {
14 /**
15 * @var \FluentForm\Framework\Foundation\Application
16 */
17 protected $app;
18
19 /**
20 * Menu constructor.
21 *
22 * @param \FluentForm\Framework\Foundation\Application $application
23 */
24 public function __construct(Application $application)
25 {
26 $this->app = $application;
27
28 $this->app->addFilter('fluentform_form_settings_menu', array(
29 $this, 'filterFormSettingsMenu'
30 ), 10, 2);
31 }
32
33 public function reisterScripts()
34 {
35 if (!$this->isFluentPages()) {
36 return;
37 }
38
39 $app = $this->app;
40
41 wp_register_style(
42 'fluentform_settings_global',
43 $app->publicUrl("css/settings_global.css"),
44 array(),
45 FLUENTFORM_VERSION,
46 'all'
47 );
48
49 wp_register_script(
50 'clipboard',
51 $app->publicUrl('libs/clipboard.min.js'),
52 array(),
53 false,
54 true
55 );
56
57 wp_register_script(
58 'copier',
59 $app->publicUrl('js/copier.js'),
60 array(),
61 false,
62 true
63 );
64
65 wp_register_script(
66 'fluentform_form_settings',
67 $app->publicUrl("js/form_settings_app.js"),
68 array('jquery'),
69 FLUENTFORM_VERSION,
70 true
71 );
72
73 wp_register_script(
74 'fluent_all_forms',
75 $app->publicUrl("js/fluent-all-forms-admin.js"),
76 array('jquery'),
77 FLUENTFORM_VERSION,
78 true
79 );
80
81 wp_register_style(
82 'fluent_all_forms',
83 $app->publicUrl("css/fluent-all-forms.css"),
84 array(),
85 FLUENTFORM_VERSION,
86 'all'
87 );
88
89 wp_register_script(
90 'fluentform_editor_script',
91 $app->publicUrl("js/fluent-forms-editor.js"),
92 array('jquery'),
93 FLUENTFORM_VERSION,
94 true
95 );
96
97 wp_register_style(
98 'fluentform_editor_style',
99 $app->publicUrl("css/fluent-forms-admin-sass.css"),
100 [],
101 FLUENTFORM_VERSION,
102 'all'
103 );
104
105 wp_register_style(
106 'fluentform_editor_sass',
107 $app->publicUrl("css/fluent-forms-admin.css"),
108 [],
109 FLUENTFORM_VERSION,
110 'all'
111 );
112
113 wp_register_script(
114 'fluentform-transfer-js',
115 $app->publicUrl("js/fluentform-transfer.js"),
116 ['jquery'],
117 FLUENTFORM_VERSION,
118 true
119 );
120
121 wp_register_script(
122 'fluentform-global-settings-js',
123 $app->publicUrl("js/fluentform-global-settings.js"),
124 ['jquery'],
125 FLUENTFORM_VERSION,
126 true
127 );
128
129 wp_register_script(
130 'fluentform-modules',
131 $app->publicUrl('js/modules.js'),
132 ['jquery'],
133 FLUENTFORM_VERSION,
134 true
135 );
136
137 wp_register_script(
138 'fluentform_form_entries',
139 $app->publicUrl('js/form_entries.js'),
140 array('jquery'),
141 FLUENTFORM_VERSION,
142 true
143 );
144
145 wp_register_script(
146 'fluentform_all_entries',
147 $app->publicUrl('js/all_entries.js'),
148 array('jquery'),
149 FLUENTFORM_VERSION,
150 true
151 );
152
153 wp_register_style(
154 'fluentform-add-ons',
155 $app->publicUrl('css/add-ons.css'),
156 [],
157 FLUENTFORM_VERSION,
158 'all'
159 );
160
161 wp_register_style(
162 'fluentform_doc_style',
163 $app->publicUrl('css/admin_docs.css'),
164 [],
165 FLUENTFORM_VERSION,
166 'all'
167 );
168
169 }
170
171 public function isFluentPages()
172 {
173 return Helper::isFluentAdminPage();
174 }
175
176 public function enqueuePageScripts()
177 {
178 if (!$this->isFluentPages()) {
179 return;
180 }
181
182 $page = sanitize_text_field($_GET['page']);
183
184 if ($page == 'fluent_forms' && isset($_GET['route']) && isset($_GET['form_id'])) {
185 wp_enqueue_style('fluentform_settings_global');
186 wp_enqueue_script('clipboard');
187 wp_enqueue_script('copier');
188
189 if ($_GET['route'] == 'settings') {
190 if (function_exists('wp_enqueue_editor')) {
191 add_filter('user_can_richedit', function ($status) {
192 return true;
193 });
194
195 wp_enqueue_editor();
196 wp_enqueue_media();
197 }
198
199 wp_enqueue_script('fluentform_form_settings');
200
201 } else if ($_GET['route'] == 'editor') {
202 $this->enqueueEditorAssets();
203 }
204 } else if ($page == 'fluent_forms') {
205 wp_enqueue_script('fluent_all_forms');
206 wp_enqueue_style('fluent_all_forms');
207 } else if ($page == 'fluent_forms_transfer') {
208 wp_enqueue_style('fluentform_settings_global');
209 wp_enqueue_script('fluentform-transfer-js');
210 } else if (
211 $page == 'fluent_forms_settings' ||
212 $page == 'fluent_form_payment_entries' ||
213 $page == 'fluent_forms_all_entries'
214 ) {
215 wp_enqueue_style('fluentform_settings_global');
216 } else if ($page == 'fluent_form_add_ons') {
217 wp_enqueue_style('fluentform-add-ons');
218 } else if ($page == 'fluent_forms_docs') {
219 wp_enqueue_style('fluentform_doc_style');
220 }
221 }
222
223 /**
224 * Register menu and sub-menus.
225 */
226 public function register()
227 {
228 $dashBoardCapability = apply_filters(
229 'fluentform_dashboard_capability', 'fluentform_settings_manager'
230 );
231
232 $settingsCapability = apply_filters(
233 'fluentform_settings_capability', 'fluentform_settings_manager'
234 );
235
236 if (!current_user_can($dashBoardCapability) && !current_user_can($settingsCapability)) {
237 $customRoles = get_option('_fluentform_form_permission');
238
239 if (is_string($customRoles)) {
240 $customRoles = [];
241 }
242
243 if (!$customRoles) {
244 return;
245 }
246
247 $hasAccess = false;
248 foreach ($customRoles as $roleName) {
249 if (current_user_can($roleName)) {
250 $hasAccess = true;
251 $dashBoardCapability = $roleName;
252 $settingsCapability = $roleName;
253 }
254 }
255
256 if (!$hasAccess) {
257 return;
258 }
259 }
260
261 if (defined('FLUENTFORMPRO')) {
262 $title = __('Fluent Forms Pro', 'fluentform');
263 } else {
264 $title = __('Fluent Forms', 'fluentform');
265 }
266
267 add_menu_page(
268 $title,
269 $title,
270 $dashBoardCapability,
271 'fluent_forms',
272 array($this, 'renderFormAdminRoute'),
273 $this->getMenuIcon(),
274 25
275 );
276
277
278 add_submenu_page(
279 'fluent_forms',
280 __('All Forms', 'fluentform'),
281 __('All Forms', 'fluentform'),
282 $dashBoardCapability,
283 'fluent_forms',
284 array($this, 'renderFormAdminRoute')
285 );
286
287 if ($settingsCapability) {
288 add_submenu_page(
289 'fluent_forms',
290 __('New Form', 'fluentform'),
291 __('New Form', 'fluentform'),
292 $settingsCapability,
293 'fluent_forms#add=1',
294 array($this, 'renderFormAdminRoute')
295 );
296
297 $entriesTitle = __('Entries', 'fluentform');
298
299 if(Helper::isFluentAdminPage()) {
300 $entriesCount = wpFluent()->table('fluentform_submissions')
301 ->where('status', 'unread')
302 ->count();
303 if($entriesCount) {
304 $entriesTitle .= ' <span class="ff_unread_count" style="background: #ca4a20;color: white;border-radius: 8px;padding: 1px 8px;">'.$entriesCount.'</span>';
305 }
306 }
307
308 // Register entries intermediary page
309 add_submenu_page(
310 'fluent_forms',
311 $entriesTitle,
312 $entriesTitle,
313 $settingsCapability,
314 'fluent_forms_all_entries',
315 array($this, 'renderAllEntriesAdminRoute')
316 );
317
318 if (apply_filters('fluentform_show_payment_entries', false)) {
319 add_submenu_page(
320 'fluent_forms',
321 __('Payments', 'fluentform'),
322 __('Payments', 'fluentform'),
323 $settingsCapability,
324 'fluent_form_payment_entries',
325 array($this, 'renderPaymentEntries')
326 );
327 }
328
329 }
330
331
332 // Register Add-Ons
333 add_submenu_page(
334 'fluent_forms',
335 __('Integration Modules', 'fluentform'),
336 __('Integration Modules', 'fluentform'),
337 $dashBoardCapability,
338 'fluent_form_add_ons',
339 array($this, 'renderAddOns')
340 );
341
342 if ($settingsCapability) {
343 // Register global settings sub menu page.
344 add_submenu_page(
345 'fluent_forms',
346 __('Global Settings', 'fluentform'),
347 __('Global Settings', 'fluentform'),
348 $settingsCapability,
349 'fluent_forms_settings',
350 array($this, 'renderGlobalSettings')
351 );
352
353 // Register import/export sub menu page.
354 add_submenu_page(
355 'fluent_forms',
356 __('Tools', 'fluentform'),
357 __('Tools', 'fluentform'),
358 $settingsCapability,
359 'fluent_forms_transfer',
360 array($this, 'renderTransfer')
361 );
362 }
363
364
365 // Register Documentation
366 add_submenu_page(
367 'fluent_forms',
368 __('Get Help', 'fluentform'),
369 __('Get Help', 'fluentform'),
370 $dashBoardCapability,
371 'fluent_forms_docs',
372 array($this, 'renderDocs')
373 );
374
375 $this->commonAction();
376
377 }
378
379 private function getMenuIcon()
380 {
381 return 'data:image/svg+xml;base64,' . base64_encode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><defs><style>.cls-1{fill:#fff;}</style></defs><title>dashboard_icon</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-1" d="M15.57,0H4.43A4.43,4.43,0,0,0,0,4.43V15.57A4.43,4.43,0,0,0,4.43,20H15.57A4.43,4.43,0,0,0,20,15.57V4.43A4.43,4.43,0,0,0,15.57,0ZM12.82,14a2.36,2.36,0,0,1-1.66.68H6.5A2.31,2.31,0,0,1,7.18,13a2.36,2.36,0,0,1,1.66-.68l4.66,0A2.34,2.34,0,0,1,12.82,14Zm3.3-3.46a2.36,2.36,0,0,1-1.66.68H3.21a2.25,2.25,0,0,1,.68-1.64,2.36,2.36,0,0,1,1.66-.68H16.79A2.25,2.25,0,0,1,16.12,10.53Zm0-3.73a2.36,2.36,0,0,1-1.66.68H3.21a2.25,2.25,0,0,1,.68-1.64,2.36,2.36,0,0,1,1.66-.68H16.79A2.25,2.25,0,0,1,16.12,6.81Z"/></g></g></svg>');
382 }
383
384 public function renderFormAdminRoute()
385 {
386 if (isset($_GET['route']) && isset($_GET['form_id'])) {
387 return $this->renderFormInnerPages();
388 }
389
390 $this->renderForms();
391 }
392
393 public function renderAllEntriesAdminRoute()
394 {
395 wp_enqueue_script('fluentform_all_entries');
396 View::render('admin.all_entries', array());
397 }
398
399 private function renderFormInnerPages()
400 {
401 $form_id = intval($_GET['form_id']);
402
403 $form = wpFluent()->table('fluentform_forms')->find($form_id);
404
405 $formAdminMenus = array(
406 'editor' => array(
407 'slug' => 'editor',
408 'title' => __('Editor', 'fluentform'),
409 'url' => admin_url('admin.php?page=fluent_forms&form_id=' . $form_id . '&route=editor')
410 ),
411 'settings' => array(
412 'slug' => 'settings',
413 'hash' => 'basic_settings',
414 'title' => __('Settings & Integrations', 'fluentform'),
415 'sub_route' => 'form_settings',
416 'url' => admin_url('admin.php?page=fluent_forms&form_id=' . $form_id . '&route=settings&sub_route=form_settings')
417 ),
418 'entries' => array(
419 'slug' => 'entries',
420 'hash' => '/',
421 'title' => __('Entries', 'fluentform'),
422 'url' => admin_url('admin.php?page=fluent_forms&form_id=' . $form_id . '&route=entries')
423 )
424 );
425
426 $formAdminMenus = apply_filters('fluentform_form_admin_menu', $formAdminMenus, $form_id, $form);
427
428 $form = wpFluent()->table('fluentform_forms')->find($form_id);
429
430 if (!$form) {
431 echo __("<h2>No form found</h2>", 'fluentform');
432 return;
433 }
434
435 View::render('admin.form.form_wrapper', array(
436 'route' => sanitize_text_field($_GET['route']),
437 'form_id' => $form_id,
438 'form' => $form,
439 'menu_items' => $formAdminMenus
440 ));
441 }
442
443 public function renderSettings($form_id)
444 {
445 $settingsMenus = array(
446 'form_settings' => array(
447 'title' => __('Form Settings', 'fluentform'),
448 'slug' => 'form_settings',
449 'hash' => 'basic_settings',
450 'route' => '/'
451 ),
452 'email_notifications' => array(
453 'title' => __('Email Notifications', 'fluentform'),
454 'slug' => 'form_settings',
455 'hash' => 'email_notifications',
456 'route' => '/email-settings'
457 ),
458 'other_confirmations' => array(
459 'title' => __('Other Confirmations', 'fluentform'),
460 'slug' => 'form_settings',
461 'hash' => 'other_confirmations',
462 'route' => '/other-confirmations'
463 ),
464 'all_integrations' => array(
465 'title' => __('Marketing & CRM Integrations', 'fluentform'),
466 'slug' => 'form_settings',
467 'route' => '/all-integrations'
468 )
469 );
470
471 if (Helper::isSlackEnabled()) {
472 $settingsMenus['slack'] = array(
473 'title' => __('Slack', 'fluentform'),
474 'slug' => 'form_settings',
475 'hash' => 'slack',
476 'route' => '/slack'
477 );
478 }
479
480 $settingsMenus = apply_filters('fluentform_form_settings_menu', $settingsMenus, $form_id);
481
482 $externalMenuItems = [];
483 foreach ($settingsMenus as $key => $menu) {
484 if (empty($menu['hash'])) {
485 unset($settingsMenus[$key]);
486 $externalMenuItems[$key] = $menu;
487 }
488 }
489
490 $settingsMenus['custom_css_js'] = array(
491 'title' => __('Custom CSS/JS', 'fluentform'),
492 'slug' => 'form_settings',
493 'hash' => 'custom_css_js',
494 'route' => '/custom-css-js'
495 );
496
497 $settingsMenus = array_filter(array_merge($settingsMenus, $externalMenuItems));
498
499 $currentRoute = sanitize_text_field($this->app->request->get('sub_route', ''));
500
501 View::render('admin.form.settings_wrapper', array(
502 'form_id' => $form_id,
503 'settings_menus' => $settingsMenus,
504 'current_sub_route' => $currentRoute
505 ));
506 }
507
508 /**
509 * Remove the inactive addOn menu items
510 * @param string $addOn
511 * @return boolean
512 */
513 public function filterFormSettingsMenu($settingsMenus, $form_id)
514 {
515 if (array_key_exists('mailchimp_integration', $settingsMenus)) {
516 $option = (array)get_option('_fluentform_mailchimp_details');
517 if (!isset($option['status']) || !$option['status']) {
518 unset($settingsMenus['mailchimp_integration']);
519 }
520 }
521
522 return $settingsMenus;
523 }
524
525 public function renderFormSettings($form_id)
526 {
527 wp_localize_script('fluentform_form_settings', 'FluentFormApp', array(
528 'form_id' => $form_id,
529 'plugin' => $this->app->getSlug(),
530 'hasPro' => defined('FLUENTFORMPRO'),
531 'hasPDF' => defined('FLUENTFORM_PDF_VERSION'),
532 'ace_path_url' => $this->app->publicUrl('libs/ace')
533 ));
534
535 View::render('admin.form.settings', array(
536 'form_id' => $form_id
537 ));
538 }
539
540 public function renderForms()
541 {
542 if (!get_option('_fluentform_installed_version')) {
543 (new Activator())->migrate();
544 }
545
546 $formsCount = wpFluent()->table('fluentform_forms')->count();
547
548 wp_localize_script('fluent_all_forms', 'FluentFormApp', apply_filters('fluent_all_forms_vars', array(
549 'plugin' => $this->app->getSlug(),
550 'formsCount' => $formsCount,
551 'hasPro' => defined('FLUENTFORMPRO'),
552 'adminUrl' => admin_url('admin.php?page=fluent_forms'),
553 'isDisableAnalytics' => apply_filters('fluentform-disabled_analytics', false)
554 )));
555
556 View::render('admin.all_forms', array());
557 }
558
559 public function renderEditor($form_id)
560 {
561 View::render('admin.form.editor', array(
562 'plugin' => $this->app->getSlug(),
563 'form_id' => $form_id
564 ));
565 }
566
567 public function renderDocs()
568 {
569 echo (new DocumentationModule())->render();
570 }
571
572 public function renderAddOns()
573 {
574 echo (new AddOnModule())->render();
575 }
576
577 private function enqueueEditorAssets()
578 {
579 $formId = intval($_GET['form_id']);
580
581 $form = wpFluent()->table('fluentform_forms')->find($formId);
582
583 do_action('fluentform_loading_editor_assets', $form);
584
585 wp_enqueue_style('fluentform_editor_sass');
586 wp_enqueue_style('fluentform_editor_style');
587
588 $pluginSlug = $this->app->getSlug();
589
590 if (function_exists('wp_enqueue_editor')) {
591 add_filter('user_can_richedit', '__return_true');
592 wp_enqueue_editor();
593 wp_enqueue_media();
594 }
595
596 wp_enqueue_script('fluentform_editor_script');
597
598 $jsonData = $form->form_fields;
599
600 if (!defined('FLUENTFORM_DISABLE_EDITOR_FILED_HOOOK')) {
601 $formFields = $form->form_fields;
602
603 if ($formFields) {
604 $formFields = json_decode($formFields, true);
605
606 foreach ($formFields['fields'] as $index => $formField) {
607 $formFields['fields'][$index] = apply_filters(
608 'fluentform_editor_init_element_' . $formField['element'], $formField, $form
609 );
610
611 if (!$formFields['fields'][$index]) {
612 unset($formFields['fields'][$index]);
613 continue;
614 }
615
616 if ($formField['element'] == 'container') {
617 $columns = $formField['columns'];
618 foreach ($columns as $columnIndex => $column) {
619 foreach ($column['fields'] as $fieldIndex => $columnField) {
620 $columns[$columnIndex]['fields'][$fieldIndex] = apply_filters(
621 'fluentform_editor_init_element_' . $columnField['element'],
622 $columnField, $form
623 );
624
625 if (!$columns[$columnIndex]['fields'][$fieldIndex]) {
626 unset($columns[$columnIndex]['fields'][$fieldIndex]);
627 }
628 }
629 }
630
631 $formFields['fields'][$index]['columns'] = array_values($columns);
632 }
633 }
634
635 $formFields['fields'] = array_values($formFields['fields']);
636 $formFields = json_encode($formFields, true);
637 }
638
639
640 $form->form_fields = $formFields;
641 }
642
643 $searchTags = $this->app->load(
644 $this->app->appPath('Services/FormBuilder/ElementSearchTags.php')
645 );
646
647 $searchTags = apply_filters( 'fluent_editor_element_search_tags', $searchTags, $form );
648
649 wp_localize_script('fluentform_editor_script', 'FluentFormApp', apply_filters('fluentform_editor_vars', array(
650 'plugin' => $pluginSlug,
651 'form_id' => $formId,
652 'plugin_public_url' => $this->app->publicUrl(),
653 'preview_url' => $this->getFormPreviewUrl($formId),
654 'form' => $form,
655 'hasPro' => defined('FLUENTFORMPRO'),
656 'countries' => $this->app->load(
657 $this->app->appPath('Services/FormBuilder/CountryNames.php')
658 ),
659 'element_customization_settings' => $this->app->load(
660 $this->app->appPath('Services/FormBuilder/ElementCustomization.php')
661 ),
662
663 'validation_rule_settings' => $this->app->load(
664 $this->app->appPath('Services/FormBuilder/ValidationRuleSettings.php')
665 ),
666
667 'element_search_tags' => $searchTags,
668
669 'element_settings_placement' => $this->app->load(
670 $this->app->appPath('Services/FormBuilder/ElementSettingsPlacement.php')
671 ),
672 'all_forms_url' => admin_url('admin.php?page=fluent_forms'),
673 'has_payment_features' => !defined('FLUENTFORMPRO')
674 )));
675 }
676
677 /**
678 * Render global settings page.
679 *
680 * @throws \Exception
681 */
682 public function renderGlobalSettings()
683 {
684 // Fire an event letting others know the current component
685 // that fluentform is rendering for the global settings
686 // page. So that they can hook and load their custom
687 // components on this page dynamically & easily.
688 // N.B. native 'components' will always use
689 // 'settings' as their current component.
690 $currentComponent = apply_filters('fluentform_global_settings_current_component',
691 $this->app->request->get('component', 'settings')
692 );
693
694 $components = apply_filters('fluentform_global_settings_components', []);
695
696 $components['reCAPTCHA'] = [
697 'hash' => 're_captcha',
698 'title' => 'reCAPTCHA',
699 ];
700
701 View::render('admin.settings.index', [
702 'components' => $components,
703 'currentComponent' => $currentComponent
704 ]);
705 }
706
707 public function renderTransfer()
708 {
709 $forms = wpFluent()->table('fluentform_forms')
710 ->orderBy('id', 'desc')
711 ->select(['id', 'title'])
712 ->get();
713
714 wp_localize_script('fluentform-transfer-js', 'FluentFormApp', [
715 'plugin' => $this->app->getSlug(),
716 'forms' => $forms,
717 'hasPro' => defined('FLUENTFORMPRO'),
718 ]);
719
720 View::render('admin.transfer.index');
721 }
722
723
724 private function getFormPreviewUrl($form_id)
725 {
726 return site_url('?fluentform_pages=1&design_mode=1&preview_id=' . $form_id) . '#ff_preview';
727 }
728
729 public function addPreviewButton($formId)
730 {
731 echo '<a target="_blank" class="el-button el-button--small" href="' . $this->getFormPreviewUrl($formId) . '">Preview & Design</a>';
732 }
733
734 public function addCopyShortcodeButton($formId)
735 {
736 echo '<button style="background:#dedede;color:#545454;padding:5px;" title="Click to Copy" class="btn copy" data-clipboard-text=\'[fluentform id="' . $formId . '"]\'><i class="dashicons dashicons-admin-page" style="color:#eee;text-shadow:#000 -1px 1px 1px;"></i> [fluentform id="' . $formId . '"]</button>';
737 return;
738 }
739
740 public function commonAction()
741 {
742 $fluentFormPages = array(
743 'fluent_forms',
744 'fluent_forms_transfer',
745 'fluent_forms_settings',
746 'fluent_form_add_ons',
747 'fluent_forms_docs'
748 );
749
750 if (isset($_GET['page']) && in_array($_GET['page'], $fluentFormPages)) {
751 // Let's deregister existing vuejs by other devs
752 // Other devs should not regis
753 add_action('admin_print_scripts', function () {
754 wp_dequeue_script('vuejs');
755 wp_dequeue_script('vue');
756 wp_deregister_script('elementor-admin-app');
757 });
758 }
759 }
760
761 public function renderGlobalMenu()
762 {
763 $showPayment = false;
764 if(defined('FLUENTFORMPRO')) {
765 $showPayment = !get_option('__fluentform_payment_module_settings');
766 if($showPayment) {
767 $formCount = wpFluent()->table('fluentform_forms')
768 ->count();
769 $showPayment = $formCount > 2;
770 }
771 }
772 View::render('admin.global_menu', array(
773 'show_payment' => $showPayment,
774 'show_payment_entries' => apply_filters('fluentform_show_payment_entries', false)
775 ));
776 }
777
778 public function renderPaymentEntries()
779 {
780 do_action('flunetform_render_payment_entries');
781 }
782 }
783