PluginProbe
Tableberg – Simple Gutenberg Table Block / 0.0.2
Tableberg – Simple Gutenberg Table Block v0.0.2
1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 trunk 0.0.2 0.2.1 0.3.2 0.3.3 0.4.1 0.5.0 0.5.1 0.5.2 0.5.3 0.5.4 0.5.5 0.5.6 0.5.7 0.5.8 All 41 releases
tableberg / includes / Defaults.php

Defaults.php in Tableberg – Simple Gutenberg Table Block 0.0.2, at includes/Defaults.php

194 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Default Attributes
4 *
5 * @package Tableberg
6 */
7
8 namespace Tableberg;
9
10 /**
11 * Handles default attributes of blocks.
12 */
13 class Defaults {
14
15 /**
16 * Default Block Attributes
17 *
18 * @var array Block Attributes
19 */
20 public $default_values = array(
21 'tableberg/table' => array(
22 'attributes' => array(
23 'rows' => array(
24 'type' => 'number',
25 'default' => 2,
26 ),
27 'cellPadding' => array(
28 'type' => 'array',
29 'default' => array(),
30 ),
31 'cols' => array(
32 'type' => 'number',
33 'default' => 2,
34 ),
35 'hasTableCreated' => array(
36 'type' => 'boolean',
37 'default' => false,
38 ),
39 'enableTableHeader' => array(
40 'type' => 'boolean',
41 'default' => false,
42 ),
43 'enableTableFooter' => array(
44 'type' => 'boolean',
45 'default' => false,
46 ),
47 'tableWidth' => array(
48 'type' => 'string',
49 'default' => '',
50 ),
51 'tableAlignment' => array(
52 'type' => 'string',
53 'default' => 'center',
54 ),
55 'headerBackgroundColor' => array(
56 'type' => 'string',
57 'default' => null,
58 ),
59 'evenRowBackgroundColor' => array(
60 'type' => 'string',
61 'default' => null,
62 ),
63 'oddRowBackgroundColor' => array(
64 'type' => 'string',
65 'default' => null,
66 ),
67 'footerRowBackgroundColor' => array(
68 'type' => 'string',
69 'default' => null,
70 ),
71 'tableBorder' => array(
72 'type' => 'object',
73 'default' => array(),
74 ),
75 'innerBorder' => array(
76 'type' => 'object',
77 'default' => array(),
78 ),
79 'enableInnerBorder' => array(
80 'type' => 'boolean',
81 'default' => true,
82 ),
83 ),
84 ),
85 'tableberg/cell' => array(
86 'attributes' => array(
87 'vAlign' => array(
88 'type' => 'string',
89 'default' => 'center',
90 ),
91 ),
92 ),
93 'tableberg/row' => array(
94 'attributes' => array(
95 'tagName' => array(
96 'type' => 'string',
97 'default' => 'tr',
98 ),
99 'isHeader' => array(
100 'type' => 'boolean',
101 'default' => false,
102 ),
103 'isFooter' => array(
104 'type' => 'boolean',
105 'default' => false,
106 ),
107 ),
108 ),
109 'tableberg/image' => array(
110 'attributes' => array(
111 'media' => array(
112 'type' => 'object',
113 'default' => array(),
114 ),
115 'height' => array(
116 'type' => 'string',
117 'default' => '',
118 ),
119 'width' => array(
120 'type' => 'string',
121 'default' => '',
122 ),
123 'alt' => array(
124 'type' => 'string',
125 'default' => '',
126 ),
127 'aspectRatio' => array(
128 'type' => 'string',
129 'default' => '',
130 ),
131 'scale' => array(
132 'type' => 'string',
133 'default' => '',
134 ),
135 'sizeSlug' => array(
136 'type' => 'string',
137 'default' => 'large',
138 ),
139 'caption' => array(
140 'type' => 'string',
141 'default' => '',
142 ),
143 'href' => array(
144 'type' => 'string',
145 'default' => '',
146 ),
147 'linkClass' => array(
148 'type' => 'string',
149 'default' => '',
150 ),
151 'linkDestination' => array(
152 'type' => 'string',
153 'default' => '',
154 ),
155 'rel' => array(
156 'type' => 'string',
157 'default' => '',
158 ),
159 'linkTarget' => array(
160 'type' => 'string',
161 'default' => '',
162 ),
163 'border' => array(
164 'type' => 'object',
165 'default' => array(),
166 ),
167 'borderRadius' => array(
168 'type' => 'object',
169 'default' => array(),
170 ),
171 ),
172 ),
173 );
174
175
176 /**
177 * Constructor
178 *
179 * @return void
180 */
181 public function __construct() {
182 }
183
184 /**
185 * Get block default attributes with block name.
186 *
187 * @param string $block_name block name.
188 * @return array block attributes
189 */
190 public function get_default_attributes( $block_name ) {
191 return $this->default_values[ $block_name ]['attributes'];
192 }
193 }
194