| 1 |
<?php |
| 2 |
|
| 3 |
use ABlocks\Controls\Alignment; |
| 4 |
use ABlocks\Controls\Dimensions; |
| 5 |
use ABlocks\Controls\Typography; |
| 6 |
use ABlocks\Controls\Border; |
| 7 |
use ABlocks\Controls\Range; |
| 8 |
use ABlocks\Controls\BoxShadow; |
| 9 |
use ABlocks\Components\ButtonGroup; |
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit; |
| 12 |
} |
| 13 |
|
| 14 |
$attributes = [ |
| 15 |
'block_id' => [ |
| 16 |
'type' => 'string', |
| 17 |
'default' => '', |
| 18 |
], |
| 19 |
'blockVersion' => array( |
| 20 |
'type' => 'number', |
| 21 |
'default' => '', |
| 22 |
), |
| 23 |
'enableSegments' => [ |
| 24 |
'type' => 'boolean', |
| 25 |
'default' => false, |
| 26 |
], |
| 27 |
'animation' => [ |
| 28 |
'type' => 'boolean', |
| 29 |
'default' => false, |
| 30 |
], |
| 31 |
'showIconInButton' => [ |
| 32 |
'type' => 'boolean', |
| 33 |
'default' => true, |
| 34 |
], |
| 35 |
'showTextInButton' => [ |
| 36 |
'type' => 'boolean', |
| 37 |
'default' => true, |
| 38 |
], |
| 39 |
'itemTitle' => [ |
| 40 |
'type' => 'string', |
| 41 |
'default' => 'Demo item title', |
| 42 |
], |
| 43 |
'itemText' => [ |
| 44 |
'type' => 'string', |
| 45 |
'default' => 'Demo item text', |
| 46 |
], |
| 47 |
'itemTrigger' => [ |
| 48 |
'type' => 'string', |
| 49 |
'default' => 'click', |
| 50 |
], |
| 51 |
'animationSpeed' => [ |
| 52 |
'type' => 'number', |
| 53 |
'default' => 20, |
| 54 |
], |
| 55 |
'selectedItemNumber' => [ |
| 56 |
'type' => 'number', |
| 57 |
'default' => 1, |
| 58 |
], |
| 59 |
'layoutShowTitle' => [ |
| 60 |
'type' => 'boolean', |
| 61 |
'default' => true, |
| 62 |
], |
| 63 |
'layoutShowText' => [ |
| 64 |
'type' => 'boolean', |
| 65 |
'default' => true, |
| 66 |
], |
| 67 |
'layoutShowImage' => [ |
| 68 |
'type' => 'boolean', |
| 69 |
'default' => false, |
| 70 |
], |
| 71 |
'layoutImagePosition' => [ |
| 72 |
'type' => 'string', |
| 73 |
'default' => 'bottom', |
| 74 |
], |
| 75 |
'layoutImageType' => [ |
| 76 |
'type' => 'string', |
| 77 |
'default' => 'bottom', |
| 78 |
], |
| 79 |
|
| 80 |
'iconColor' => [ |
| 81 |
'type' => 'string', |
| 82 |
'default' => '#000000', |
| 83 |
], |
| 84 |
'itemLists' => [ |
| 85 |
'type' => 'array', |
| 86 |
'default' => [ |
| 87 |
[ |
| 88 |
'id' => 0, |
| 89 |
'isOpen' => false, |
| 90 |
'link' => [ |
| 91 |
'linkDestination' => '', |
| 92 |
'href' => '', |
| 93 |
'lightbox' => '', |
| 94 |
'linkTarget' => '', |
| 95 |
'rel' => '', |
| 96 |
'noFollow' => '', |
| 97 |
'keyValue' => '', |
| 98 |
'linkClass' => '', |
| 99 |
], |
| 100 |
'iconTitle' => 'Title', |
| 101 |
'iconTitleColor' => '', |
| 102 |
'iconColor' => '', |
| 103 |
'buttonBgColor' => '', |
| 104 |
'title' => 'Info Title', |
| 105 |
'titleColor' => '', |
| 106 |
'dividerType' => '', |
| 107 |
'dividerColor' => '', |
| 108 |
'description' => 'Info Description', |
| 109 |
'descriptionColor' => '', |
| 110 |
'backgroundImage' => '', |
| 111 |
'selectedImageSize' => 40, |
| 112 |
'itemButtonTransition' => 10, |
| 113 |
|
| 114 |
|
| 115 |
], |
| 116 |
], |
| 117 |
], |
| 118 |
|
| 119 |
'listIconsClasses' => [ |
| 120 |
'type' => 'array', |
| 121 |
'default' => [], |
| 122 |
], |
| 123 |
'listIcons' => [ |
| 124 |
'type' => 'array', |
| 125 |
'default' => [] |
| 126 |
], |
| 127 |
'iconType' => [ |
| 128 |
'type' => 'string', |
| 129 |
'default' => 'default', |
| 130 |
], |
| 131 |
'iconShape' => [ |
| 132 |
'type' => 'string', |
| 133 |
'default' => 'circle', |
| 134 |
], |
| 135 |
'iconBackground' => [ |
| 136 |
'type' => 'boolean', |
| 137 |
'default' => false, |
| 138 |
], |
| 139 |
'iconBackgroundColor' => [ |
| 140 |
'type' => 'string', |
| 141 |
'default' => '', |
| 142 |
], |
| 143 |
'textColor' => [ |
| 144 |
'type' => 'string', |
| 145 |
'default' => '#000000', |
| 146 |
], |
| 147 |
'titleColor' => [ |
| 148 |
'type' => 'string', |
| 149 |
'default' => '#000000', |
| 150 |
], |
| 151 |
|
| 152 |
'divider' => [ |
| 153 |
'type' => 'boolean', |
| 154 |
'default' => true, |
| 155 |
], |
| 156 |
'dividerPatternUrl' => [ |
| 157 |
'type' => 'string', |
| 158 |
'default' => 'solid', |
| 159 |
], |
| 160 |
'borderColor' => [ |
| 161 |
'type' => 'string', |
| 162 |
'default' => '#000000', |
| 163 |
], |
| 164 |
'layoutColor' => [ |
| 165 |
'type' => 'string', |
| 166 |
'default' => '#eddfdf', |
| 167 |
], |
| 168 |
'itemColor' => [ |
| 169 |
'type' => 'string', |
| 170 |
'default' => '#000000', |
| 171 |
], |
| 172 |
'defaultImg' => [ |
| 173 |
'type' => 'string', |
| 174 |
'default' => '', |
| 175 |
], |
| 176 |
'itemButtonColor' => [ |
| 177 |
'type' => 'string', |
| 178 |
'default' => '#c3b021', |
| 179 |
], |
| 180 |
]; |
| 181 |
|
| 182 |
$attributes = array_merge( |
| 183 |
$attributes, |
| 184 |
Border::get_attribute( 'circleBorder', true ), |
| 185 |
Border::get_attribute( 'layoutBorder', true ), |
| 186 |
Dimensions::get_attribute( 'circlePadding', true ), |
| 187 |
Dimensions::get_attribute( 'layoutPadding', true ), |
| 188 |
BoxShadow::get_attribute( 'circleBoxShadow', true ), |
| 189 |
BoxShadow::get_attribute( 'layoutBoxShadow', true ), |
| 190 |
Alignment::get_attribute( 'alignment', true, [ 'value' => 'center' ] ), |
| 191 |
Dimensions::get_attribute( 'padding', false ), |
| 192 |
Dimensions::get_attribute( 'segMargin', false ), |
| 193 |
Border::get_attribute( 'border', true ), |
| 194 |
Typography::get_attribute( 'itemTypography', true ), |
| 195 |
Typography::get_attribute( 'titleTypography', true ), |
| 196 |
Typography::get_attribute( 'textTypography', true ), |
| 197 |
|
| 198 |
Range::get_attribute([ |
| 199 |
'attributeName' => 'iconSize', |
| 200 |
'attributeObjectKey' => 'value', |
| 201 |
'isResponsive' => true, |
| 202 |
'defaultValue' => 20, |
| 203 |
'hasUnit' => true, |
| 204 |
'unitDefaultValue' => 'px', |
| 205 |
]), |
| 206 |
|
| 207 |
Range::get_attribute([ |
| 208 |
'attributeName' => 'innerCircleSize', |
| 209 |
'attributeObjectKey' => 'value', |
| 210 |
'isResponsive' => true, |
| 211 |
'defaultValue' => 300, |
| 212 |
'defaultValueTablet' => 260, |
| 213 |
'defaultValueMobile' => 150, |
| 214 |
|
| 215 |
]), |
| 216 |
Range::get_attribute([ |
| 217 |
'attributeName' => 'itemButtonSize', |
| 218 |
'attributeObjectKey' => 'value', |
| 219 |
'isResponsive' => true, |
| 220 |
'defaultValue' => 150, |
| 221 |
'defaultValueTablet' => 120, |
| 222 |
'defaultValueMobile' => 80, |
| 223 |
|
| 224 |
]), |
| 225 |
Range::get_attribute([ |
| 226 |
'attributeName' => 'itemPosition', |
| 227 |
'attributeObjectKey' => 'value', |
| 228 |
'isResponsive' => true, |
| 229 |
'defaultValue' => 50, |
| 230 |
'defaultValueTablet' => 30, |
| 231 |
'defaultValueMobile' => 20, |
| 232 |
|
| 233 |
]), |
| 234 |
Range::get_attribute([ |
| 235 |
'attributeName' => 'circleSize', |
| 236 |
'attributeObjectKey' => 'value', |
| 237 |
'isResponsive' => true, |
| 238 |
'defaultValue' => 450, |
| 239 |
'defaultValueTablet' => 350, |
| 240 |
'defaultValueMobile' => 250, |
| 241 |
]), |
| 242 |
Range::get_attribute([ |
| 243 |
'attributeName' => 'dividerWidth', |
| 244 |
'attributeObjectKey' => 'value', |
| 245 |
'isResponsive' => true, |
| 246 |
'defaultValue' => 100, |
| 247 |
'hasUnit' => true, |
| 248 |
'unitDefaultValue' => 'px', |
| 249 |
]), |
| 250 |
Range::get_attribute([ |
| 251 |
'attributeName' => 'itemSpacing', |
| 252 |
'attributeObjectKey' => 'value', |
| 253 |
'isResponsive' => true, |
| 254 |
'defaultValue' => 1, |
| 255 |
'hasUnit' => true, |
| 256 |
'unitDefaultValue' => 'px', |
| 257 |
]), |
| 258 |
Range::get_attribute([ |
| 259 |
'attributeName' => 'imgRadius', |
| 260 |
'attributeObjectKey' => 'value', |
| 261 |
'isResponsive' => true, |
| 262 |
'defaultValue' => 100, |
| 263 |
'hasUnit' => true, |
| 264 |
'unitDefaultValue' => 'px', |
| 265 |
]), |
| 266 |
Range::get_attribute([ |
| 267 |
'attributeName' => 'imgWidth', |
| 268 |
'attributeObjectKey' => 'value', |
| 269 |
'isResponsive' => true, |
| 270 |
'defaultValue' => 100, |
| 271 |
'hasUnit' => true, |
| 272 |
'unitDefaultValue' => 'px', |
| 273 |
]), |
| 274 |
Range::get_attribute([ |
| 275 |
'attributeName' => 'imgHeight', |
| 276 |
'attributeObjectKey' => 'value', |
| 277 |
'isResponsive' => true, |
| 278 |
'defaultValue' => 100, |
| 279 |
'hasUnit' => true, |
| 280 |
'unitDefaultValue' => 'px', |
| 281 |
]), |
| 282 |
Range::get_attribute([ |
| 283 |
'attributeName' => 'dividerWeight', |
| 284 |
'attributeObjectKey' => 'value', |
| 285 |
'isResponsive' => true, |
| 286 |
'defaultValue' => 5, |
| 287 |
'hasUnit' => true, |
| 288 |
'unitDefaultValue' => 'px', |
| 289 |
]), |
| 290 |
); |
| 291 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 292 |
|
| 293 |
|