PluginProbe
ShiftController Employee Shift Scheduling / 4.9.66
ShiftController Employee Shift Scheduling v4.9.66
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 / text.php

text.php in ShiftController Employee Shift Scheduling 4.9.66, at hc3/ui/element/input/text.php

56 lines 1.3 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_Input_Text extends HC3_Ui_Abstract_Input
3 {
4 protected $el = 'input';
5 protected $uiType = 'input/text';
6 protected $bold = false;
7
8 public function bold( $set = TRUE )
9 {
10 $this->bold = $set;
11 return $this;
12 }
13
14 public function render()
15 {
16 $out = $this->htmlFactory->makeElement('input')
17 ->addAttr('type', 'text' )
18 ->addAttr('name', $this->htmlName() )
19 ->addAttr('class', 'hc-field')
20 // ->addAttr('class', 'hc-block')
21 ->addAttr('class', 'hc-full-width')
22 ;
23
24 if( strlen($this->value) ){
25 $out->addAttr('value', $this->value);
26 }
27
28 $attr = $this->getAttr();
29 foreach( $attr as $k => $v ){
30 $out->addAttr( $k, $v );
31 }
32
33 $out->addAttr('id', $this->htmlId());
34
35 if( (null !== $this->label) && strlen($this->label) ){
36 $placeHolder = $this->label;
37 $placeHolder = strip_tags( $placeHolder );
38
39 $out
40 ->addAttr('placeholder', $placeHolder)
41 ;
42 }
43
44 if( $this->bold ){
45 $out
46 ->addAttr('class', 'hc-fs5')
47 ;
48 }
49
50 if( (null !== $this->label) && strlen($this->label) && (! $this->bold) ){
51 $out = $this->htmlFactory->makeLabelled( $this->label, $out, $this->htmlId() );
52 }
53
54 return $out;
55 }
56 }