PluginProbe
ShiftController Employee Shift Scheduling / 4.9.66
ShiftController Employee Shift Scheduling v4.9.66
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / hc3 / ui / element / listinline.php

listinline.php in ShiftController Employee Shift Scheduling 4.9.66, at hc3/ui/element/listinline.php

86 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 class HC3_Ui_Element_ListInline extends HC3_Ui_Abstract_Collection
3 {
4 protected $htmlFactory = NULL;
5 protected $valign = 'middle';
6
7 public function __construct( HC3_Ui $htmlFactory, array $items = array() )
8 {
9 $this->htmlFactory = $htmlFactory;
10 parent::__construct( $items );
11 }
12
13 public function valign( $set )
14 {
15 $this->valign = $set;
16 return $this;
17 }
18
19 public function render()
20 {
21 $out = NULL;
22
23 // content
24 $out = '';
25
26 if( $this->separated ){
27 $separator = ($this->separated === TRUE) ? '&#124;' : $this->separated; // &vert;
28 $separator = $this->htmlFactory->makeBlock($separator)
29 ->addAttr('class', 'hc-gray')
30 ->render()
31 ;
32
33 $children = array();
34 $ii = 0;
35 foreach( $this->children as $child ){
36 $child = '' . $child;
37 if( ! strlen($child) ){
38 continue;
39 }
40
41 if( $ii ){
42 $children[] = $separator;
43 // $children[] = '&bull;';
44 }
45
46 $children[] = $child;
47 $ii++;
48 }
49 }
50 else {
51 $children = $this->children;
52 }
53
54 $ii = 0;
55 $count = count($children);
56 foreach( $children as $child ){
57 $child = '' . $child;
58 if( ! strlen($child) ){
59 continue;
60 }
61
62 $child = $this->htmlFactory->makeBlock( $child )
63 // ->addAttr('class', 'hc-inline-block')
64 ->addAttr('class', 'hc-valign-' . $this->valign)
65 ;
66
67 if( $this->gutter && ($ii < ($count-1)) ){
68 // $child->addAttr('class', 'hc-mr' . $this->gutter);
69 // $child->addAttr('class', 'hc-me' . $this->gutter);
70 }
71 $out .= '' . $child;
72
73 $ii++;
74 }
75
76 if( strlen($out) ){
77 $out = $this->htmlFactory->makeBlock( $out )
78 ->addAttr( 'class', 'pw-flex' )
79 ->addAttr( 'class', 'pw-gap' . $this->gutter )
80 // ->addAttr('class', 'hc-nowrap')
81 ;
82 }
83
84 return $out;
85 }
86 }