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 / input / checkboxset.php

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

36 lines 1008 B
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_Input_CheckboxSet extends HC3_Ui_Abstract_Input
3 {
4 protected $el = 'input';
5 protected $uiType = 'input/checkbox';
6
7 protected $options = array();
8
9 public function __construct( $htmlFactory, $name, $label = NULL, $options = array(), $value = array() )
10 {
11 parent::__construct( $htmlFactory, $name, $label, $value );
12 $this->options = $options;
13 }
14
15 public function render()
16 {
17 $options = array();
18 foreach( $this->options as $k => $v ){
19 if( ! strlen($k) ){
20 $k = ' ';
21 }
22 $checked = in_array($k, $this->value) ? TRUE : FALSE;
23 $name = $this->name . '[]';
24 $thisInput = $this->htmlFactory->makeInputCheckbox( $name, $v, $k, $checked );
25 $options[] = $thisInput;
26 }
27
28 $out = $this->htmlFactory->makeListInline( $options );
29
30 if( strlen($this->label) ){
31 $out = $this->htmlFactory->makeLabelled( $this->label, $out, $this->htmlId() );
32 }
33
34 return $out;
35 }
36 }