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

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

168 lines 4.7 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\Border;
5 use ABlocks\Controls\Dimensions;
6 use ABlocks\Controls\Typography;
7 use ABlocks\Controls\CssFilter;
8 use ABlocks\Controls\BoxShadow;
9 use ABlocks\Controls\Range;
10
11 $attributes = [
12 'block_id' => [
13 'type' => 'string',
14 'default' => '',
15 ],
16 'imgId' => [
17 'type' => 'string',
18 'default' => '',
19 ],
20 'imgIdTablet' => [
21 'type' => 'string',
22 'default' => '',
23 ],
24 'imgIdMobile' => [
25 'type' => 'string',
26 'default' => '',
27 ],
28 'imgUrl' => [
29 'type' => 'string',
30 'source' => 'attribute',
31 'selector' => '.ablocks-image',
32 'attribute' => 'srcset',
33 ],
34 'imgUrlTablet' => [
35 'type' => 'string',
36 'source' => 'attribute',
37 'selector' => '.ablocks-image-tablet',
38 'attribute' => 'srcset',
39 ],
40 'imgUrlMobile' => [
41 'type' => 'string',
42 'source' => 'attribute',
43 'selector' => '.ablocks-image-mobile',
44 'attribute' => 'src',
45 ],
46 'imgSize' => [
47 'type' => 'object',
48 'default' => [
49 'value' => 'large',
50 'valueTablet' => '',
51 'valueMobile' => '',
52 ],
53 ],
54 'aspectRatio' => [
55 'type' => 'object',
56 'default' => [
57 'value' => 'original',
58 'valueTablet' => '',
59 'valueMobile' => '',
60 ],
61 ],
62 'widthHeightWidget' => [
63 'type' => 'object',
64 'default' => [
65 'imgNaturalWidth' => '',
66 'imgNaturalWidthTablet' => '',
67 'imgNaturalWidthMobile' => '',
68 'imgNaturalHeight' => '',
69 'imgNaturalHeightTablet' => '',
70 'imgNaturalHeightMobile' => '',
71 'width' => '',
72 'widthTablet' => '',
73 'widthMobile' => '',
74 'height' => '',
75 'heightTablet' => '',
76 'heightMobile' => '',
77 'customHeight' => false,
78 'customHeightTablet' => false,
79 'customHeightMobile' => false,
80 ],
81 ],
82 'objectFit' => [
83 'type' => 'object',
84 'default' => [
85 'value' => 'default',
86 'valueTablet' => '',
87 'valueMobile' => '',
88 ],
89 ],
90 'imgCaption' => [
91 'type' => 'boolean',
92 'default' => false,
93 ],
94 'position' => [
95 'type' => 'string',
96 'default' => 'below',
97 ],
98 'caption' => [
99 'type' => 'string',
100 'default' => '',
101 ],
102 'captionBackground' => [
103 'type' => 'string',
104 'default' => '',
105 ],
106 'captionColor' => [
107 'type' => 'string',
108 'default' => '',
109 ],
110 'imgLink' => [
111 'type' => 'object',
112 'default' => [
113 'linkDestination' => '',
114 'href' => '',
115 'lightbox' => '',
116 'linkTarget' => '',
117 'rel' => '',
118 'linkClass' => '',
119 ],
120 ],
121 'imgAltText' => [
122 'type' => 'string',
123 'default' => '',
124 ],
125 'onHoverImg' => [
126 'type' => 'string',
127 'default' => 'static',
128 ],
129 'imgTitle' => [
130 'type' => 'string',
131 'default' => '',
132 ],
133 ];
134
135 $attributes = array_merge(
136 $attributes,
137 CssFilter::get_attribute( 'cssFilter' ),
138 CssFilter::get_attribute( 'cssHoverFilter' ),
139 BoxShadow::get_attribute( 'boxShadow' ),
140 Alignment::get_attribute( 'alignment', true, [ 'value' => 'left' ] ),
141 Alignment::get_attribute( 'captionAlignment', true, [ 'value' => 'left' ] ),
142 Typography::get_attribute( 'captionTypography', true ),
143 Alignment::get_attribute( 'captionPosition', true ),
144 Dimensions::get_attribute( 'captionPadding', true ),
145 Border::get_attribute( 'captionBorder', true ),
146 Border::get_attribute( 'border', true ),
147 Dimensions::get_attribute( 'padding', true ),
148 Range::get_attribute([
149 'attributeName' => 'opacity',
150 'defaultValue' => 1
151 ]),
152 Range::get_attribute([
153 'attributeName' => 'opacityH',
154 'defaultValue' => '',
155 ]),
156 Range::get_attribute([
157 'attributeName' => 'transitionDuration',
158 'defaultValue' => 0.5,
159 ]),
160 Range::get_attribute([
161 'attributeName' => 'filterTransitionDuration',
162 'defaultValue' => 0.5,
163 ]),
164 );
165
166 return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
167
168