@@ -8,8 +8,9 @@ |
||
8 | 8 | class HtmlFormInput extends HtmlFormField { |
9 | 9 | |
10 | 10 | public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) { |
11 | - if(!isset($placeholder)) |
|
12 | - $placeholder=$label; |
|
11 | + if(!isset($placeholder)) { |
|
12 | + $placeholder=$label; |
|
13 | + } |
|
13 | 14 | parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label); |
14 | 15 | } |
15 | 16 | } |
16 | 17 | \ No newline at end of file |
@@ -11,18 +11,21 @@ |
||
11 | 11 | parent::__construct($identifier, "textarea"); |
12 | 12 | $this->setValue($value); |
13 | 13 | $this->setPlaceholder($placeholder); |
14 | - if(isset($rows)) |
|
15 | - $this->setRows($rows); |
|
14 | + if(isset($rows)) { |
|
15 | + $this->setRows($rows); |
|
16 | + } |
|
16 | 17 | } |
17 | 18 | public function setValue($value) { |
18 | - if(isset($value)) |
|
19 | - $this->setContent($value); |
|
19 | + if(isset($value)) { |
|
20 | + $this->setContent($value); |
|
21 | + } |
|
20 | 22 | return $this; |
21 | 23 | } |
22 | 24 | |
23 | 25 | public function setPlaceholder($value){ |
24 | - if(JString::isNotNull($value)) |
|
25 | - $this->setProperty("placeholder", $value); |
|
26 | + if(JString::isNotNull($value)) { |
|
27 | + $this->setProperty("placeholder", $value); |
|
28 | + } |
|
26 | 29 | return $this; |
27 | 30 | } |
28 | 31 |
@@ -13,8 +13,9 @@ |
||
13 | 13 | |
14 | 14 | public function __construct($identifier, $name=NULL,$label=NULL,$value=NULL) { |
15 | 15 | parent::__construct($identifier, $label, "radio", $value=NULL); |
16 | - if(isset($name)) |
|
17 | - $this->getField()->setProperty("name", $name); |
|
16 | + if(isset($name)) { |
|
17 | + $this->getField()->setProperty("name", $name); |
|
18 | + } |
|
18 | 19 | if(isset($label)){ |
19 | 20 | $this->swapLabel(); |
20 | 21 | $label=$this->getLabel(); |
@@ -25,8 +25,9 @@ discard block |
||
25 | 25 | |
26 | 26 | public function addHeader($title,$niveau=1,$dividing=true){ |
27 | 27 | $header=new HtmlHeader("",$niveau,$title); |
28 | - if($dividing) |
|
29 | - $header->setDividing(); |
|
28 | + if($dividing) { |
|
29 | + $header->setDividing(); |
|
30 | + } |
|
30 | 31 | return $this->addItem($header); |
31 | 32 | } |
32 | 33 | |
@@ -38,13 +39,16 @@ discard block |
||
38 | 39 | if(\is_string($end)){ |
39 | 40 | $label=$end; |
40 | 41 | \array_pop($fields); |
41 | - }else $label=NULL; |
|
42 | + } else { |
|
43 | + $label=NULL; |
|
44 | + } |
|
42 | 45 | } |
43 | 46 | $this->_fields=\array_merge($this->_fields,$fields); |
44 | 47 | $fields=new HtmlFormFields("fields-".$this->identifier."-".$this->count(),$fields); |
45 | 48 | } |
46 | - if(isset($label)) |
|
47 | - $fields=new HtmlFormField("", $fields,$label); |
|
49 | + if(isset($label)) { |
|
50 | + $fields=new HtmlFormField("", $fields,$label); |
|
51 | + } |
|
48 | 52 | $this->addItem($fields); |
49 | 53 | return $fields; |
50 | 54 | } |
@@ -60,7 +64,7 @@ discard block |
||
60 | 64 | public function getField($index){ |
61 | 65 | if(\is_string($index)){ |
62 | 66 | $field=$this->getElementById($index, $this->_fields); |
63 | - }else{ |
|
67 | + } else{ |
|
64 | 68 | $field=$this->_fields[$index]; |
65 | 69 | } |
66 | 70 | return $field; |
@@ -37,8 +37,9 @@ discard block |
||
37 | 37 | if($this->_equalWidth){ |
38 | 38 | $count=$this->count(); |
39 | 39 | $this->addToProperty("class", Wide::getConstants()["W".$count]." fields"); |
40 | - }else |
|
41 | - $this->addToProperty("class","fields"); |
|
40 | + } else { |
|
41 | + $this->addToProperty("class","fields"); |
|
42 | + } |
|
42 | 43 | return parent::compile($js,$view); |
43 | 44 | } |
44 | 45 | |
@@ -73,8 +74,9 @@ discard block |
||
73 | 74 | $fields[]=new HtmlFormRadio($name."-".$i++,$name,$item,$item); |
74 | 75 | } |
75 | 76 | $radios=new HtmlFormFields("fields-".$name,$fields); |
76 | - if(isset($label)) |
|
77 | - $radios->setLabel($label)->setProperty("for", $name); |
|
77 | + if(isset($label)) { |
|
78 | + $radios->setLabel($label)->setProperty("for", $name); |
|
79 | + } |
|
78 | 80 | return $radios; |
79 | 81 | } |
80 | 82 |