PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.0.0
JetFormBuilder — Dynamic Blocks Form Builder v3.0.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 / admin / single-pages / meta-boxes / base-table-box.php
jetformbuilder / includes / admin / single-pages / meta-boxes Last commit date
base-list-box.php 3 years ago base-meta-box.php 3 years ago base-table-box.php 3 years ago meta-box-options-converter.php 3 years ago meta-box-options.php 3 years ago meta-box-update-callback.php 3 years ago meta-table-options-converter.php 3 years ago meta-table-options.php 3 years ago
base-table-box.php
134 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Admin\Single_Pages\Meta_Boxes;
5
6 use Jet_Form_Builder\Admin\Table_Advanced_Record_Prepare_Trait;
7 use Jet_Form_Builder\Rest_Api\Rest_Endpoint;
8 use Jet_Form_Builder\Rest_Api\Traits\Rest_Fetch_Endpoint;
9
10 abstract class Base_Table_Box extends Base_Meta_Box implements
11 Rest_Fetch_Endpoint,
12 Meta_Table_Options {
13
14 use Table_Advanced_Record_Prepare_Trait;
15
16 protected $editable_table = false;
17 protected $editable_table_control = false;
18 protected $show_overflow = false;
19 protected $show_overflow_control = false;
20 protected $offset = 0;
21 protected $limit = 8;
22 protected $footer_heading = true;
23
24 final public function get_values(): array {
25 return $this->prepare_list();
26 }
27
28 public function get_list(): array {
29 return $this->get_raw_list(
30 array(
31 'offset' => $this->offset,
32 'limit' => $this->limit,
33 )
34 );
35 }
36
37 public function get_stable_limit(): int {
38 return 0;
39 }
40
41 public function get_total(): int {
42 return 0;
43 }
44
45 public function get_rest_methods(): string {
46 return '';
47 }
48
49 public function get_rest_url(): string {
50 return '';
51 }
52
53 public function after_prepare_record( $prepared, array $record, $column_name ) {
54 $is_editable = $prepared['editable'] ?? false;
55
56 if ( $is_editable ) {
57 $this->set_editable_table( true );
58 }
59 }
60
61 /**
62 * @param bool $editable_table
63 */
64 public function set_editable_table( bool $editable_table ) {
65 $this->editable_table = $editable_table;
66 }
67
68 /**
69 * @return bool
70 */
71 public function is_editable_table(): bool {
72 return $this->editable_table;
73 }
74
75 /**
76 * @return bool
77 */
78 public function is_show_overflow(): bool {
79 return $this->show_overflow;
80 }
81
82 /**
83 * @return bool
84 */
85 public function is_show_overflow_control(): bool {
86 return $this->show_overflow_control;
87 }
88
89 /**
90 * @return bool
91 */
92 public function is_footer_heading(): bool {
93 return $this->footer_heading;
94 }
95
96 /**
97 * @param bool $footer_heading
98 */
99 public function set_footer_heading( bool $footer_heading ) {
100 $this->footer_heading = $footer_heading;
101 }
102
103 /**
104 * @return bool
105 */
106 public function is_editable_table_control(): bool {
107 return $this->editable_table_control;
108 }
109
110 /**
111 * @param bool $editable_table_control
112 */
113 public function set_editable_table_control( bool $editable_table_control ) {
114 $this->editable_table_control = $editable_table_control;
115 }
116
117 public function to_array(): array {
118 $stable_limit = $this->get_stable_limit();
119
120 return array_merge(
121 parent::to_array(),
122 ( new Meta_Table_Options_Converter( $this ) )->to_array(),
123 array(
124 'render_type' => self::TYPE_TABLE,
125 'columns' => $this->get_columns_headings(),
126 'total' => $this->get_total(),
127 'stable_limit' => $stable_limit ? $stable_limit : null,
128 'receive_url' => ( new Rest_Endpoint( $this ) )->to_array(),
129 )
130 );
131 }
132
133 }
134