PluginProbe
ShiftController Employee Shift Scheduling / 4.9.85
ShiftController Employee Shift Scheduling v4.9.85
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 / list.php

list.php in ShiftController Employee Shift Scheduling 4.9.85, at hc3/ui/element/list.php

69 lines 1.4 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_List extends HC3_Ui_Abstract_Collection
3 {
4 protected $htmlFactory = NULL;
5 protected $striped = FALSE;
6
7 public function __construct(
8 HC3_Ui $htmlFactory,
9 array $items = array()
10 )
11 {
12 $this->htmlFactory = $htmlFactory;
13 parent::__construct( $items );
14 }
15
16 public function setStriped( $striped = TRUE )
17 {
18 $this->striped = $striped;
19 return $this;
20 }
21
22 public function render()
23 {
24 $out = NULL;
25
26 // content
27 $children = '';
28 $rri = 0;
29 foreach( $this->children as $child ){
30 $child = '' . $child;
31 if( ! strlen($child) ){
32 continue;
33 }
34
35 $child = $this->htmlFactory->makeBlock( $child );
36 if( $this->gutter && $rri && (! $this->striped) ){
37 $child->addAttr('class', 'hc-mt' . $this->gutter);
38 }
39 $rri++;
40
41 if( $this->striped ){
42 $child->addAttr('class', 'hc-p' . $this->gutter);
43 if( defined('WPINC') ){
44 if( is_admin() ){
45 if( $rri % 2 ){
46 $child->addAttr('class', 'hc-bg-wpsilver');
47 }
48 else {
49 $child->addAttr('class', 'hc-bg-white');
50 }
51 }
52 }
53 else {
54 if( $rri % 2 ){
55 $child->addAttr('class', 'hc-bg-lightsilver');
56 }
57 }
58 }
59
60 $children .= '' . $child;
61 }
62
63 if( strlen($children) ){
64 $out = $this->htmlFactory->makeBlock( $children );
65 }
66
67 return $out;
68 }
69 }