PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.6
JetFormBuilder — Dynamic Blocks Form Builder v3.1.6
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 / includes / blocks / conditional-block / render-states / base-render-state.php
jetformbuilder / includes / blocks / conditional-block / render-states Last commit date
base-render-state.php 2 years ago custom-render-state.php 2 years ago default-state.php 2 years ago render-state-replace-exception.php 2 years ago
base-render-state.php
66 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Blocks\Conditional_Block\Render_States;
5
6 use Jet_Form_Builder\Blocks\Conditional_Block\Render_State;
7 use Jet_Form_Builder\Classes\Arrayable\Arrayable;
8 use Jet_Form_Builder\Classes\Arrayable\Collection_Item_Interface;
9 use JFB_Components\Repository\Repository_Item_Instance_Trait;
10
11 // If this file is called directly, abort.
12 if ( ! defined( 'WPINC' ) ) {
13 die;
14 }
15
16 abstract class Base_Render_State implements
17 Repository_Item_Instance_Trait,
18 Collection_Item_Interface,
19 Arrayable {
20
21 abstract public function get_title(): string;
22
23 abstract public function is_supported(): bool;
24
25 public function is_supported_on_current(): bool {
26 return $this->is_supported();
27 }
28
29 public function rep_item_id() {
30 return $this->get_id();
31 }
32
33 public function render(): string {
34 return sprintf(
35 '<input type="hidden" name="%1$s[]" value="%2$s" data-jfb-sync />',
36 Render_State::FIELD_NAME,
37 $this->get_id()
38 );
39 }
40
41 /**
42 * Determines the availability of this state for switching
43 * to it using the Action Button
44 *
45 * @return bool
46 */
47 public function can_be_switched(): bool {
48 return false;
49 }
50
51 public function exclude_states(): array {
52 return array(
53 Default_State::class,
54 );
55 }
56
57 public function to_array(): array {
58 return array(
59 'value' => $this->get_id(),
60 'label' => $this->get_title(),
61 'can_be_switched' => $this->can_be_switched(),
62 );
63 }
64
65 }
66