@@ -330,8 +330,9 @@ discard block |
||
| 330 | 330 | $result= $this->getBody()->_addRow($result); |
| 331 | 331 | } |
| 332 | 332 | if(isset($this->_afterCompileEvents["onNewRow"])){ |
| 333 | - if(\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
| 334 | - $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 333 | + if(\is_callable($this->_afterCompileEvents["onNewRow"])) { |
|
| 334 | + $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 335 | + } |
|
| 335 | 336 | } |
| 336 | 337 | return $result; |
| 337 | 338 | } |
@@ -353,8 +354,9 @@ discard block |
||
| 353 | 354 | |
| 354 | 355 | public function run(JsUtils $js){ |
| 355 | 356 | $result= parent::run($js); |
| 356 | - if(isset($this->_footer)) |
|
| 357 | - $this->_footer->run($js); |
|
| 357 | + if(isset($this->_footer)) { |
|
| 358 | + $this->_footer->run($js); |
|
| 359 | + } |
|
| 358 | 360 | return $result; |
| 359 | 361 | } |
| 360 | 362 | |
@@ -394,8 +396,9 @@ discard block |
||
| 394 | 396 | |
| 395 | 397 | public function setColWidth($colIndex,$width){ |
| 396 | 398 | $part=$this->_getFirstPart(); |
| 397 | - if($part!==null && $part->count()>0) |
|
| 398 | - $part->getCell(0, $colIndex)->setWidth($width); |
|
| 399 | + if($part!==null && $part->count()>0) { |
|
| 400 | + $part->getCell(0, $colIndex)->setWidth($width); |
|
| 401 | + } |
|
| 399 | 402 | return $this; |
| 400 | 403 | } |
| 401 | 404 | |
@@ -22,15 +22,17 @@ |
||
| 22 | 22 | |
| 23 | 23 | public function setBasic($very=false) { |
| 24 | 24 | $table=$this->_self; |
| 25 | - if ($very) |
|
| 26 | - $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 25 | + if ($very) { |
|
| 26 | + $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 27 | + } |
|
| 27 | 28 | return $table->addToPropertyCtrl("class", "basic", array ("basic" )); |
| 28 | 29 | } |
| 29 | 30 | |
| 30 | 31 | public function setCompact($very=false) { |
| 31 | 32 | $table=$this->_self; |
| 32 | - if ($very) |
|
| 33 | - $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 33 | + if ($very) { |
|
| 34 | + $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 35 | + } |
|
| 34 | 36 | return $table->addToPropertyCtrl("class", "compact", array ("compact" )); |
| 35 | 37 | } |
| 36 | 38 | |
@@ -34,8 +34,9 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | public function getProperty($name) { |
| 37 | - if (array_key_exists($name, $this->_self->properties)) |
|
| 38 | - return $this->_self->properties[$name]; |
|
| 37 | + if (array_key_exists($name, $this->_self->properties)) { |
|
| 38 | + return $this->_self->properties[$name]; |
|
| 39 | + } |
|
| 39 | 40 | } |
| 40 | 41 | |
| 41 | 42 | public function addToProperty($name, $value, $separator=" ") { |
@@ -45,10 +46,11 @@ discard block |
||
| 45 | 46 | } |
| 46 | 47 | } else if ($value !== "" && $this->_self->propertyContains($name, $value) === false) { |
| 47 | 48 | $v=@$this->_self->properties[$name]; |
| 48 | - if (isset($v) && $v !== "") |
|
| 49 | - $v=$v . $separator . $value; |
|
| 50 | - else |
|
| 51 | - $v=$value; |
|
| 49 | + if (isset($v) && $v !== "") { |
|
| 50 | + $v=$v . $separator . $value; |
|
| 51 | + } else { |
|
| 52 | + $v=$value; |
|
| 53 | + } |
|
| 52 | 54 | |
| 53 | 55 | return $this->_self->setProperty($name, $v); |
| 54 | 56 | } |
@@ -71,8 +73,9 @@ discard block |
||
| 71 | 73 | } |
| 72 | 74 | |
| 73 | 75 | protected function addToPropertyUnique($name, $value, $typeCtrl) { |
| 74 | - if (@class_exists($typeCtrl, true)) |
|
| 75 | - $typeCtrl=$typeCtrl::getConstants(); |
|
| 76 | + if (@class_exists($typeCtrl, true)) { |
|
| 77 | + $typeCtrl=$typeCtrl::getConstants(); |
|
| 78 | + } |
|
| 76 | 79 | if (\is_array($typeCtrl)) { |
| 77 | 80 | $this->_self->removeOldValues($this->_self->properties[$name], $typeCtrl); |
| 78 | 81 | } |
@@ -91,8 +94,9 @@ discard block |
||
| 91 | 94 | } |
| 92 | 95 | |
| 93 | 96 | public function removeProperty($name) { |
| 94 | - if (\array_key_exists($name, $this->_self->properties)) |
|
| 95 | - unset($this->_self->properties[$name]); |
|
| 97 | + if (\array_key_exists($name, $this->_self->properties)) { |
|
| 98 | + unset($this->_self->properties[$name]); |
|
| 99 | + } |
|
| 96 | 100 | return $this; |
| 97 | 101 | } |
| 98 | 102 | |
@@ -105,8 +109,9 @@ discard block |
||
| 105 | 109 | } |
| 106 | 110 | |
| 107 | 111 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
| 108 | - if ($this->_self->ctrl($name, $value, $typeCtrl) === true) |
|
| 109 | - return $this->_self->setProperty($name, $value); |
|
| 112 | + if ($this->_self->ctrl($name, $value, $typeCtrl) === true) { |
|
| 113 | + return $this->_self->setProperty($name, $value); |
|
| 114 | + } |
|
| 110 | 115 | return $this; |
| 111 | 116 | } |
| 112 | 117 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $this->_generateFields($form, [$v], $headers, $i, $wrappers); |
| 64 | 64 | $i++; |
| 65 | 65 | } |
| 66 | - }else{ |
|
| 66 | + } else{ |
|
| 67 | 67 | $separators[]=$count; |
| 68 | 68 | for($i=0;$i<$size;$i++){ |
| 69 | 69 | $fields=\array_slice($values, $separators[$i]+1,$separators[$i+1]-$separators[$i]); |
@@ -74,17 +74,19 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | protected function _generateFields($form,$values,$headers,$sepFirst,$wrappers){ |
| 76 | 76 | $wrapper=null; |
| 77 | - if(isset($headers[$sepFirst+1])) |
|
| 78 | - $form->addHeader($headers[$sepFirst+1],4,true); |
|
| 77 | + if(isset($headers[$sepFirst+1])) { |
|
| 78 | + $form->addHeader($headers[$sepFirst+1],4,true); |
|
| 79 | + } |
|
| 79 | 80 | if(isset($wrappers[$sepFirst+1])){ |
| 80 | 81 | $wrapper=$wrappers[$sepFirst+1]; |
| 81 | 82 | } |
| 82 | 83 | if(\sizeof($values)===1){ |
| 83 | 84 | $added=$form->addField($values[0]); |
| 84 | - }elseif(\sizeof($values)>1){ |
|
| 85 | + } elseif(\sizeof($values)>1){ |
|
| 85 | 86 | $added=$form->addFields($values); |
| 86 | - }else |
|
| 87 | - return; |
|
| 87 | + } else { |
|
| 88 | + return; |
|
| 89 | + } |
|
| 88 | 90 | if(isset($wrapper)){ |
| 89 | 91 | $added->wrap($wrapper[0],$wrapper[1]); |
| 90 | 92 | } |
@@ -30,8 +30,9 @@ |
||
| 30 | 30 | if (isset($extra)) { |
| 31 | 31 | $result->addExtraContent($extra); |
| 32 | 32 | } |
| 33 | - } else |
|
| 34 | - $result->addItemContent($value); |
|
| 33 | + } else { |
|
| 34 | + $result->addItemContent($value); |
|
| 35 | + } |
|
| 35 | 36 | return $result; |
| 36 | 37 | } |
| 37 | 38 | |
@@ -18,8 +18,9 @@ |
||
| 18 | 18 | |
| 19 | 19 | public function getPart($partKey, $index=NULL,$force=false) { |
| 20 | 20 | if (\array_key_exists($partKey, $this->content)) { |
| 21 | - if (isset($index)) |
|
| 22 | - return $this->content[$partKey][$index]; |
|
| 21 | + if (isset($index)) { |
|
| 22 | + return $this->content[$partKey][$index]; |
|
| 23 | + } |
|
| 23 | 24 | return $this->content[$partKey]; |
| 24 | 25 | } |
| 25 | 26 | if($force){ |
@@ -28,8 +28,9 @@ discard block |
||
| 28 | 28 | $this->addImage($image); |
| 29 | 29 | } |
| 30 | 30 | $this->addHeaderContent($header, $metas, $description,$extra); |
| 31 | - } else |
|
| 32 | - $this->addContent($value); |
|
| 31 | + } else { |
|
| 32 | + $this->addContent($value); |
|
| 33 | + } |
|
| 33 | 34 | } |
| 34 | 35 | |
| 35 | 36 | public function addElement($content, $baseClass="",$part=NULL) { |
@@ -62,8 +63,9 @@ discard block |
||
| 62 | 63 | |
| 63 | 64 | public function addImage($src="", $alt="", $size=NULL) { |
| 64 | 65 | $image=new HtmlImg("img-", $src, $alt); |
| 65 | - if (isset($size)) |
|
| 66 | - $image->setSize($size); |
|
| 66 | + if (isset($size)) { |
|
| 67 | + $image->setSize($size); |
|
| 68 | + } |
|
| 67 | 69 | $this->content['image']=$image; |
| 68 | 70 | return $image; |
| 69 | 71 | } |
@@ -86,8 +88,9 @@ discard block |
||
| 86 | 88 | foreach ( $metas as $meta ) { |
| 87 | 89 | $this->addMeta($meta); |
| 88 | 90 | } |
| 89 | - } else |
|
| 90 | - $this->addMeta($metas); |
|
| 91 | + } else { |
|
| 92 | + $this->addMeta($metas); |
|
| 93 | + } |
|
| 91 | 94 | return $this; |
| 92 | 95 | } |
| 93 | 96 | |
@@ -114,8 +117,9 @@ discard block |
||
| 114 | 117 | $result=new HtmlSemDoubleElement("", "span", "", $caption); |
| 115 | 118 | $this->addContent($result); |
| 116 | 119 | $result->setFloated($direction); |
| 117 | - } else |
|
| 118 | - $result=$this->addContent($caption); |
|
| 120 | + } else { |
|
| 121 | + $result=$this->addContent($caption); |
|
| 122 | + } |
|
| 119 | 123 | return $result; |
| 120 | 124 | } |
| 121 | 125 | |
@@ -127,8 +131,9 @@ discard block |
||
| 127 | 131 | } |
| 128 | 132 | |
| 129 | 133 | public function addHeaderContent($header, $metas=array(), $description=NULL,$extra=NULL) { |
| 130 | - if(isset($header)) |
|
| 131 | - $this->addElement($header, "header"); |
|
| 134 | + if(isset($header)) { |
|
| 135 | + $this->addElement($header, "header"); |
|
| 136 | + } |
|
| 132 | 137 | $this->addMetas($metas); |
| 133 | 138 | if (isset($description)) { |
| 134 | 139 | $this->addElement($description, "description"); |
@@ -19,8 +19,9 @@ discard block |
||
| 19 | 19 | public function __construct($identifier,$baseClass,$content=NULL) { |
| 20 | 20 | parent::__construct($identifier, "div", $baseClass); |
| 21 | 21 | $this->content=["content"=>new HtmlViewContent("content-".$this->identifier)]; |
| 22 | - if(isset($content)) |
|
| 23 | - $this->setContent($content); |
|
| 22 | + if(isset($content)) { |
|
| 23 | + $this->setContent($content); |
|
| 24 | + } |
|
| 24 | 25 | } |
| 25 | 26 | |
| 26 | 27 | public function setContent($value){ |
@@ -31,10 +32,12 @@ discard block |
||
| 31 | 32 | if (isset($image)) { |
| 32 | 33 | $this->addImage($image); |
| 33 | 34 | } |
| 34 | - if(isset($content)) |
|
| 35 | - $this->content["content"]->setContent($content); |
|
| 36 | - if(isset($extra)) |
|
| 37 | - $this->addExtraContent($extra); |
|
| 35 | + if(isset($content)) { |
|
| 36 | + $this->content["content"]->setContent($content); |
|
| 37 | + } |
|
| 38 | + if(isset($extra)) { |
|
| 39 | + $this->addExtraContent($extra); |
|
| 40 | + } |
|
| 38 | 41 | } |
| 39 | 42 | } |
| 40 | 43 | |
@@ -49,10 +52,11 @@ discard block |
||
| 49 | 52 | if (\array_key_exists($key, $this->content) === false) { |
| 50 | 53 | $this->content[$key]=[]; |
| 51 | 54 | } |
| 52 | - if($this->content[$key] instanceof HtmlViewContent) |
|
| 53 | - $this->content[$key]->addElement($element); |
|
| 54 | - else |
|
| 55 | - $this->content[$key][]=$element; |
|
| 55 | + if($this->content[$key] instanceof HtmlViewContent) { |
|
| 56 | + $this->content[$key]->addElement($element); |
|
| 57 | + } else { |
|
| 58 | + $this->content[$key][]=$element; |
|
| 59 | + } |
|
| 56 | 60 | return $element; |
| 57 | 61 | } |
| 58 | 62 | |
@@ -153,8 +157,9 @@ discard block |
||
| 153 | 157 | $this->addToProperty("class", "link"); |
| 154 | 158 | if ($href !== "") { |
| 155 | 159 | $this->setProperty("href", $href); |
| 156 | - if (isset($target)) |
|
| 157 | - $this->setProperty("target", $target); |
|
| 160 | + if (isset($target)) { |
|
| 161 | + $this->setProperty("target", $target); |
|
| 162 | + } |
|
| 158 | 163 | } |
| 159 | 164 | return $this; |
| 160 | 165 | } |
@@ -64,8 +64,7 @@ discard block |
||
| 64 | 64 | $rules=$attributes["rules"]; |
| 65 | 65 | if(\is_array($rules)){ |
| 66 | 66 | $element->addRules($rules); |
| 67 | - } |
|
| 68 | - else{ |
|
| 67 | + } else{ |
|
| 69 | 68 | $element->addRule($rules); |
| 70 | 69 | } |
| 71 | 70 | unset($attributes["rules"]); |
@@ -117,8 +116,9 @@ discard block |
||
| 117 | 116 | public function fieldAsLabel($index,$icon=NULL,$attributes=NULL){ |
| 118 | 117 | return $this->_fieldAs(function($id,$name,$value) use($icon){ |
| 119 | 118 | $lbl=new HtmlLabel($id,$value); |
| 120 | - if(isset($icon)) |
|
| 121 | - $lbl->addIcon($icon); |
|
| 119 | + if(isset($icon)) { |
|
| 120 | + $lbl->addIcon($icon); |
|
| 121 | + } |
|
| 122 | 122 | return $lbl; |
| 123 | 123 | }, $index,$attributes,"label"); |
| 124 | 124 | } |
@@ -126,8 +126,9 @@ discard block |
||
| 126 | 126 | public function fieldAsHeader($index,$niveau=1,$icon=NULL,$attributes=NULL){ |
| 127 | 127 | return $this->_fieldAs(function($id,$name,$value) use($niveau,$icon){ |
| 128 | 128 | $header=new HtmlHeader($id,$niveau,$value); |
| 129 | - if(isset($icon)) |
|
| 130 | - $header->asIcon($icon, $value); |
|
| 129 | + if(isset($icon)) { |
|
| 130 | + $header->asIcon($icon, $value); |
|
| 131 | + } |
|
| 131 | 132 | return $header; |
| 132 | 133 | }, $index,$attributes,"header"); |
| 133 | 134 | } |
@@ -135,7 +136,9 @@ discard block |
||
| 135 | 136 | |
| 136 | 137 | public function fieldAsImage($index,$size=Size::MINI,$circular=false){ |
| 137 | 138 | $this->setValueFunction($index,function($img) use($size,$circular){ |
| 138 | - $image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular)$image->setCircular(); |
|
| 139 | + $image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular) { |
|
| 140 | + $image->setCircular(); |
|
| 141 | + } |
|
| 139 | 142 | return $image; |
| 140 | 143 | }); |
| 141 | 144 | return $this; |
@@ -194,8 +197,9 @@ discard block |
||
| 194 | 197 | |
| 195 | 198 | public function fieldAsCheckbox($index,$attributes=NULL){ |
| 196 | 199 | return $this->_fieldAs(function($id,$name,$value,$caption) use($attributes){ |
| 197 | - if($caption===null || $caption==="") |
|
| 198 | - $caption=""; |
|
| 200 | + if($caption===null || $caption==="") { |
|
| 201 | + $caption=""; |
|
| 202 | + } |
|
| 199 | 203 | $input=new HtmlFormCheckbox($id,$caption,$this->_instanceViewer->getIdentifier()); |
| 200 | 204 | $input->setChecked(JString::isBooleanTrue($value)); |
| 201 | 205 | return $this->_prepareFormFields($input, $name, $attributes); |
@@ -232,14 +236,14 @@ discard block |
||
| 232 | 236 | $i=0; |
| 233 | 237 | if(JArray::isAssociative($types)){ |
| 234 | 238 | foreach ($types as $type=>$attributes){ |
| 235 | - if(\is_int($type)) |
|
| 236 | - $this->fieldAs($i++,$attributes,[]); |
|
| 237 | - else{ |
|
| 239 | + if(\is_int($type)) { |
|
| 240 | + $this->fieldAs($i++,$attributes,[]); |
|
| 241 | + } else{ |
|
| 238 | 242 | $type=preg_replace('/\d/', '', $type ); |
| 239 | 243 | $this->fieldAs($i++,$type,$attributes); |
| 240 | 244 | } |
| 241 | 245 | } |
| 242 | - }else{ |
|
| 246 | + } else{ |
|
| 243 | 247 | foreach ($types as $type){ |
| 244 | 248 | $this->fieldAs($i++,$type); |
| 245 | 249 | } |
@@ -251,7 +255,7 @@ discard block |
||
| 251 | 255 | if(\method_exists($this, $method)){ |
| 252 | 256 | if(!\is_array($attributes)){ |
| 253 | 257 | $attributes=[$index]; |
| 254 | - }else{ |
|
| 258 | + } else{ |
|
| 255 | 259 | \array_unshift($attributes, $index); |
| 256 | 260 | } |
| 257 | 261 | \call_user_func_array([$this,$method], $attributes); |