PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / trunk
JetFormBuilder — Dynamic Blocks Form Builder vtrunk
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 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.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / compatibility / bricks / widgets / base.php
jetformbuilder / compatibility / bricks / widgets Last commit date
base.php 1 year ago form.php 1 month ago widget-base-it.php 2 years ago
base.php
132 lines
1 <?php
2
3
4 namespace JFB_Compatibility\Bricks\Widgets;
5
6 use Bricks\Element;
7
8 // If this file is called directly, abort.
9 if ( ! defined( 'WPINC' ) ) {
10 die;
11 }
12
13 class Base extends Element {
14
15 /**
16 * Use predefined element category 'general'
17 *
18 * @var string
19 */
20 public $category = 'general';
21 /**
22 * Make sure to prefix your elements
23 *
24 * @var string
25 */
26 public $name = '';
27 /**
28 * Themify icon font class
29 *
30 * @var string
31 */
32 public $icon = 'ti-bolt-alt';
33 /**
34 * Default CSS selector
35 *
36 * @var string
37 */
38 public $css_selector = '';
39 /**
40 * Script(s) run when element is rendered on frontend or updated in builder
41 *
42 * @var array
43 */
44 public $scripts = array();
45
46 public $current_jet_group = null;
47 public $current_jet_tab = null;
48
49 public $jet_element_render_instance;
50 public $jet_element_render = '';
51
52 // Return localised element label
53 public function get_label() {
54 return 'Test';
55 }
56
57 /**
58 * Register new control group
59 * You can't add elements into new groups without registering these groups before
60 *
61 * @param [type] $name [description]
62 * @param array $data [description]
63 * @return [type] [description]
64 */
65 public function register_jet_control_group( $name, $data = array() ) {
66 $this->control_groups[ $name ] = $data;
67 }
68
69 /**
70 * Start controls group (aka Sections in Elementor)
71 *
72 * @param [type] $group [description]
73 * @return [type] [description]
74 */
75 public function start_jet_control_group( $group ) {
76 $data = $this->control_groups[ $group ] ?? array();
77 $this->current_jet_tab = $data['tab'] ?? 'content';
78
79 $this->current_jet_group = $group;
80 }
81
82 /**
83 * End controls grous
84 *
85 * @return [type] [description]
86 */
87 public function end_jet_control_group() {
88 $this->current_jet_tab = null;
89 $this->current_jet_group = null;
90 }
91
92 /**
93 * Wrapper to register control
94 *
95 * @param [type] $name [description]
96 * @param array $data [description]
97 * @return [type] [description]
98 */
99 public function register_jet_control( $name, $data = array() ) {
100 if ( ! $this->current_jet_tab ) {
101 $this->current_jet_tab = 'content';
102 }
103
104 $data['tab'] = $this->current_jet_tab;
105 $data['group'] = $this->current_jet_group;
106
107 $this->controls[ $name ] = $data;
108 }
109
110 public function get_jet_settings( $setting = null, $default_value = false ) {
111
112 if ( ! $setting ) {
113 return $this->settings;
114 }
115
116 $value = null;
117
118 if ( isset( $this->settings[ $setting ] ) ) {
119 $value = $this->settings[ $setting ];
120 } else {
121 $value = isset( $this->controls[ $setting ] ) && isset( $this->controls[ $setting ]['default'] ) ? $this->controls[ $setting ]['default'] : $default_value;
122 }
123
124 return $value;
125 }
126
127 public function parse_jet_render_attributes( $attrs = array() ) {
128 return apply_filters( 'jet-form-builder/bricks/element/parsed-attrs', $attrs, $this );
129 }
130
131 }
132