@@ -18,8 +18,9 @@ |
||
18 | 18 | if (isset($type)) { |
19 | 19 | if ($type=="page") { |
20 | 20 | $this->asPageHeader($niveau); |
21 | - } else |
|
22 | - $this->asContentHeader($niveau); |
|
21 | + } else { |
|
22 | + $this->asContentHeader($niveau); |
|
23 | + } |
|
23 | 24 | } |
24 | 25 | $this->content=$content; |
25 | 26 | } |
@@ -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); |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | private function afterInsert($item) { |
58 | - if (!$item instanceof HtmlMenu) |
|
59 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
60 | - else { |
|
58 | + if (!$item instanceof HtmlMenu) { |
|
59 | + $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
60 | + } else { |
|
61 | 61 | $this->setSecondary(); |
62 | 62 | } |
63 | 63 | return $item; |
@@ -155,8 +155,9 @@ discard block |
||
155 | 155 | $this->apply(function (HtmlDoubleElement &$item) { |
156 | 156 | $item->setTagName("a"); |
157 | 157 | }); |
158 | - if ($vertical === true) |
|
159 | - $this->setVertical(); |
|
158 | + if ($vertical === true) { |
|
159 | + $this->setVertical(); |
|
160 | + } |
|
160 | 161 | return $this->addToProperty("class", "tabular"); |
161 | 162 | } |
162 | 163 | |
@@ -185,10 +186,11 @@ discard block |
||
185 | 186 | */ |
186 | 187 | public function fromDatabaseObject($object, $function) { |
187 | 188 | $return=$function($object); |
188 | - if (\is_array($return)) |
|
189 | - $this->addItems($return); |
|
190 | - else |
|
191 | - $this->addItem($return); |
|
189 | + if (\is_array($return)) { |
|
190 | + $this->addItems($return); |
|
191 | + } else { |
|
192 | + $this->addItem($return); |
|
193 | + } |
|
192 | 194 | } |
193 | 195 | |
194 | 196 | /** |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | public function setFocusable($value=true) { |
57 | - if ($value === true) |
|
58 | - $this->setProperty("tabindex", "0"); |
|
59 | - else { |
|
57 | + if ($value === true) { |
|
58 | + $this->setProperty("tabindex", "0"); |
|
59 | + } else { |
|
60 | 60 | $this->removeProperty("tabindex"); |
61 | 61 | } |
62 | 62 | return $this; |
@@ -181,8 +181,9 @@ discard block |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | public static function social($identifier, $social, $value=NULL) { |
184 | - if ($value === NULL) |
|
185 | - $value=\ucfirst($social); |
|
184 | + if ($value === NULL) { |
|
185 | + $value=\ucfirst($social); |
|
186 | + } |
|
186 | 187 | $return=new HtmlButton($identifier, $value); |
187 | 188 | $return->addIcon($social); |
188 | 189 | return $return->addToPropertyCtrl("class", $social, Social::getConstants()); |
@@ -19,8 +19,9 @@ |
||
19 | 19 | public function __construct($identifier, $width=NULL) { |
20 | 20 | parent::__construct($identifier, "div"); |
21 | 21 | $this->setClass("column"); |
22 | - if (isset($width)) |
|
23 | - $this->setWidth($width); |
|
22 | + if (isset($width)) { |
|
23 | + $this->setWidth($width); |
|
24 | + } |
|
24 | 25 | } |
25 | 26 | |
26 | 27 | /** |
@@ -51,17 +51,19 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | public function getProperty($name) { |
54 | - if (array_key_exists($name, $this->properties)) |
|
55 | - return $this->properties[$name]; |
|
54 | + if (array_key_exists($name, $this->properties)) { |
|
55 | + return $this->properties[$name]; |
|
56 | + } |
|
56 | 57 | } |
57 | 58 | |
58 | 59 | public function addToProperty($name, $value, $separator=" ") { |
59 | 60 | if ($value !== "" && $this->propertyContains($name, $value) === false) { |
60 | 61 | $v=@$this->properties[$name]; |
61 | - if (isset($v) && $v !== "") |
|
62 | - $v=$v . $separator . $value; |
|
63 | - else |
|
64 | - $v=$value; |
|
62 | + if (isset($v) && $v !== "") { |
|
63 | + $v=$v . $separator . $value; |
|
64 | + } else { |
|
65 | + $v=$value; |
|
66 | + } |
|
65 | 67 | |
66 | 68 | return $this->setProperty($name, $v); |
67 | 69 | } |
@@ -121,8 +123,9 @@ discard block |
||
121 | 123 | } |
122 | 124 | |
123 | 125 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
124 | - if ($this->ctrl($name, $value, $typeCtrl) === true) |
|
125 | - return $this->setProperty($name, $value); |
|
126 | + if ($this->ctrl($name, $value, $typeCtrl) === true) { |
|
127 | + return $this->setProperty($name, $value); |
|
128 | + } |
|
126 | 129 | return $this; |
127 | 130 | } |
128 | 131 | |
@@ -152,8 +155,9 @@ discard block |
||
152 | 155 | } |
153 | 156 | |
154 | 157 | protected function removeProperty($name) { |
155 | - if (\array_key_exists($name, $this->properties)) |
|
156 | - unset($this->properties[$name]); |
|
158 | + if (\array_key_exists($name, $this->properties)) { |
|
159 | + unset($this->properties[$name]); |
|
160 | + } |
|
157 | 161 | return $this; |
158 | 162 | } |
159 | 163 | |
@@ -173,8 +177,9 @@ discard block |
||
173 | 177 | } |
174 | 178 | |
175 | 179 | protected function addToPropertyUnique($name, $value, $typeCtrl) { |
176 | - if (@class_exists($typeCtrl, true)) |
|
177 | - $typeCtrl=$typeCtrl::getConstants(); |
|
180 | + if (@class_exists($typeCtrl, true)) { |
|
181 | + $typeCtrl=$typeCtrl::getConstants(); |
|
182 | + } |
|
178 | 183 | if (is_array($typeCtrl)) { |
179 | 184 | $this->removeOldValues($this->properties[$name], $typeCtrl); |
180 | 185 | } |
@@ -359,15 +364,18 @@ discard block |
||
359 | 364 | $flag=false; |
360 | 365 | $index=0; |
361 | 366 | while ( !$flag && $index < sizeof($elements) ) { |
362 | - if ($elements[$index] instanceof BaseHtml) |
|
363 | - $flag=($elements[$index]->getIdentifier() === $identifier); |
|
367 | + if ($elements[$index] instanceof BaseHtml) { |
|
368 | + $flag=($elements[$index]->getIdentifier() === $identifier); |
|
369 | + } |
|
364 | 370 | $index++; |
365 | 371 | } |
366 | - if ($flag === true) |
|
367 | - return $elements[$index - 1]; |
|
372 | + if ($flag === true) { |
|
373 | + return $elements[$index - 1]; |
|
374 | + } |
|
368 | 375 | } elseif ($elements instanceof BaseHtml) { |
369 | - if ($elements->getIdentifier() === $identifier) |
|
370 | - return $elements; |
|
376 | + if ($elements->getIdentifier() === $identifier) { |
|
377 | + return $elements; |
|
378 | + } |
|
371 | 379 | } |
372 | 380 | return null; |
373 | 381 | } |
@@ -14,21 +14,24 @@ discard block |
||
14 | 14 | return $array[$key]; |
15 | 15 | } |
16 | 16 | $values=array_values($array); |
17 | - if ($pos < sizeof($values)) |
|
18 | - return $values[$pos]; |
|
17 | + if ($pos < sizeof($values)) { |
|
18 | + return $values[$pos]; |
|
19 | + } |
|
19 | 20 | } |
20 | 21 | |
21 | 22 | public static function getConditionalValue($array, $key, $condition) { |
22 | 23 | $result=NULL; |
23 | 24 | if (array_key_exists($key, $array)) { |
24 | 25 | $result=$array[$key]; |
25 | - if ($condition($result) === true) |
|
26 | - return $result; |
|
26 | + if ($condition($result) === true) { |
|
27 | + return $result; |
|
28 | + } |
|
27 | 29 | } |
28 | 30 | $values=array_values($array); |
29 | 31 | foreach ( $values as $val ) { |
30 | - if ($condition($val) === true) |
|
31 | - return $val; |
|
32 | + if ($condition($val) === true) { |
|
33 | + return $val; |
|
34 | + } |
|
32 | 35 | } |
33 | 36 | return $result; |
34 | 37 | } |
@@ -36,8 +39,9 @@ discard block |
||
36 | 39 | public static function getDefaultValue($array, $key, $default=NULL) { |
37 | 40 | if (array_key_exists($key, $array)) { |
38 | 41 | return $array[$key]; |
39 | - } else |
|
40 | - return $default; |
|
42 | + } else { |
|
43 | + return $default; |
|
44 | + } |
|
41 | 45 | } |
42 | 46 | |
43 | 47 | public static function implode($glue, $pieces) { |