| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
use ABlocks\Controls\Alignment; |
| 8 |
use ABlocks\Controls\Border; |
| 9 |
use ABlocks\Controls\Dimensions; |
| 10 |
use ABlocks\Controls\Typography; |
| 11 |
use ABlocks\Controls\CssFilter; |
| 12 |
use ABlocks\Controls\BoxShadow; |
| 13 |
use ABlocks\Controls\Range; |
| 14 |
use ABlocks\Controls\LinkControl; |
| 15 |
use ABlocks\Controls\Link; |
| 16 |
|
| 17 |
$attributes = [ |
| 18 |
'block_id' => [ |
| 19 |
'type' => 'string', |
| 20 |
'default' => '', |
| 21 |
], |
| 22 |
'imgId' => [ |
| 23 |
'type' => 'string', |
| 24 |
'default' => '', |
| 25 |
], |
| 26 |
'imgIdTablet' => [ |
| 27 |
'type' => 'string', |
| 28 |
'default' => '', |
| 29 |
], |
| 30 |
'imgIdMobile' => [ |
| 31 |
'type' => 'string', |
| 32 |
'default' => '', |
| 33 |
], |
| 34 |
'imgUrl' => [ |
| 35 |
'type' => 'string', |
| 36 |
'source' => 'attribute', |
| 37 |
'selector' => '.ablocks-image', |
| 38 |
'attribute' => 'srcset', |
| 39 |
], |
| 40 |
'imgUrlTablet' => [ |
| 41 |
'type' => 'string', |
| 42 |
'source' => 'attribute', |
| 43 |
'selector' => '.ablocks-image-tablet', |
| 44 |
'attribute' => 'srcset', |
| 45 |
], |
| 46 |
'imgUrlMobile' => [ |
| 47 |
'type' => 'string', |
| 48 |
'source' => 'attribute', |
| 49 |
'selector' => '.ablocks-image-mobile', |
| 50 |
'attribute' => 'src', |
| 51 |
], |
| 52 |
'imgSize' => [ |
| 53 |
'type' => 'object', |
| 54 |
'default' => [ |
| 55 |
'value' => 'large', |
| 56 |
'valueTablet' => '', |
| 57 |
'valueMobile' => '', |
| 58 |
], |
| 59 |
], |
| 60 |
'aspectRatio' => [ |
| 61 |
'type' => 'object', |
| 62 |
'default' => [ |
| 63 |
'value' => 'original', |
| 64 |
'valueTablet' => '', |
| 65 |
'valueMobile' => '', |
| 66 |
], |
| 67 |
], |
| 68 |
'imageScrollOption' => [ |
| 69 |
'type' => 'object', |
| 70 |
'default' => [ |
| 71 |
'value' => 'mouse-scroll' |
| 72 |
], |
| 73 |
], |
| 74 |
'imageDataAttribute' => [ |
| 75 |
'type' => 'object' |
| 76 |
], |
| 77 |
'widthHeightWidget' => [ |
| 78 |
'type' => 'object', |
| 79 |
'default' => [ |
| 80 |
'imgNaturalWidth' => '', |
| 81 |
'imgNaturalWidthTablet' => '', |
| 82 |
'imgNaturalWidthMobile' => '', |
| 83 |
'imgNaturalHeight' => '', |
| 84 |
'imgNaturalHeightTablet' => '', |
| 85 |
'imgNaturalHeightMobile' => '', |
| 86 |
'width' => '', |
| 87 |
'widthTablet' => '', |
| 88 |
'widthMobile' => '', |
| 89 |
'height' => '', |
| 90 |
'heightTablet' => '', |
| 91 |
'heightMobile' => '', |
| 92 |
'customHeight' => false, |
| 93 |
'customHeightTablet' => false, |
| 94 |
'customHeightMobile' => false, |
| 95 |
], |
| 96 |
], |
| 97 |
'objectFit' => [ |
| 98 |
'type' => 'object', |
| 99 |
'default' => [ |
| 100 |
'value' => 'default', |
| 101 |
'valueTablet' => '', |
| 102 |
'valueMobile' => '', |
| 103 |
], |
| 104 |
], |
| 105 |
'position' => [ |
| 106 |
'type' => 'string', |
| 107 |
'default' => 'below', |
| 108 |
], |
| 109 |
'imgAltText' => [ |
| 110 |
'type' => 'string', |
| 111 |
'default' => '', |
| 112 |
], |
| 113 |
'imgTitle' => [ |
| 114 |
'type' => 'string', |
| 115 |
'default' => '', |
| 116 |
], |
| 117 |
'showNotice' => [ |
| 118 |
'type' => 'boolean', |
| 119 |
'default' => false |
| 120 |
], |
| 121 |
'transitionTime' => [ |
| 122 |
'type' => 'number', |
| 123 |
'default' => 3 |
| 124 |
], |
| 125 |
'showOverlay' => [ |
| 126 |
'type' => 'boolean', |
| 127 |
'default' => false |
| 128 |
], |
| 129 |
'showIcon' => [ |
| 130 |
'type' => 'boolean', |
| 131 |
'default' => false |
| 132 |
], |
| 133 |
'overlayColor' => [ |
| 134 |
'type' => 'string', |
| 135 |
'default' => '#0202024C' |
| 136 |
], |
| 137 |
'iconColor' => [ |
| 138 |
'type' => 'string', |
| 139 |
'default' => '' |
| 140 |
], |
| 141 |
]; |
| 142 |
|
| 143 |
$attributes = array_merge( |
| 144 |
$attributes, |
| 145 |
CssFilter::get_attribute( 'cssFilter' ), |
| 146 |
CssFilter::get_attribute( 'cssHoverFilter' ), |
| 147 |
Alignment::get_attribute( 'alignment', true, [ 'value' => 'left' ] ), |
| 148 |
Border::get_attribute( 'border', true ), |
| 149 |
Dimensions::get_attribute( 'padding', true ), |
| 150 |
Link::get_attribute( 'link' ), |
| 151 |
Range::get_attribute([ |
| 152 |
'attributeName' => 'opacity', |
| 153 |
'defaultValue' => 1 |
| 154 |
]), |
| 155 |
Range::get_attribute([ |
| 156 |
'attributeName' => 'opacityH', |
| 157 |
'defaultValue' => '', |
| 158 |
]), |
| 159 |
Range::get_attribute([ |
| 160 |
'attributeName' => 'transitionDuration', |
| 161 |
'defaultValue' => 0.5, |
| 162 |
]), |
| 163 |
Range::get_attribute([ |
| 164 |
'attributeName' => 'filterTransitionDuration', |
| 165 |
'defaultValue' => 0.5, |
| 166 |
]), |
| 167 |
Range::get_attribute( [ |
| 168 |
'attributeName' => 'iconFontSize', |
| 169 |
'attributeObjectKey' => 'value', |
| 170 |
'isResponsive' => true, |
| 171 |
'defaultValue' => 36, |
| 172 |
'defaultValueTablet' => 24, |
| 173 |
'defaultValueMobile' => 16, |
| 174 |
'hasUnit' => true, |
| 175 |
'unitDefaultValue' => 'px', |
| 176 |
] ), |
| 177 |
Range::get_attribute( [ |
| 178 |
'attributeName' => 'scrollHeight', |
| 179 |
'attributeObjectKey' => 'value', |
| 180 |
'isResponsive' => true, |
| 181 |
'defaultValue' => 200, |
| 182 |
] ), |
| 183 |
Range::get_attribute( [ |
| 184 |
'attributeName' => 'scrollWidth', |
| 185 |
'attributeObjectKey' => 'value', |
| 186 |
'isResponsive' => true, |
| 187 |
'defaultValue' => 100, |
| 188 |
'hasUnit' => true, |
| 189 |
'unitDefaultValue' => '%', |
| 190 |
] ), |
| 191 |
); |
| 192 |
|
| 193 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 194 |
|
| 195 |
|