PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 2.0.1
JetFormBuilder — Dynamic Blocks Form Builder v2.0.1
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 4 years ago base-meta-box.php 4 years ago base-table-box.php 4 years ago
base-table-box.php
88 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
8 abstract class Base_Table_Box extends Base_Meta_Box {
9
10 use Table_Advanced_Record_Prepare_Trait;
11
12 protected $editable_table = false;
13 protected $show_overflow = false;
14 protected $show_overflow_control = false;
15 protected $offset = 0;
16 protected $limit = 8;
17
18 final public function get_values(): array {
19 return $this->prepare_list();
20 }
21
22 public function get_list(): array {
23 return $this->get_raw_list(
24 array(
25 'offset' => $this->offset,
26 'limit' => $this->limit,
27 )
28 );
29 }
30
31 public function get_total(): int {
32 return 0;
33 }
34
35 public function get_receive_endpoint(): array {
36 return array();
37 }
38
39 public function after_prepare_record( $prepared, array $record, $column_name ) {
40 $is_editable = $prepared['editable'] ?? false;
41
42 if ( $is_editable ) {
43 $this->set_editable_table( true );
44 }
45 }
46
47 /**
48 * @param bool $editable_table
49 */
50 public function set_editable_table( bool $editable_table ) {
51 $this->editable_table = $editable_table;
52 }
53
54 /**
55 * @return bool
56 */
57 public function is_editable_table(): bool {
58 return $this->editable_table;
59 }
60
61 /**
62 * @return bool
63 */
64 public function is_show_overflow(): bool {
65 return $this->show_overflow;
66 }
67
68 /**
69 * @return bool
70 */
71 public function is_show_overflow_control(): bool {
72 return $this->show_overflow_control;
73 }
74
75 public function to_array(): array {
76 return parent::to_array() + array(
77 'columns' => $this->get_columns_headings(),
78 'render_type' => self::TYPE_TABLE,
79 'is_editable_table' => $this->is_editable_table(),
80 'total' => $this->get_total(),
81 'receive_url' => $this->get_receive_endpoint(),
82 'show_overflow' => $this->is_show_overflow(),
83 'show_overflow_control' => $this->is_show_overflow_control(),
84 );
85 }
86
87 }
88