| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
use ABlocks\Controls\Alignment; |
| 8 |
use ABlocks\Controls\TextShadow; |
| 9 |
use ABlocks\Controls\TextStroke; |
| 10 |
use ABlocks\Controls\Typography; |
| 11 |
use ABlocks\Controls\Border; |
| 12 |
use ABlocks\Controls\Range; |
| 13 |
use ABlocks\Components\ButtonGroup; |
| 14 |
$attributes = [ |
| 15 |
'block_id' => [ |
| 16 |
'type' => 'string', |
| 17 |
], |
| 18 |
'blockVersion' => [ |
| 19 |
'type' => 'number', |
| 20 |
'default' => '', |
| 21 |
], |
| 22 |
'progressValue' => [ |
| 23 |
'type' => 'number', |
| 24 |
'default' => 100, |
| 25 |
], |
| 26 |
'maxValue' => [ |
| 27 |
'type' => 'number', |
| 28 |
'default' => 100, |
| 29 |
], |
| 30 |
'barColor' => [ |
| 31 |
'type' => 'string', |
| 32 |
'default' => 'black', |
| 33 |
], |
| 34 |
'trackColor' => [ |
| 35 |
'type' => 'string', |
| 36 |
'default' => '#e0e0e0', |
| 37 |
], |
| 38 |
'mediaPosition' => [ |
| 39 |
'type' => 'string', |
| 40 |
'default' => 'top', |
| 41 |
], |
| 42 |
'isShowPercentage' => [ |
| 43 |
'type' => 'boolean', |
| 44 |
'default' => true, |
| 45 |
], |
| 46 |
'direction' => [ |
| 47 |
'type' => 'string', |
| 48 |
'default' => 'left', |
| 49 |
], |
| 50 |
'progressRelative' => [ |
| 51 |
'type' => 'string', |
| 52 |
'default' => 'entire_page', |
| 53 |
], |
| 54 |
'progressRelativeSelector' => [ |
| 55 |
'type' => 'string', |
| 56 |
'default' => '', |
| 57 |
], |
| 58 |
|
| 59 |
// progress bar attributes |
| 60 |
'barProgressColor' => [ |
| 61 |
'type' => 'string', |
| 62 |
'default' => '#000000', |
| 63 |
], |
| 64 |
'barBackgroundColor' => [ |
| 65 |
'type' => 'string', |
| 66 |
'default' => '#DDDDDF', |
| 67 |
], |
| 68 |
// circle |
| 69 |
'circleProgressColor' => [ |
| 70 |
'type' => 'string', |
| 71 |
'default' => '#000000', |
| 72 |
], |
| 73 |
'circleBackgroundColor' => [ |
| 74 |
'type' => 'string', |
| 75 |
'default' => '#dadada', |
| 76 |
], |
| 77 |
'circleSize' => [ |
| 78 |
'type' => 'number', |
| 79 |
'default' => 110, |
| 80 |
], |
| 81 |
'circleStrokeSize' => [ |
| 82 |
'type' => 'number', |
| 83 |
'default' => 10, |
| 84 |
], |
| 85 |
|
| 86 |
'contentColor' => [ |
| 87 |
'type' => 'string', |
| 88 |
'default' => '#ffffff' |
| 89 |
] |
| 90 |
]; |
| 91 |
|
| 92 |
$attributes = array_merge( |
| 93 |
$attributes, |
| 94 |
Alignment::get_attribute( 'alignment', true, [ 'value' => 'center' ] ), |
| 95 |
Typography::get_attribute( 'contentTypography', true ), |
| 96 |
TextShadow::get_attribute( 'contentTextShadow' ), |
| 97 |
TextStroke::get_attribute( 'contentTextStroke', true ), |
| 98 |
Border::get_attribute( 'barBorder', true ), |
| 99 |
ButtonGroup::get_attribute( 'layout', false, [ |
| 100 |
'value' => 'bar', |
| 101 |
] ), |
| 102 |
Range::get_attribute( [ |
| 103 |
'attributeName' => 'barHeightSize', |
| 104 |
'attributeObjectKey' => 'value', |
| 105 |
'isResponsive' => true, |
| 106 |
'defaultValue' => 40, |
| 107 |
'defaultValueMobile' => 30, |
| 108 |
'defaultValueTablet' => 30, |
| 109 |
'hasUnit' => true, |
| 110 |
'unitDefaultValue' => 'px', |
| 111 |
] ), |
| 112 |
); |
| 113 |
|
| 114 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 115 |
|
| 116 |
|
| 117 |
|