@@ -6,6 +6,9 @@ |
||
| 6 | 6 | |
| 7 | 7 | trait CheckboxTrait { |
| 8 | 8 | |
| 9 | + /** |
|
| 10 | + * @param string $name |
|
| 11 | + */ |
|
| 9 | 12 | public abstract function addToPropertyCtrl($name, $value, $typeCtrl); |
| 10 | 13 | |
| 11 | 14 | public function setType($checkboxType) { |
@@ -29,12 +29,14 @@ discard block |
||
| 29 | 29 | if (\is_string($end)) { |
| 30 | 30 | $label=$end; |
| 31 | 31 | \array_pop($fields); |
| 32 | - } else |
|
| 33 | - $label=NULL; |
|
| 32 | + } else { |
|
| 33 | + $label=NULL; |
|
| 34 | + } |
|
| 34 | 35 | } |
| 35 | 36 | } |
| 36 | - if (isset($label)) |
|
| 37 | - $this->setLabel($label); |
|
| 37 | + if (isset($label)) { |
|
| 38 | + $this->setLabel($label); |
|
| 39 | + } |
|
| 38 | 40 | foreach ( $fields as $field ) { |
| 39 | 41 | $this->addItem($field); |
| 40 | 42 | } |
@@ -65,8 +67,9 @@ discard block |
||
| 65 | 67 | if ($this->_equalWidth) { |
| 66 | 68 | $count=$this->count(); |
| 67 | 69 | $this->addToProperty("class", Wide::getConstants()["W".$count]." fields"); |
| 68 | - } else |
|
| 69 | - $this->addToProperty("class", "fields"); |
|
| 70 | + } else { |
|
| 71 | + $this->addToProperty("class", "fields"); |
|
| 72 | + } |
|
| 70 | 73 | return parent::compile($js, $view); |
| 71 | 74 | } |
| 72 | 75 | |
@@ -106,8 +109,9 @@ discard block |
||
| 106 | 109 | $fields[]=$itemO; |
| 107 | 110 | } |
| 108 | 111 | $radios=new HtmlFormFields("fields-".$name, $fields); |
| 109 | - if (isset($label)) |
|
| 110 | - $radios->setLabel($label)->setProperty("for", $name); |
|
| 112 | + if (isset($label)) { |
|
| 113 | + $radios->setLabel($label)->setProperty("for", $name); |
|
| 114 | + } |
|
| 111 | 115 | return $radios; |
| 112 | 116 | } |
| 113 | 117 | |
@@ -122,8 +126,9 @@ discard block |
||
| 122 | 126 | $fields[]=$itemO; |
| 123 | 127 | } |
| 124 | 128 | $radios=new HtmlFormFields("fields-".$name, $fields); |
| 125 | - if (isset($label)) |
|
| 126 | - $radios->setLabel($label)->setProperty("for", $name); |
|
| 129 | + if (isset($label)) { |
|
| 130 | + $radios->setLabel($label)->setProperty("for", $name); |
|
| 131 | + } |
|
| 127 | 132 | return $radios; |
| 128 | 133 | } |
| 129 | 134 | |
@@ -13,8 +13,9 @@ discard block |
||
| 13 | 13 | $field=new \Ajax\common\html\html5\HtmlInput($identifier, $inputType, $value); |
| 14 | 14 | $field->setProperty("name", $name); |
| 15 | 15 | $this->setField($field); |
| 16 | - if (isset($label)) |
|
| 17 | - $this->setLabel($label); |
|
| 16 | + if (isset($label)) { |
|
| 17 | + $this->setLabel($label); |
|
| 18 | + } |
|
| 18 | 19 | } |
| 19 | 20 | |
| 20 | 21 | public function setType($checkboxType) { |
@@ -40,8 +41,9 @@ discard block |
||
| 40 | 41 | * @return mixed |
| 41 | 42 | */ |
| 42 | 43 | public function getLabel() { |
| 43 | - if (\array_key_exists("label", $this->content)) |
|
| 44 | - return $this->content["label"]; |
|
| 44 | + if (\array_key_exists("label", $this->content)) { |
|
| 45 | + return $this->content["label"]; |
|
| 46 | + } |
|
| 45 | 47 | } |
| 46 | 48 | |
| 47 | 49 | /** |
@@ -33,8 +33,9 @@ discard block |
||
| 33 | 33 | $labelO=$label; |
| 34 | 34 | if (\is_object($label)===false) { |
| 35 | 35 | $labelO=new HtmlLabel("label-".$this->identifier, $label); |
| 36 | - if (isset($icon)) |
|
| 37 | - $labelO->addIcon($icon); |
|
| 36 | + if (isset($icon)) { |
|
| 37 | + $labelO->addIcon($icon); |
|
| 38 | + } |
|
| 38 | 39 | } else { |
| 39 | 40 | $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
| 40 | 41 | } |
@@ -51,8 +52,9 @@ discard block |
||
| 51 | 52 | $actionO=$action; |
| 52 | 53 | if (\is_object($action)===false) { |
| 53 | 54 | $actionO=new HtmlButton("action-".$this->identifier, $action); |
| 54 | - if (isset($icon)) |
|
| 55 | - $actionO->addIcon($icon, true, $labeled); |
|
| 55 | + if (isset($icon)) { |
|
| 56 | + $actionO->addIcon($icon, true, $labeled); |
|
| 57 | + } |
|
| 56 | 58 | } |
| 57 | 59 | $this->addToProperty("class", $direction." action"); |
| 58 | 60 | $this->addContent($actionO, \strstr($direction, Direction::LEFT)!==false); |
@@ -21,8 +21,9 @@ |
||
| 21 | 21 | if (\is_array($value)) { |
| 22 | 22 | $item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]); |
| 23 | 23 | $item->addIcon($value[1]); |
| 24 | - } else |
|
| 25 | - $item=new HtmlListItem("item-".$this->identifier."-".$count, $value); |
|
| 24 | + } else { |
|
| 25 | + $item=new HtmlListItem("item-".$this->identifier."-".$count, $value); |
|
| 26 | + } |
|
| 26 | 27 | return $item; |
| 27 | 28 | } |
| 28 | 29 | |