PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.2.3
JetFormBuilder — Dynamic Blocks Form Builder v3.2.3
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 / admin / table-views / view-base.php
jetformbuilder / includes / admin / table-views Last commit date
actions 2 years ago columns 2 years ago column-advanced-base.php 2 years ago column-base.php 2 years ago column-heading-interface.php 2 years ago column-heading-trait.php 2 years ago view-advanced-base.php 2 years ago view-base.php 2 years ago view-simple-base.php 2 years ago
view-base.php
95 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Admin\Table_Views;
5
6 use JFB_Components\Repository\Repository_Item_With_Class;
7 use JFB_Components\Repository\Repository_Static_Item_It;
8 use Jet_Form_Builder\Db_Queries\Exceptions\Sql_Exception;
9 use Jet_Form_Builder\Db_Queries\Traits\Model_Dependencies;
10 use Jet_Form_Builder\Db_Queries\Traits\Model_Dependencies_Interface;
11 use Jet_Form_Builder\Rest_Api\Rest_Endpoint;
12 use Jet_Form_Builder\Rest_Api\Traits\Rest_Fetch_Endpoint;
13
14 // If this file is called directly, abort.
15 if ( ! defined( 'WPINC' ) ) {
16 die;
17 }
18
19 abstract class View_Base implements
20 Repository_Static_Item_It,
21 Model_Dependencies_Interface,
22 Rest_Fetch_Endpoint {
23
24 use Repository_Item_With_Class;
25 use Model_Dependencies;
26
27 abstract public function get_prepared_list( array $custom_list = array() ): array;
28
29 public function get_list(): array {
30 return $this->get_raw_list(
31 array(
32 'offset' => 0,
33 'limit' => 15,
34 )
35 );
36 }
37
38 public function get_global_actions(): array {
39 return array();
40 }
41
42 public function get_total(): int {
43 return 0;
44 }
45
46 public function get_empty_message(): string {
47 return __( 'No items found.', 'jet-form-builder' );
48 }
49
50 public function get_rest_methods(): string {
51 return '';
52 }
53
54 public function get_rest_url(): string {
55 return '';
56 }
57
58 public function get_receive_endpoint(): array {
59 return ( new Rest_Endpoint( $this ) )->to_array();
60 }
61
62 public function load_data(): array {
63 return array();
64 }
65
66 /**
67 * @return array
68 */
69 final public function load_view(): array {
70 try {
71 $this->prepare_dependencies();
72 } catch ( Sql_Exception $exception ) {
73 return array(
74 'list' => array(),
75 'columns' => array(),
76 'actions' => array(),
77 );
78 }
79
80 return array_merge(
81 array(
82 'list' => $this->get_prepared_list(),
83 'columns' => $this->get_columns_headings(),
84 'actions' => $this->get_global_actions(),
85 'total' => $this->get_total(),
86 'receive_url' => $this->get_receive_endpoint(),
87 'empty_message' => $this->get_empty_message(),
88 ),
89 $this->load_data()
90 );
91 }
92
93
94 }
95