PluginProbe
ShiftController Employee Shift Scheduling / trunk
ShiftController Employee Shift Scheduling vtrunk
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 / abstract / input.php

input.php in ShiftController Employee Shift Scheduling trunk, at hc3/ui/abstract/input.php

53 lines 1.0 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 abstract class HC3_Ui_Abstract_Input extends HC3_Ui_Abstract_Element
3 {
4 protected $htmlFactory = NULL;
5 protected $_prefix = 'hc-';
6 protected $name = '';
7 protected $label = '';
8 protected $value = '';
9
10 protected $htmlId = '';
11
12 public function __construct( $htmlFactory, $name, $label = '', $value = '' )
13 {
14 static $useCount = 1;
15
16 $this->htmlFactory = $htmlFactory;
17 $this->name = $name;
18 if( null !== $label )
19 $this->label = $label;
20 if( null !== $value )
21 $this->setValue( $value );
22
23 $this->htmlId = ($useCount > 1) ? $this->name . $useCount : $this->name;
24 $useCount++;
25 }
26
27 public function setValue( $value )
28 {
29 $this->value = $value;
30 return $this;
31 }
32
33 public function htmlId()
34 {
35 return $this->htmlId;
36 }
37
38 public function setHtmlId( $htmlId )
39 {
40 $this->htmlId = $htmlId;
41 return $this;
42 }
43
44 public function htmlName()
45 {
46 return $this->_prefix . $this->name;
47 }
48
49 public function name()
50 {
51 return $this->name;
52 }
53 }