PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.1
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.1
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / compat / class-abstract-wpuf-integration.php

class-abstract-wpuf-integration.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.6.1, at includes/compat/class-abstract-wpuf-integration.php

118 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( !class_exists( 'WPUF_Abstract_Integration' ) ) {
4
5 /**
6 * The Integration abstract class
7 */
8 abstract class WPUF_Abstract_Integration {
9
10 /**
11 * The integration id
12 *
13 * @var bool
14 */
15 public $id;
16
17 /**
18 * If the integration is enabled
19 *
20 * @var bool
21 */
22 public $enabled;
23
24 /**
25 * Integration title
26 *
27 * @var string
28 */
29 public $title;
30
31 /**
32 * URL to the integration icon
33 *
34 * @var string
35 */
36 public $icon;
37
38 /**
39 * The settings fields for this integrations
40 *
41 * @var array
42 */
43 public $settings_fields = [];
44
45 /**
46 * Get the integration title
47 *
48 * @return string
49 */
50 public function get_title() {
51 return apply_filters( 'wpuf_integration_title', $this->title, $this );
52 }
53
54 /**
55 * Get the integration id
56 *
57 * @return string
58 */
59 public function get_id() {
60 return apply_filters( 'wpuf_integration_title', $this->id, $this );
61 }
62
63 /**
64 * Get intgration icon
65 *
66 * @return string
67 */
68 public function get_icon() {
69 return apply_filters( 'wpuf_integration_icon', $this->icon, $this );
70 }
71
72 /**
73 * Check if the integration is enabled
74 *
75 * @return bool
76 */
77 public function is_enabled() {
78 return $this->enabled == true;
79 }
80
81 /**
82 * Get the settings fields
83 *
84 * @return array
85 */
86 public function get_settings_fields() {
87 return $this->settings_fields;
88 }
89
90 /**
91 * Get the integration settings for the component
92 *
93 * @return array
94 */
95 public function get_js_settings() {
96 return [
97 'id' => $this->get_id(),
98 'title' => $this->get_title(),
99 'icon' => $this->get_icon(),
100 'settings' => $this->get_settings_fields(),
101 ];
102 }
103
104 /**
105 * Register the integration in the builder settings
106 *
107 * @param array $integrations
108 *
109 * @return array
110 */
111 public function register_integration_settings( $integrations ) {
112 $integrations[ $this->id ] = $this->get_js_settings();
113
114 return $integrations;
115 }
116 }
117 }
118