| 1 |
<?php |
| 2 |
|
| 3 |
|
| 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 |
'background' => [ |
| 20 |
'type' => 'string', |
| 21 |
'default' => 'white' |
| 22 |
], |
| 23 |
'direction' => [ |
| 24 |
'type' => 'string', |
| 25 |
'default' => 'column', |
| 26 |
], |
| 27 |
'directionTablet' => [ |
| 28 |
'type' => 'string', |
| 29 |
'default' => '', |
| 30 |
], |
| 31 |
'directionMobile' => [ |
| 32 |
'type' => 'string', |
| 33 |
'default' => '', |
| 34 |
], |
| 35 |
'justify' => [ |
| 36 |
'type' => 'string', |
| 37 |
'default' => '', |
| 38 |
], |
| 39 |
'justifyTablet' => [ |
| 40 |
'type' => 'string', |
| 41 |
'default' => '', |
| 42 |
], |
| 43 |
'justifyMobile' => [ |
| 44 |
'type' => 'string', |
| 45 |
'default' => '', |
| 46 |
], |
| 47 |
'align' => [ |
| 48 |
'type' => 'string', |
| 49 |
'default' => '', |
| 50 |
], |
| 51 |
'alignTablet' => [ |
| 52 |
'type' => 'string', |
| 53 |
'default' => '', |
| 54 |
], |
| 55 |
'alignMobile' => [ |
| 56 |
'type' => 'string', |
| 57 |
'default' => '', |
| 58 |
], |
| 59 |
'menuItemTextColor' => [ |
| 60 |
'type' => 'string', |
| 61 |
'default' => '' |
| 62 |
], |
| 63 |
'menuItemTextColorH' => [ |
| 64 |
'type' => 'string', |
| 65 |
'default' => '', |
| 66 |
], |
| 67 |
'menuItemBackground' => [ |
| 68 |
'type' => 'string', |
| 69 |
'default' => '', |
| 70 |
], |
| 71 |
'menuItemBackgroundH' => [ |
| 72 |
'type' => 'string', |
| 73 |
'default' => '', |
| 74 |
], |
| 75 |
'menuItemTransition' => [ |
| 76 |
'type' => 'number', |
| 77 |
'default' => 0 |
| 78 |
], |
| 79 |
'menuItemAlign' => [ |
| 80 |
'type' => 'string', |
| 81 |
'default' => '', |
| 82 |
'copyStyle' => true, |
| 83 |
], |
| 84 |
'menuItemAlignTablet' => [ |
| 85 |
'type' => 'string', |
| 86 |
'default' => '', |
| 87 |
'copyStyle' => true, |
| 88 |
], |
| 89 |
'menuItemAlignMobile' => [ |
| 90 |
'type' => 'string', |
| 91 |
'default' => '', |
| 92 |
'copyStyle' => true, |
| 93 |
], |
| 94 |
'menuItemDirection' => [ |
| 95 |
'type' => 'string', |
| 96 |
'default' => 'row', |
| 97 |
'copyStyle' => true, |
| 98 |
], |
| 99 |
'menuItemDirectionTablet' => [ |
| 100 |
'type' => 'string', |
| 101 |
'default' => '', |
| 102 |
'copyStyle' => true, |
| 103 |
], |
| 104 |
'menuItemDirectionMobile' => [ |
| 105 |
'type' => 'string', |
| 106 |
'default' => '', |
| 107 |
'copyStyle' => true, |
| 108 |
], |
| 109 |
'menuItemJustify' => [ |
| 110 |
'type' => 'string', |
| 111 |
'default' => 'space-between', |
| 112 |
'copyStyle' => true, |
| 113 |
], |
| 114 |
'menuItemJustifyTablet' => [ |
| 115 |
'type' => 'string', |
| 116 |
'default' => 'space-between', |
| 117 |
'copyStyle' => true, |
| 118 |
], |
| 119 |
'menuItemJustifyMobile' => [ |
| 120 |
'type' => 'string', |
| 121 |
'default' => 'space-between', |
| 122 |
'copyStyle' => true, |
| 123 |
], |
| 124 |
|
| 125 |
]; |
| 126 |
|
| 127 |
$attributes = array_merge( |
| 128 |
$attributes, |
| 129 |
ButtonGroup::get_attribute( 'menuItemJustification', true, [ |
| 130 |
'value' => 'space-between', |
| 131 |
] ), |
| 132 |
BoxShadow::get_attribute( 'boxShadow', true ), |
| 133 |
Dimensions::get_attribute( 'padding', false ), |
| 134 |
Dimensions::get_attribute( 'menuItemPadding', false ), |
| 135 |
Dimensions::get_attribute( 'menuItemMargin', false ), |
| 136 |
Border::get_attribute( 'menuItemBorder', true ), |
| 137 |
Border::get_attribute( 'border', true ), |
| 138 |
Typography::get_attribute( 'menuItemTypography', true ), |
| 139 |
Range::get_attribute([ |
| 140 |
'attributeName' => 'width', |
| 141 |
'attributeObjectKey' => 'value', |
| 142 |
'isResponsive' => true, |
| 143 |
'hasUnit' => true, |
| 144 |
'unitDefaultValue' => 'px', |
| 145 |
]), |
| 146 |
Range::get_attribute([ |
| 147 |
'attributeName' => 'positionX', |
| 148 |
'attributeObjectKey' => 'value', |
| 149 |
'isResponsive' => true, |
| 150 |
'defaultValue' => 0, |
| 151 |
|
| 152 |
]), |
| 153 |
Range::get_attribute([ |
| 154 |
'attributeName' => 'positionY', |
| 155 |
'attributeObjectKey' => 'value', |
| 156 |
'isResponsive' => true, |
| 157 |
'defaultValue' => 0, |
| 158 |
]), |
| 159 |
); |
| 160 |
return $attributes; |
| 161 |
|