← All changes
|
includes/blocks/storeengine-product-summary/attributes.php
+132
-0
2.7.6
→
2.14.0
View file →
| @@ -1,0 +1,132 @@ | ||
| 1 | +<?php | |
| 2 | + | |
| 3 | +use ABlocks\Controls\Typography; | |
| 4 | +use ABlocks\Controls\Range; | |
| 5 | +use ABlocks\Controls\Dimensions; | |
| 6 | +use ABlocks\Controls\Border; | |
| 7 | +use ABlocks\Controls\BoxShadow; | |
| 8 | +use ABlocks\Controls\Alignment; | |
| 9 | + | |
| 10 | + | |
| 11 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | + exit; | |
| 13 | +} | |
| 14 | + | |
| 15 | +$attributes = [ | |
| 16 | + 'block_id' => [ | |
| 17 | + 'type' => 'string', | |
| 18 | + 'default' => '', | |
| 19 | + ], | |
| 20 | + 'blockVersion' => [ | |
| 21 | + 'type' => 'number', | |
| 22 | + 'default' => 2, | |
| 23 | + ], | |
| 24 | + 'product_id' => [ | |
| 25 | + 'type' => 'number', | |
| 26 | + 'default' => 0, | |
| 27 | + ], | |
| 28 | + 'isCustom' => [ | |
| 29 | + 'type' => 'boolean', | |
| 30 | + 'default' => false, | |
| 31 | + ], | |
| 32 | + 'titleColor' => [ | |
| 33 | + 'type' => 'string', | |
| 34 | + 'default' => '#111', | |
| 35 | + ], | |
| 36 | + 'titleColorH' => [ | |
| 37 | + 'type' => 'string', | |
| 38 | + 'default' => '#111', | |
| 39 | + ], | |
| 40 | + 'productPriceColor' => [ | |
| 41 | + 'type' => 'string', | |
| 42 | + 'default' => '#111', | |
| 43 | + ], | |
| 44 | + 'productPriceColorH' => [ | |
| 45 | + 'type' => 'string', | |
| 46 | + 'default' => '#111', | |
| 47 | + ], | |
| 48 | + 'inputTextColor' => [ | |
| 49 | + 'type' => 'string', | |
| 50 | + 'default' => '#111', | |
| 51 | + ], | |
| 52 | + 'inputTextColorH' => [ | |
| 53 | + 'type' => 'string', | |
| 54 | + 'default' => '#111', | |
| 55 | + ], | |
| 56 | + 'buttonBackground' => [ | |
| 57 | + 'type' => 'string', | |
| 58 | + 'default' => '#008DFF', | |
| 59 | + ], | |
| 60 | + 'buttonBackgroundH' => [ | |
| 61 | + 'type' => 'string', | |
| 62 | + 'default' => '#008DFF', | |
| 63 | + ], | |
| 64 | + 'buttonColor' => [ | |
| 65 | + 'type' => 'string', | |
| 66 | + 'default' => '#fff', | |
| 67 | + ], | |
| 68 | + 'buttonColorH' => [ | |
| 69 | + 'type' => 'string', | |
| 70 | + 'default' => '#fff', | |
| 71 | + ], | |
| 72 | + 'AddButtonColor' => [ | |
| 73 | + 'type' => 'string', | |
| 74 | + 'default' => '#111', | |
| 75 | + ], | |
| 76 | + 'AddButtonColorH' => [ | |
| 77 | + 'type' => 'string', | |
| 78 | + 'default' => '#111', | |
| 79 | + ], | |
| 80 | + 'AddButtonBackground' => [ | |
| 81 | + 'type' => 'string', | |
| 82 | + 'default' => '#fff', | |
| 83 | + ], | |
| 84 | + 'AddButtonBackgroundH' => [ | |
| 85 | + 'type' => 'string', | |
| 86 | + 'default' => '#fff', | |
| 87 | + ], | |
| 88 | +]; | |
| 89 | + | |
| 90 | +$attributes = array_merge( | |
| 91 | + $attributes, | |
| 92 | + Typography::get_attribute( 'titleTypography', true ), | |
| 93 | + Typography::get_attribute( 'ProductPriceTypography', true ), | |
| 94 | + Typography::get_attribute( 'inputTextTypography', true ), | |
| 95 | + Typography::get_attribute( 'btnTypography', true ), | |
| 96 | + Typography::get_attribute( 'AddBtnTypography', true ), | |
| 97 | + // BoxShadow::get_attribute( 'boxShadow', true ), | |
| 98 | + Dimensions::get_attribute( 'inputPadding', true ), | |
| 99 | + Border::get_attribute( 'inputBorder', true ), | |
| 100 | + Dimensions::get_attribute( 'buttonPadding', true ), | |
| 101 | + Border::get_attribute( 'buttonBorder', true ), | |
| 102 | + Dimensions::get_attribute( 'AddButtonPadding', true ), | |
| 103 | + Border::get_attribute( 'AddButtonBorder', true ), | |
| 104 | + // Alignment::get_attribute( 'buttonAlign', true, [ 'value' => 'left' ] ), | |
| 105 | + Range::get_attribute( [ | |
| 106 | + 'attributeName' => 'inputWidth', | |
| 107 | + 'attributeObjectKey' => 'value', | |
| 108 | + 'isResponsive' => true, | |
| 109 | + 'defaultValue' => 50, | |
| 110 | + 'hasUnit' => true, | |
| 111 | + 'unitDefaultValue' => 'px', | |
| 112 | + ]), | |
| 113 | + Range::get_attribute( [ | |
| 114 | + 'attributeName' => 'buttonWidth', | |
| 115 | + 'attributeObjectKey' => 'value', | |
| 116 | + 'isResponsive' => true, | |
| 117 | + 'defaultValue' => 100, | |
| 118 | + 'hasUnit' => true, | |
| 119 | + 'unitDefaultValue' => '%', | |
| 120 | + ]), | |
| 121 | + Range::get_attribute( [ | |
| 122 | + 'attributeName' => 'AddButtonWidth', | |
| 123 | + 'attributeObjectKey' => 'value', | |
| 124 | + 'isResponsive' => true, | |
| 125 | + 'defaultValue' => 100, | |
| 126 | + 'hasUnit' => true, | |
| 127 | + 'unitDefaultValue' => '%', | |
| 128 | + ]), | |
| 129 | +); | |
| 130 | + | |
| 131 | +return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); | |
| 132 | + | |