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 / search / attributes.php

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

186 lines 4.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\Border;
4 use ABlocks\Controls\Dimensions;
5 use ABlocks\Controls\Alignment;
6 use ABlocks\Controls\Range;
7 use ABlocks\Controls\Typography;
8 use ABlocks\Controls\TextShadow;
9 use ABlocks\Controls\TextStroke;
10 use ABlocks\Controls\Icon;
11
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 $attributes = [
18 'block_id' => [
19 'type' => 'string',
20 'default' => ''
21 ],
22 'currentPostID' => [
23 'type' => 'integer',
24 'default' => '',
25 ],
26 'searchTerm' => [
27 'type' => 'string',
28 'default' => '',
29 ],
30 'source' => [
31 'type' => 'string',
32 'default' => 'any',
33 ],
34 'isIcon' => [
35 'type' => 'string',
36 'default' => 'icon',
37 ],
38 'variant' => [
39 'type' => 'string',
40 'default' => 'classic',
41 ],
42 'position' => [
43 'type' => 'string',
44 'default' => 'default'
45 ],
46 'buttonText' => [
47 'type' => 'string',
48 'default' => 'Search',
49 ],
50 'buttonTextColor' => [
51 'type' => 'string',
52 'default' => '',
53 ],
54 'placeholder' => [
55 'type' => 'string',
56 'default' => 'Write anything...',
57 ],
58 'placeholderColor' => [
59 'type' => 'string',
60 'default' => 'gray',
61 ],
62 'inputTextColor' => [
63 'type' => 'string',
64 'default' => '#949494',
65 ],
66 'searchResTColor' => [
67 'type' => 'string',
68 'default' => '#000000',
69 ],
70 'loadingSpinnerColor' => [
71 'type' => 'string',
72 'default' => '#fff',
73 ],
74 ];
75
76 $attributes = array_merge(
77 $attributes,
78 Alignment::get_attribute( 'buttonAlignment', false, [ 'value' => 'left' ] ),
79 Typography::get_attribute( 'buttonTypography', true ),
80 Typography::get_attribute( 'searchResTypography', true ),
81 TextShadow::get_attribute( 'buttonTextShadow' ),
82 TextStroke::get_attribute( 'buttonTextStroke', true ),
83 Alignment::get_attribute( 'alignment', true, [ 'value' => 'left' ] ),
84 Typography::get_attribute( 'inputTypography', true ),
85 TextShadow::get_attribute( 'inputTextShadow' ),
86 TextStroke::get_attribute( 'inputTextStroke', true ),
87 Alignment::get_attribute( 'fullscreenButtonAlignment', true, [ 'value' => 'center' ] ),
88 Alignment::get_attribute( 'horizontalAlignment', true, [ 'value' => 'left' ] ),
89 Alignment::get_attribute( 'verticalAlignment', true, [ 'value' => 'top' ] ),
90 Border::get_attribute( 'listBorder', true ),
91 Border::get_attribute( 'itemBorder', true ),
92 Dimensions::get_attribute( 'listPadding', true ),
93 Dimensions::get_attribute( 'itemPadding', true ),
94 Range::get_attribute( [
95 'attributeName' => 'gap',
96 'attributeObjectKey' => 'value',
97 'isResponsive' => true,
98 'defaultValue' => 0,
99 'defaultValueMobile' => 0,
100 'defaultValueTablet' => 0,
101 'hasUnit' => true,
102 'unitDefaultValue' => 'px',
103 ] ),
104 Range::get_attribute( [
105 'attributeName' => 'listGap',
106 'attributeObjectKey' => 'value',
107 'isResponsive' => true,
108 'defaultValue' => '',
109 'hasUnit' => true,
110 'unitDefaultValue' => 'px',
111 ] ),
112 Range::get_attribute( [
113 'attributeName' => 'iconWidth',
114 'attributeObjectKey' => 'value',
115 'isResponsive' => true,
116 'defaultValue' => 18,
117 'defaultValueMobile' => 18,
118 'defaultValueTablet' => 12,
119 'hasUnit' => true,
120 'unitDefaultValue' => 'px',
121 ] ),
122 Range::get_attribute( [
123 'attributeName' => 'listWidth',
124 'attributeObjectKey' => 'value',
125 'isResponsive' => true,
126 'defaultValue' => '',
127 'hasUnit' => true,
128 'unitDefaultValue' => '%',
129 ] ),
130 Range::get_attribute( [
131 'attributeName' => 'thumbnailWidth',
132 'attributeObjectKey' => 'value',
133 'isResponsive' => true,
134 'defaultValue' => '',
135 'hasUnit' => true,
136 'unitDefaultValue' => '%',
137 ] ),
138 Range::get_attribute( [
139 'attributeName' => 'thumbnailHeight',
140 'attributeObjectKey' => 'value',
141 'isResponsive' => true,
142 'defaultValue' => '',
143 'hasUnit' => true,
144 'unitDefaultValue' => 'px',
145 ] ),
146 Range::get_attribute( [
147 'attributeName' => 'itemWidth',
148 'attributeObjectKey' => 'value',
149 'isResponsive' => true,
150 'defaultValue' => '',
151 'hasUnit' => true,
152 'unitDefaultValue' => 'px',
153 ] ),
154 Range::get_attribute( [
155 'attributeName' => 'itemGap',
156 'attributeObjectKey' => 'value',
157 'isResponsive' => true,
158 'defaultValue' => '',
159 'hasUnit' => true,
160 'unitDefaultValue' => 'px',
161 ] ),
162 Range::get_attribute( [
163 'attributeName' => 'horizontalOffset',
164 'attributeObjectKey' => 'value',
165 'isResponsive' => true,
166 'defaultValue' => 230,
167 'defaultValueMobile' => 230,
168 'defaultValueTablet' => 230,
169 'hasUnit' => true,
170 'unitDefaultValue' => 'px',
171 ] ),
172 Range::get_attribute( [
173 'attributeName' => 'verticalOffset',
174 'attributeObjectKey' => 'value',
175 'isResponsive' => true,
176 'defaultValue' => 230,
177 'defaultValueMobile' => 230,
178 'defaultValueTablet' => 230,
179 'hasUnit' => true,
180 'unitDefaultValue' => 'px',
181 ] ),
182 );
183
184 return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
185
186