PluginProbe
Kubio AI Page Builder / 2.9.1
Kubio AI Page Builder v2.9.1
2.9.1 2.9.0 2.8.6 2.8.5 2.8.4 2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 All 70 releases
kubio / build / block-library / blocks / divider / index.php
index.php
45 lines 769 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Kubio\Blocks;
4
5 use Kubio\Core\Blocks\BlockBase;
6 use Kubio\Core\Registry;
7
8 class DividerBlock extends BlockBase {
9
10 const OUTER = 'outer';
11 const LINE = 'line';
12 const INNER = 'inner';
13
14 public function computed() {
15 $iconEnabled = false;
16 if ( $this->getProp( 'type' ) === 'icon' ) {
17 $iconEnabled = true;
18 }
19 return array(
20 'iconEnabled' => $iconEnabled,
21 );
22 }
23
24 public function mapPropsToElements() {
25 if ( $this->getProp( 'type' ) === 'icon' ) {
26 if ( ! $this->getAttribute( 'iconName' ) ) {
27 $icon = '';
28 } else {
29 $icon = $this->getAttribute( 'iconName' );
30 }
31 } else {
32 $icon = null;
33 }
34 return array(
35 self::INNER => array( 'name' => $icon ),
36 );
37 }
38 }
39
40
41 Registry::registerBlock(
42 __DIR__,
43 DividerBlock::class
44 );
45