| 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 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; |
| 11 |
} |
| 12 |
|
| 13 |
$attributes = [ |
| 14 |
'block_id' => [ |
| 15 |
'type' => 'string', |
| 16 |
'default' => '', |
| 17 |
], |
| 18 |
'blockVersion' => array( |
| 19 |
'type' => 'number', |
| 20 |
'default' => '', |
| 21 |
), |
| 22 |
'alignment' => [ |
| 23 |
'type' => 'string', |
| 24 |
'default' => 'left' |
| 25 |
], |
| 26 |
|
| 27 |
'menuItemTextColor' => [ |
| 28 |
'type' => 'string', |
| 29 |
'default' => '' |
| 30 |
], |
| 31 |
'menuItemTextColorH' => [ |
| 32 |
'type' => 'string', |
| 33 |
'default' => '#000000', |
| 34 |
], |
| 35 |
'menuItemBackground' => [ |
| 36 |
'type' => 'string', |
| 37 |
'default' => '', |
| 38 |
], |
| 39 |
'menuItemBackgroundH' => [ |
| 40 |
'type' => 'string', |
| 41 |
'default' => '', |
| 42 |
], |
| 43 |
'menuItemTransition' => [ |
| 44 |
'type' => 'number', |
| 45 |
'default' => 0 |
| 46 |
], |
| 47 |
'menuItemDisplay' => [ |
| 48 |
'type' => 'string', |
| 49 |
'default' => 'inline', |
| 50 |
], |
| 51 |
'hamburgerAlignment' => [ |
| 52 |
'type' => 'string', |
| 53 |
'default' => 'left' |
| 54 |
], |
| 55 |
'hamburgerColor' => [ |
| 56 |
'type' => 'string', |
| 57 |
'default' => 'black' |
| 58 |
], |
| 59 |
'hamburgerBackground' => [ |
| 60 |
'type' => 'string', |
| 61 |
'default' => '' |
| 62 |
], |
| 63 |
'sideBarMenuDevice' => [ |
| 64 |
'type' => 'string', |
| 65 |
'default' => 'mobile' |
| 66 |
], |
| 67 |
'menuResponsiveBackground' => [ |
| 68 |
'type' => 'string', |
| 69 |
'default' => '' |
| 70 |
], |
| 71 |
'menuResponsiveTextColor' => [ |
| 72 |
'type' => 'string', |
| 73 |
'default' => '' |
| 74 |
], |
| 75 |
'subMenuResponsiveColor' => [ |
| 76 |
'type' => 'string', |
| 77 |
'default' => '' |
| 78 |
], |
| 79 |
'subMenuResponsiveBg' => [ |
| 80 |
'type' => 'string', |
| 81 |
'default' => '' |
| 82 |
], |
| 83 |
'subMenuItemTextColor' => [ |
| 84 |
'type' => 'string', |
| 85 |
'default' => '', |
| 86 |
], |
| 87 |
'subMenuItemBackground' => [ |
| 88 |
'type' => 'string', |
| 89 |
'default' => '', |
| 90 |
], |
| 91 |
'subMenuItemTextColorH' => [ |
| 92 |
'type' => 'string', |
| 93 |
'default' => '', |
| 94 |
], |
| 95 |
'subMenuItemBackgroundH' => [ |
| 96 |
'type' => 'string', |
| 97 |
'default' => '', |
| 98 |
], |
| 99 |
'subMenuItemTransition' => [ |
| 100 |
'type' => 'number', |
| 101 |
'default' => 0, |
| 102 |
], |
| 103 |
'menuActveColor' => [ |
| 104 |
'type' => 'string', |
| 105 |
'default' => '', |
| 106 |
], |
| 107 |
'menuActveColorBg' => [ |
| 108 |
'type' => 'string', |
| 109 |
'default' => '', |
| 110 |
], |
| 111 |
|
| 112 |
]; |
| 113 |
|
| 114 |
$attributes = array_merge( |
| 115 |
$attributes, |
| 116 |
Dimensions::get_attribute( 'padding', false ), |
| 117 |
Dimensions::get_attribute( 'hamburgerPadding', false ), |
| 118 |
Dimensions::get_attribute( 'menuItemPadding', false ), |
| 119 |
Dimensions::get_attribute( 'menuItemMargin', false ), |
| 120 |
Border::get_attribute( 'menuItemBorder', true ), |
| 121 |
Border::get_attribute( 'hamburgerBorder', true ), |
| 122 |
Typography::get_attribute( 'menuItemTypography', true ), |
| 123 |
// sub menu style |
| 124 |
BoxShadow::get_attribute( 'subMenuBoxShadow', true ), |
| 125 |
Dimensions::get_attribute( 'subMenuPadding', false ), |
| 126 |
Border::get_attribute( 'subMenuBorder', true ), |
| 127 |
Range::get_attribute( [ |
| 128 |
'attributeName' => 'hamburgerHeight', |
| 129 |
'isResponsive' => false, |
| 130 |
'defaultValue' => 3, |
| 131 |
'attributeObjectKey' => 'value', |
| 132 |
'hasUnit' => true, |
| 133 |
'unitDefaultValue' => 'px', |
| 134 |
]), |
| 135 |
Range::get_attribute( [ |
| 136 |
'attributeName' => 'hamburgerWidth', |
| 137 |
'isResponsive' => false, |
| 138 |
'defaultValue' => 30, |
| 139 |
'attributeObjectKey' => 'value', |
| 140 |
'hasUnit' => true, |
| 141 |
'unitDefaultValue' => 'px', |
| 142 |
]), |
| 143 |
Range::get_attribute([ |
| 144 |
'attributeName' => 'subMenuWidth', |
| 145 |
'attributeObjectKey' => 'value', |
| 146 |
'isResponsive' => true, |
| 147 |
'defaultValue' => 250, |
| 148 |
'hasUnit' => true, |
| 149 |
'unitDefaultValue' => 'px', |
| 150 |
]), |
| 151 |
); |
| 152 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 153 |
|
| 154 |
|