PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.1.4
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.1.4
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
bit-form / includes / Core / Ajax / AjaxService.php

AjaxService.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 3.1.4, at includes/Core/Ajax/AjaxService.php

53 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BitCode\BitForm\Core\Ajax;
4
5 use BitCode\BitForm\Admin\AdminAjax;
6 use BitCode\BitForm\Core\Capability\Request;
7 use BitCode\BitForm\Core\Integration\Integrations;
8 use BitCode\BitForm\Frontend\Ajax\FrontendAjax;
9
10 class AjaxService
11 {
12 public function __construct()
13 {
14 if (Request::Check('ajax')) {
15 $this->loadPublicAjax();
16 }
17 if (Request::Check('admin') && (current_user_can('manage_bitform') || current_user_can('manage_options'))) {
18 $this->loadAdminAjax();
19 $this->loadIntegrationsAjax();
20 }
21 }
22
23 /**
24 * Helps to register admin side ajax
25 *
26 * @return null
27 */
28 public function loadAdminAjax()
29 {
30 (new AdminAjax())->register();
31 }
32
33 /**
34 * Helps to register frontend ajax
35 *
36 * @return null
37 */
38 protected function loadPublicAjax()
39 {
40 (new FrontendAjax())->register();
41 }
42
43 /**
44 * Helps to register integration ajax
45 *
46 * @return null
47 */
48 public function loadIntegrationsAjax()
49 {
50 (Integrations::getInstance())->registerAjax();
51 }
52 }
53