PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.3.0
JetFormBuilder — Dynamic Blocks Form Builder v3.3.0
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 / actions / events / base-event.php
jetformbuilder / includes / actions / events Last commit date
bad-request 2 years ago default-process 2 years ago default-required 2 years ago gateway-failed 2 years ago gateway-success 2 years ago never 2 years ago on-dynamic-state 2 years ago base-action-event.php 2 years ago base-event.php 2 years ago base-executor.php 2 years ago base-gateway-event.php 2 years ago gateway-base-executor.php 2 years ago
base-event.php
95 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Actions\Events;
5
6 use Jet_Form_Builder\Actions\Types\Base;
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 use Jet_Form_Builder\Exceptions\Action_Exception;
11
12 // If this file is called directly, abort.
13 if ( ! defined( 'WPINC' ) ) {
14 die;
15 }
16
17 abstract class Base_Event implements
18 Repository_Item_Instance_Trait,
19 Collection_Item_Interface,
20 Arrayable {
21
22 /**
23 * @return Base_Executor[]
24 */
25 abstract public function executors(): array;
26
27 public function ignored_executors(): array {
28 return array();
29 }
30
31 /**
32 * @throws Action_Exception
33 */
34 public function execute() {
35 $this->get_executor()->execute();
36 }
37
38
39 /**
40 * @return Base_Executor
41 */
42 final public function get_executor(): Base_Executor {
43 foreach ( $this->executors() as $executor ) {
44 if ( $executor->is_supported() ) {
45 return $executor->set_event( $this );
46 }
47 }
48
49 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
50 wp_die(
51 /* translators: %s - Event class name */
52 sprintf( __( 'Not founded supported executor for %s', 'jet-form-builder' ), static::class )
53 );
54 // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
55 }
56
57 public function is_valid_action( Base $action ): bool {
58 $unsupported = $action->unsupported_events();
59
60 if ( ! empty( $unsupported ) && in_array( static::class, $unsupported, true ) ) {
61 return false;
62 }
63 $supported = $action->supported_events();
64
65 if ( ! empty( $supported ) && ! in_array( static::class, $supported, true ) ) {
66 return false;
67 }
68
69 return $action->get_events()->in_array( $this );
70 }
71
72 public function get_label(): string {
73 return $this->get_id();
74 }
75
76 public function get_help(): string {
77 return '';
78 }
79
80 public function rep_item_id() {
81 return $this->get_id();
82 }
83
84
85 public function to_array(): array {
86 return array(
87 'value' => $this->get_id(),
88 'label' => $this->get_label(),
89 'help' => $this->get_help(),
90 'self' => static::class,
91 );
92 }
93
94 }
95