| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
use ABlocks\Controls\Range; |
| 8 |
use ABlocks\Controls\Dimensions; |
| 9 |
use ABlocks\Controls\Background; |
| 10 |
use ABlocks\Controls\BoxShadow; |
| 11 |
use ABlocks\Controls\Border; |
| 12 |
use ABlocks\Components\ButtonGroup; |
| 13 |
|
| 14 |
|
| 15 |
$attributes = [ |
| 16 |
'block_id' => array( |
| 17 |
'type' => 'string', |
| 18 |
'default' => '', |
| 19 |
), |
| 20 |
'blockVersion' => array( |
| 21 |
'type' => 'number', |
| 22 |
'default' => '', |
| 23 |
), |
| 24 |
'popupOnTop' => array( |
| 25 |
'type' => 'boolean', |
| 26 |
'default' => false, |
| 27 |
), |
| 28 |
'disableCloseButton' => array( |
| 29 |
'type' => 'boolean', |
| 30 |
'default' => false, |
| 31 |
), |
| 32 |
'useHoverTrigger' => array( |
| 33 |
'type' => 'boolean', |
| 34 |
'default' => false, |
| 35 |
), |
| 36 |
'enableAutoTriggerTimer' => array( |
| 37 |
'type' => 'boolean', |
| 38 |
'default' => false, |
| 39 |
), |
| 40 |
'showAutoOnce' => array( |
| 41 |
'type' => 'boolean', |
| 42 |
'default' => false, |
| 43 |
), |
| 44 |
'showOnMouseOutOfWindow' => array( |
| 45 |
'type' => 'boolean', |
| 46 |
'default' => false, |
| 47 |
), |
| 48 |
'backdropColor' => array( |
| 49 |
'type' => 'string', |
| 50 |
'default' => '#000000b3', |
| 51 |
), |
| 52 |
'closeBtnBackgroundColor' => array( |
| 53 |
'type' => 'string', |
| 54 |
'default' => '', |
| 55 |
), |
| 56 |
'closeBtnColor' => array( |
| 57 |
'type' => 'string', |
| 58 |
'default' => '', |
| 59 |
), |
| 60 |
'noTrigger' => array( |
| 61 |
'type' => 'boolean', |
| 62 |
'default' => false, |
| 63 |
), |
| 64 |
]; |
| 65 |
|
| 66 |
$attributes = array_merge( |
| 67 |
$attributes, |
| 68 |
ButtonGroup::get_attribute( 'openPanel', false, [ |
| 69 |
'value' => 'close', |
| 70 |
] ), |
| 71 |
ButtonGroup::get_attribute( 'popupPosition', false, [ |
| 72 |
'value' => 'popup', |
| 73 |
] ), |
| 74 |
ButtonGroup::get_attribute( 'panelBlockPosition', false, [ |
| 75 |
'value' => 'bottom', |
| 76 |
] ), |
| 77 |
ButtonGroup::get_attribute( 'panelContentPosition', false, [ |
| 78 |
'value' => 'auto', |
| 79 |
] ), |
| 80 |
ButtonGroup::get_attribute( 'closePosition', false, [ |
| 81 |
'value' => 'right', |
| 82 |
] ), |
| 83 |
Range::get_attribute([ |
| 84 |
'attributeName' => 'popupTopOffset', |
| 85 |
'isResponsive' => false, |
| 86 |
'defaultValue' => 0, |
| 87 |
]), |
| 88 |
Range::get_attribute([ |
| 89 |
'attributeName' => 'panelWidth', |
| 90 |
'attributeObjectKey' => 'value', |
| 91 |
'isResponsive' => true, |
| 92 |
'defaultValue' => 50, |
| 93 |
'hasUnit' => true, |
| 94 |
'unitDefaultValue' => '%', |
| 95 |
]), |
| 96 |
Range::get_attribute([ |
| 97 |
'attributeName' => 'panelHeight', |
| 98 |
'attributeObjectKey' => 'value', |
| 99 |
'isResponsive' => true, |
| 100 |
'defaultValue' => 50, |
| 101 |
'hasUnit' => true, |
| 102 |
'unitDefaultValue' => '%', |
| 103 |
]), |
| 104 |
Range::get_attribute([ |
| 105 |
'attributeName' => 'autoTriggerTime', |
| 106 |
'isResponsive' => false, |
| 107 |
'defaultValue' => 0, |
| 108 |
]), |
| 109 |
Range::get_attribute([ |
| 110 |
'attributeName' => 'closeBtnTop', |
| 111 |
'isResponsive' => false, |
| 112 |
'defaultValue' => 5, |
| 113 |
'hasUnit' => false, |
| 114 |
]), |
| 115 |
Range::get_attribute([ |
| 116 |
'attributeName' => 'closeBtnSide', |
| 117 |
'isResponsive' => false, |
| 118 |
'defaultValue' => 5, |
| 119 |
'hasUnit' => false, |
| 120 |
]), |
| 121 |
Dimensions::get_attribute( 'panelPadding', true ), |
| 122 |
Background::get_attribute( 'panelBackground' ), |
| 123 |
Border::get_attribute( 'panelBorder', true ), |
| 124 |
BoxShadow::get_attribute( 'panelShadow', true ), |
| 125 |
); |
| 126 |
|
| 127 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 128 |
|