PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.15.3
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.15.3
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
← All changes | includes/Core/Ajax/AjaxService.php +39 -39 1.4.18 → 2.15.3 View file →
@@ -1,52 +1,52 @@
1 1 <?php
2 +
2 3 namespace BitCode\BitForm\Core\Ajax;
3 4
4 5 use BitCode\BitForm\Admin\AdminAjax;
5 6 use BitCode\BitForm\Core\Capability\Request;
7 +use BitCode\BitForm\Core\Integration\Integrations;
6 8 use BitCode\BitForm\Frontend\Ajax\FrontendAjax;
7 -use BitCode\BitForm\Core\Integration\Integrations;
8 9
9 10 class AjaxService
10 11 {
11 - public function __construct()
12 - {
13 - if (Request::Check('ajax')) {
14 - $this->loadPublicAjax();
15 - }
16 - if (Request::Check('admin')) {
17 - $this->loadAdminAjax();
18 - $this->loadIntegrationsAjax();
19 - }
12 + public function __construct()
13 + {
14 + if (Request::Check('ajax')) {
15 + $this->loadPublicAjax();
20 16 }
17 + if (Request::Check('admin') && (current_user_can('manage_bitform') || current_user_can('manage_options'))) {
18 + $this->loadAdminAjax();
19 + $this->loadIntegrationsAjax();
20 + }
21 + }
21 22
22 - /**
23 - * Helps to register admin side ajax
24 - *
25 - * @return null
26 - */
27 - public function loadAdminAjax()
28 - {
29 - (new AdminAjax())->register();
30 - }
23 + /**
24 + * Helps to register admin side ajax
25 + *
26 + * @return null
27 + */
28 + public function loadAdminAjax()
29 + {
30 + (new AdminAjax())->register();
31 + }
31 32
32 - /**
33 - * Helps to register frontend ajax
34 - *
35 - * @return null
36 - */
37 - protected function loadPublicAjax()
38 - {
39 - (new FrontendAjax())->register();
40 - }
41 -
42 - /**
43 - * Helps to register integration ajax
44 - *
45 - * @return null
46 - */
47 - public function loadIntegrationsAjax()
48 - {
49 - (new Integrations())->registerAjax();
50 -
51 - }
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 + (new Integrations())->registerAjax();
51 + }
52 52 }