index.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Kubio\Blocks; |
| 4 | |
| 5 | use Kubio\Core\Blocks\BlockBase; |
| 6 | use Kubio\Core\Registry; |
| 7 | use Kubio\Core\StyleManager\DynamicStyles; |
| 8 | |
| 9 | class ButtonGroupBlock extends BlockBase { |
| 10 | |
| 11 | const OUTER = 'outer'; |
| 12 | const SPACING = 'spacing'; |
| 13 | const H_SPACE = 'hspace'; |
| 14 | const H_SPACE_GROUP = 'hSpaceGroup'; |
| 15 | |
| 16 | public function __construct( $block, $autoload = true ) { |
| 17 | parent::__construct( $block, $autoload ); |
| 18 | } |
| 19 | |
| 20 | public function mapDynamicStyleToElements() { |
| 21 | $dynamicStyles = array(); |
| 22 | $spaceByMedia = $this->getPropByMedia( |
| 23 | 'layout.hSpace', |
| 24 | array() |
| 25 | ); |
| 26 | $dynamicStyles[ self::H_SPACE ] = DynamicStyles::hSpace( $spaceByMedia ); |
| 27 | $dynamicStyles[ self::H_SPACE_GROUP ] = DynamicStyles::hSpaceParent( $spaceByMedia ); |
| 28 | return $dynamicStyles; |
| 29 | } |
| 30 | |
| 31 | public function mapPropsToElements() { |
| 32 | return array(); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | Registry::registerBlock( __DIR__, ButtonGroupBlock::class ); |
| 37 |