PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.4.3
Kubio AI Page Builder v2.4.3
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 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / lib / src / Core / Separators / Separators.php
kubio / lib / src / Core / Separators Last commit date
Separator.php 4 years ago Separators.php 4 years ago
Separators.php
66 lines
1 <?php
2
3 namespace Kubio\Core\Separators;
4
5 use Kubio\Config;
6 use Kubio\Core\Element;
7 use Kubio\Core\LodashBasic;
8
9 class Separators extends Element {
10 function __construct( $tag_name, $props, $children, $block ) {
11 parent::__construct( Element::FRAGMENT, $props, $children, $block );
12
13 $topEnabledByMedia = array();
14 $bottomEnabledByMedia = array();
15 if ( $block ) {
16 $this->value = $this->block->separators();
17 $topEnabledByMedia = $this->block->separatorTopEnabledByMedia();
18 $bottomEnabledByMedia = $this->block->separatorBottomEnabledByMedia();
19 }
20
21 $default = Config::value( 'definitions.separator.default' );
22
23 $top = $this->get( 'top', array() );
24 $bottom = $this->get( 'bottom', array() );
25
26 $shouldDisplayTopSeparator = in_array( true, array_values( $topEnabledByMedia ) );
27 $shouldDisplayBottomSeparator = in_array( true, array_values( $bottomEnabledByMedia ) );
28
29 $separators = array();
30 if ( $shouldDisplayTopSeparator ) {
31 $separators[] = new Separator(
32 Element::DIV,
33 LodashBasic::merge(
34 $default,
35 $top,
36 array(
37 'position' => 'top',
38 'enabledByMedia' => $topEnabledByMedia,
39 )
40 ),
41 array(),
42 $block
43 );
44 }
45
46 if ( $shouldDisplayBottomSeparator ) {
47 $separators[] = new Separator(
48 Element::DIV,
49 LodashBasic::merge(
50 $default,
51 $bottom,
52 array(
53 'position' => 'bottom',
54 'enabledByMedia' => $bottomEnabledByMedia,
55 )
56 ),
57 array(),
58 $block
59 );
60 }
61
62 $this->children = $separators;
63 }
64 }
65
66