PluginProbe
ShiftController Employee Shift Scheduling / 4.9.95
ShiftController Employee Shift Scheduling v4.9.95
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 / labelledhori.php

labelledhori.php in ShiftController Employee Shift Scheduling 4.9.95, at hc3/ui/element/labelledhori.php

52 lines 1.2 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_LabelledHori extends HC3_Ui_Abstract_Collection
3 {
4 protected $htmlFactory = NULL;
5 protected $label = NULL;
6 protected $content = NULL;
7
8 public function __construct( HC3_Ui $html, $label, $content, $labelFor = NULL )
9 {
10 $this->htmlFactory = $html;
11 $this->label = $label;
12 $this->content = $content;
13 $this->labelFor = $labelFor;
14
15 $this->add( $this->label );
16 $this->add( $this->content );
17 }
18
19 public function render()
20 {
21 // $labelView = $this->htmlFactory->makeElement('label', $this->label);
22 $labelView = $this->htmlFactory->makeBlock( $this->label );
23
24 // if( strlen($this->labelFor) ){
25 // $labelView->addAttr('for', $this->labelFor );
26 // }
27
28 $labelView
29 ;
30
31 if( NULL !== $this->label ){
32 $labelView
33 ->addAttr('class', 'hc-p2')
34 ->addAttr('class', 'hc-bg-lightsilver')
35 ;
36 }
37
38 $contentView = $this->htmlFactory->makeBlock( $this->content );
39 $contentView
40 // ->addAttr('class', 'hc-bold')
41 // ->addAttr('class', 'hc-p2')
42 ;
43
44 $out = $this->htmlFactory->makeGrid()
45 ->add( $labelView, 3 )
46 ->add( $contentView, 9 )
47 ->gutter(2)
48 ;
49
50 return $out;
51 }
52 }