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 / labelled.php

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

47 lines 1.1 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_Labelled extends HC3_Ui_Abstract_Collection
3 {
4 public $ui, $label, $content, $labelFor;
5
6 public function __construct( HC3_Ui $ui, $label, $content, $labelFor = '' )
7 {
8 $this->ui = $ui;
9 $this->label = $label;
10 $this->content = $content;
11 $this->labelFor = $labelFor;
12
13 $this->add( $this->label );
14 $this->add( $this->content );
15 }
16
17 public function renderFieldset()
18 {
19 $label = $this->ui->makeElement( 'legend', $this->label );
20 $content = $this->ui->makeCollection( array($label, $this->content) );
21
22 $out = $this->ui->makeElement( 'fieldset', $content )
23 ;
24
25 return $out;
26 }
27
28 public function render()
29 {
30 $label = $this->ui->makeElement('label', $this->label)
31 // ->addAttr('class', 'hc-fs2')
32 ->addAttr('class', 'hc-bold')
33 ;
34
35 if( (null !== $this->labelFor) && strlen($this->labelFor) ){
36 $label
37 ->addAttr('for', $this->labelFor )
38 ;
39 }
40
41 $out = $this->ui->makeList( array($label, $this->content) )
42 ->gutter(1)
43 ;
44
45 return $out;
46 }
47 }