PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.9.1
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.9.1
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
ablocks / includes / blocks / info-box / attributes.php

attributes.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.9.1, at includes/blocks/info-box/attributes.php

408 lines 9.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use ABlocks\Controls\Alignment;
4 use ABlocks\Controls\Dimensions;
5 use ABlocks\Controls\Typography;
6 use ABlocks\Controls\TextShadow;
7 use ABlocks\Controls\TextStroke;
8 use ABlocks\Controls\Link;
9 use ABlocks\Helper;
10 use ABlocks\Controls\Icon;
11 use ABlocks\Controls\Border;
12 use ABlocks\Controls\Range;
13 use ABlocks\Components\ButtonGroup;
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19
20 $attributes = [
21 'block_id' => [
22 'type' => 'string',
23 'default' => '',
24 ],
25 'blockElements' => [
26 'type' => 'array',
27 'default' => [
28 [
29 'id' => 0,
30 'slug' => 'Heading',
31 ],
32 [
33 'id' => 1,
34 'slug' => 'Sub-Heading',
35 ],
36 [
37 'id' => 2,
38 'slug' => 'Description',
39 ],
40 [
41 'id' => 3,
42 'slug' => 'Rating',
43 ],
44 [
45 'id' => 4,
46 'slug' => 'Button',
47 ],
48 ]
49 ],
50 'des' => [
51 'type' => 'string',
52 'source' => 'html',
53 'selector' => '.ablocks-info-box-text',
54 'default' => 'Showcase details with style and precision! Customize captivating visuals and text for an engaging, attention-grabbing display!',
55 ],
56 'allowBadgeHover' => [
57 'type' => 'boolean',
58 'default' => false,
59 ],
60 'allowButtonHover' => [
61 'type' => 'boolean',
62 'default' => false,
63 ],
64 'allowBadge' => [
65 'type' => 'boolean',
66 'default' => false,
67 ],
68 'allowIcon' => [
69 'type' => 'boolean',
70 'default' => true,
71 ],
72 'allowHeading' => [
73 'type' => 'boolean',
74 'default' => true,
75 ],
76 'allowSubHeading' => [
77 'type' => 'boolean',
78 'default' => false,
79 ],
80 'allowDes' => [
81 'type' => 'boolean',
82 'default' => true,
83 ],
84 'allowRating' => [
85 'type' => 'boolean',
86 'default' => false,
87 ],
88 'allowButton' => [
89 'type' => 'boolean',
90 'default' => true,
91 ],
92 // badge starts
93 'badgeText' => [
94 'type' => 'string',
95 'default' => 'Featured',
96 ],
97 'badgeSize' => [
98 'type' => 'string',
99 'default' => 'xs',
100 ],
101 'badgeTextColor' => [
102 'type' => 'string',
103 'default' => '#13191B',
104 ],
105 'badgeTextColorH' => [
106 'type' => 'string',
107 'default' => '',
108 ],
109 'badgeBackground' => [
110 'type' => 'string',
111 'default' => '#DDDDDF',
112 ],
113 'badgeBackgroundH' => [
114 'type' => 'string',
115 'default' => '',
116 ],
117 'badgeTransition' => [
118 'type' => 'number',
119 'default' => '',
120 ],
121 // icon starts
122 'iconPrimaryColorH' => [
123 'type' => 'string',
124 'default' => '',
125 ],
126 'iconTransition' => [
127 'type' => 'number',
128 'default' => '',
129 ],
130 // Heading starts
131 'heading' => array(
132 'type' => 'string',
133 'source' => 'html',
134 'selector' => '.ablocks-info-box-heading',
135 'default' => 'Your Info Box Title',
136 ),
137 'headingTag' => array(
138 'type' => 'string',
139 'default' => 'h2',
140 ),
141 'headingTextColor' => array(
142 'type' => 'string',
143 'default' => '#13191B',
144 ),
145 'headingTextColorHover' => array(
146 'type' => 'string',
147 'default' => '',
148 ),
149 'headingTransition' => [
150 'type' => 'number',
151 'default' => '',
152 ],
153 // Sub Heading starts
154 'subHeading' => array(
155 'type' => 'string',
156 'source' => 'html',
157 'selector' => '.ablocks-info-box-sub-heading',
158 'default' => 'Your Info Box Sub Title',
159 ),
160 'subHeadingTag' => array(
161 'type' => 'string',
162 'default' => 'h4',
163 ),
164 'subHeadingTextColor' => array(
165 'type' => 'string',
166 'default' => '#13191B',
167 ),
168 'subHeadingTextColorHover' => array(
169 'type' => 'string',
170 'default' => '',
171 ),
172 'subHeadingTransition' => [
173 'type' => 'number',
174 'default' => '',
175 ],
176 // paragraph starts
177 'des' => [
178 'type' => 'string',
179 'source' => 'html',
180 'selector' => '.ablocks-info-box-text',
181 'default' => 'Showcase details with style and precision! Customize captivating visuals and text for an engaging, attention-grabbing display!',
182 ],
183 'desDropCaps' => [
184 'type' => 'boolean',
185 'default' => false,
186 ],
187 'desDropCapsTextColor' => [
188 'type' => 'string',
189 'default' => '#0f2aff',
190 ],
191 'desGraphSize' => [
192 'type' => 'string',
193 'default' => 'sm',
194 ],
195 'desSize' => [
196 'type' => 'string',
197 'default' => 'sm',
198 ],
199 'desTextColor' => [
200 'type' => 'string',
201 'default' => '#74777C',
202 ],
203 'desTextColorHover' => [
204 'type' => 'string',
205 'default' => 'gray',
206 ],
207 'desTransition' => [
208 'type' => 'number',
209 'default' => '',
210 ],
211 // Star Rating starts
212 'ratingScale' => [
213 'type' => 'number',
214 'default' => 5,
215 ],
216 'ratingColor' => [
217 'type' => 'string',
218 'default' => '#e99516',
219 ],
220 'ratingColorHover' => [
221 'type' => 'string',
222 'default' => '',
223 ],
224 'ratingUnmarkedColor' => [
225 'type' => 'string',
226 'default' => '#696969'
227 ],
228 'ratingTransition' => [
229 'type' => 'number',
230 'default' => '',
231 ],
232 'ratingUnmarkedColorHover' => [
233 'type' => 'string',
234 'default' => ''
235 ],
236 'ratingShowCount' => [
237 'type' => 'boolean',
238 'default' => true,
239 ],
240 'showRatingNumber' => [
241 'type' => 'boolean',
242 'default' => true,
243 ],
244 'ratingNumberColor' => [
245 'type' => 'string',
246 'default' => '#000000',
247 ],
248 'ratingNumberPosition' => [
249 'type' => 'string',
250 'default' => 'right',
251 ],
252 // button starts
253 'btnText' => [
254 'type' => 'string',
255 'default' => 'Learn More',
256 ],
257 'btnSize' => [
258 'type' => 'string',
259 'default' => 'sm',
260 ],
261 'btnTextColor' => [
262 'type' => 'string',
263 'default' => '#FAFAFA',
264 ],
265 'btnTextColorH' => [
266 'type' => 'string',
267 'default' => '',
268 ],
269 'btnBackground' => [
270 'type' => 'string',
271 'default' => '#13191B',
272 ],
273 'btnBackgroundH' => [
274 'type' => 'string',
275 'default' => '',
276 ],
277 'btnTransition' => [
278 'type' => 'number',
279 'default' => '',
280 ],
281 'btnIconPosition' => [
282 'type' => 'string',
283 'default' => 'right',
284 ],
285 'btnIconSpace' => [
286 'type' => 'number',
287 'default' => 10,
288 ],
289 'btnShowIcon' => [
290 'type' => 'boolean',
291 'default' => true
292 ],
293 ];
294
295 $attributes = array_merge(
296 $attributes,
297 Alignment::get_attribute( 'alignment', true ),
298 ButtonGroup::get_attribute( 'stack', false, [
299 'value' => '',
300 ] ),
301 // badge starts
302 Border::get_attribute( 'badgeBorder', true ),
303 Dimensions::get_attribute( 'badgePadding', true ),
304 Typography::get_attribute( 'badgeTypography', true, [
305 'fontFamily' => 'Roboto',
306 'weight' => '400',
307 'fontSize' => '12',
308 ] ),
309 TextShadow::get_attribute( 'badgeTextShadow' ),
310 Alignment::get_attribute( 'badgePosition', true, [ 'value' => 'top-right' ] ),
311 Alignment::get_attribute( 'badgeAlignment', true, [ 'value' => 'center' ] ),
312 // icon starts
313 Icon::get_attribute('icon', [
314 'color' => '#000000',
315 'hasNoSelectorOrSource' => true
316 ] ),
317 Link::get_attribute( 'iconLink' ),
318 Alignment::get_attribute( 'iconAlignment', true ),
319 // heading starts
320 Typography::get_attribute( 'headingTypography', true, [
321 'fontFamily' => 'Roboto',
322 'weight' => '600',
323 'fontSize' => '28',
324 ]),
325 TextShadow::get_attribute( 'headingTextShadow' ),
326 TextStroke::get_attribute( 'headingTextStroke', true ),
327 // sub heading starts
328 Typography::get_attribute( 'subHeadingTypography', true, [
329 'fontFamily' => 'Roboto',
330 'weight' => '500',
331 'fontSize' => '20',
332 ]),
333 TextShadow::get_attribute( 'subHeadingTextShadow' ),
334 TextStroke::get_attribute( 'subHeadingTextStroke', true ),
335 // paragraph starts
336 Typography::get_attribute( 'desTypography', true, [
337 'fontFamily' => 'Roboto',
338 'weight' => '400',
339 'fontSize' => '16',
340 ]),
341 TextShadow::get_attribute( 'desTextShadow' ),
342 TextStroke::get_attribute( 'desTextStroke', true ),
343 // button starts
344 Icon::get_attribute('btnIcon', [
345 'size' => 20,
346 'color' => '#FAFAFA',
347 'path' => 'M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z',
348 'viewBox' => '0 0 448 512',
349 'className' => 'fas fa-arrow-right',
350 'hasNoSelectorOrSource' => true,
351 ] ),
352 Link::get_attribute( 'btnLink' ),
353 Border::get_attribute( 'btnBorder', true ),
354 Dimensions::get_attribute( 'btnPadding', true ),
355 Typography::get_attribute( 'btnTypography', true ),
356 TextShadow::get_attribute( 'btnTextShadow' ),
357 Alignment::get_attribute( 'btnAlignment', true, [ 'value' => 'center' ] ),
358 // star rating starts
359 Typography::get_attribute( 'ratingNumberTypography', true ),
360 Icon::get_attribute( 'starIcon', [
361 'path' => 'M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z',
362 'viewBox' => '0 0 576 512',
363 'className' => 'far fa-star',
364 'hasNoSelectorOrSource' => true,
365 ] ),
366 Range::get_attribute( [
367 'attributeName' => 'rating',
368 'isResponsive' => false,
369 'defaultValue' => 4,
370 ]),
371 Range::get_attribute( [
372 'attributeName' => 'spacing',
373 'attributeObjectKey' => 'value',
374 'isResponsive' => true,
375 'defaultValue' => 0,
376 'hasUnit' => true,
377 'unitDefaultValue' => 'px',
378 ] ),
379 Range::get_attribute( [
380 'attributeName' => 'ratingNumberGap',
381 'attributeObjectKey' => 'value',
382 'isResponsive' => true,
383 'defaultValue' => 0,
384 'hasUnit' => true,
385 'unitDefaultValue' => 'px',
386 ] ),
387 Range::get_attribute([
388 'attributeName' => 'iconGap',
389 'attributeObjectKey' => 'value',
390 'isResponsive' => true,
391 'defaultValue' => 16,
392 'hasUnit' => true,
393 'unitDefaultValue' => 'px',
394 ]),
395 Range::get_attribute([
396 'attributeName' => 'contentGap',
397 'attributeObjectKey' => 'value',
398 'isResponsive' => true,
399 'defaultValue' => 10,
400 'hasUnit' => true,
401 'unitDefaultValue' => 'px',
402 ]),
403 );
404
405 return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
406
407
408