@@ -13,6 +13,9 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class HtmlIconGroups extends HtmlSemCollection { |
| 15 | 15 | |
| 16 | + /** |
|
| 17 | + * @param string $identifier |
|
| 18 | + */ |
|
| 16 | 19 | public function __construct($identifier, $icons=array(), $size="") { |
| 17 | 20 | parent::__construct($identifier, "i", "icons"); |
| 18 | 21 | $this->addItems($icons); |
@@ -50,8 +50,9 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function getProperty($name) { |
| 53 | - if (array_key_exists($name, $this->properties)) |
|
| 54 | - return $this->properties[$name]; |
|
| 53 | + if (array_key_exists($name, $this->properties)) { |
|
| 54 | + return $this->properties[$name]; |
|
| 55 | + } |
|
| 55 | 56 | } |
| 56 | 57 | |
| 57 | 58 | public function addToProperty($name, $value, $separator=" ") { |
@@ -61,10 +62,11 @@ discard block |
||
| 61 | 62 | } |
| 62 | 63 | } else if ($value !== "" && $this->propertyContains($name, $value) === false) { |
| 63 | 64 | $v=@$this->properties[$name]; |
| 64 | - if (isset($v) && $v !== "") |
|
| 65 | - $v=$v . $separator . $value; |
|
| 66 | - else |
|
| 67 | - $v=$value; |
|
| 65 | + if (isset($v) && $v !== "") { |
|
| 66 | + $v=$v . $separator . $value; |
|
| 67 | + } else { |
|
| 68 | + $v=$value; |
|
| 69 | + } |
|
| 68 | 70 | |
| 69 | 71 | return $this->setProperty($name, $v); |
| 70 | 72 | } |
@@ -119,8 +121,9 @@ discard block |
||
| 119 | 121 | } |
| 120 | 122 | |
| 121 | 123 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
| 122 | - if ($this->ctrl($name, $value, $typeCtrl) === true) |
|
| 123 | - return $this->setProperty($name, $value); |
|
| 124 | + if ($this->ctrl($name, $value, $typeCtrl) === true) { |
|
| 125 | + return $this->setProperty($name, $value); |
|
| 126 | + } |
|
| 124 | 127 | return $this; |
| 125 | 128 | } |
| 126 | 129 | |
@@ -150,8 +153,9 @@ discard block |
||
| 150 | 153 | } |
| 151 | 154 | |
| 152 | 155 | public function removeProperty($name) { |
| 153 | - if (\array_key_exists($name, $this->properties)) |
|
| 154 | - unset($this->properties[$name]); |
|
| 156 | + if (\array_key_exists($name, $this->properties)) { |
|
| 157 | + unset($this->properties[$name]); |
|
| 158 | + } |
|
| 155 | 159 | return $this; |
| 156 | 160 | } |
| 157 | 161 | |
@@ -171,8 +175,9 @@ discard block |
||
| 171 | 175 | } |
| 172 | 176 | |
| 173 | 177 | protected function addToPropertyUnique($name, $value, $typeCtrl) { |
| 174 | - if (@class_exists($typeCtrl, true)) |
|
| 175 | - $typeCtrl=$typeCtrl::getConstants(); |
|
| 178 | + if (@class_exists($typeCtrl, true)) { |
|
| 179 | + $typeCtrl=$typeCtrl::getConstants(); |
|
| 180 | + } |
|
| 176 | 181 | if (is_array($typeCtrl)) { |
| 177 | 182 | $this->removeOldValues($this->properties[$name], $typeCtrl); |
| 178 | 183 | } |
@@ -301,7 +306,7 @@ discard block |
||
| 301 | 306 | public function onCreate($jsCode){ |
| 302 | 307 | if(isset($this->_events["_create"])){ |
| 303 | 308 | $this->_events["_create"][]=$jsCode; |
| 304 | - }else{ |
|
| 309 | + } else{ |
|
| 305 | 310 | $this->_events["_create"]=[$jsCode]; |
| 306 | 311 | } |
| 307 | 312 | return $this; |
@@ -313,8 +318,9 @@ discard block |
||
| 313 | 318 | if(\is_array($create)){ |
| 314 | 319 | $create=\implode("", $create); |
| 315 | 320 | } |
| 316 | - if($create!=="") |
|
| 317 | - $js->exec($create,true); |
|
| 321 | + if($create!=="") { |
|
| 322 | + $js->exec($create,true); |
|
| 323 | + } |
|
| 318 | 324 | unset($this->_events["_create"]); |
| 319 | 325 | } |
| 320 | 326 | if (isset($this->_bsComponent)) { |
@@ -376,15 +382,18 @@ discard block |
||
| 376 | 382 | $flag=false; |
| 377 | 383 | $index=0; |
| 378 | 384 | while ( !$flag && $index < sizeof($elements) ) { |
| 379 | - if ($elements[$index] instanceof BaseHtml) |
|
| 380 | - $flag=($elements[$index]->getIdentifier() === $identifier); |
|
| 385 | + if ($elements[$index] instanceof BaseHtml) { |
|
| 386 | + $flag=($elements[$index]->getIdentifier() === $identifier); |
|
| 387 | + } |
|
| 381 | 388 | $index++; |
| 382 | 389 | } |
| 383 | - if ($flag === true) |
|
| 384 | - return $elements[$index - 1]; |
|
| 390 | + if ($flag === true) { |
|
| 391 | + return $elements[$index - 1]; |
|
| 392 | + } |
|
| 385 | 393 | } elseif ($elements instanceof BaseHtml) { |
| 386 | - if ($elements->getIdentifier() === $identifier) |
|
| 387 | - return $elements; |
|
| 394 | + if ($elements->getIdentifier() === $identifier) { |
|
| 395 | + return $elements; |
|
| 396 | + } |
|
| 388 | 397 | } |
| 389 | 398 | return null; |
| 390 | 399 | } |
@@ -394,15 +403,18 @@ discard block |
||
| 394 | 403 | $flag=false; |
| 395 | 404 | $index=0; |
| 396 | 405 | while ( !$flag && $index < sizeof($elements) ) { |
| 397 | - if ($elements[$index] instanceof BaseHtml) |
|
| 398 | - $flag=($elements[$index]->propertyContains($propertyName, $value) === true); |
|
| 406 | + if ($elements[$index] instanceof BaseHtml) { |
|
| 407 | + $flag=($elements[$index]->propertyContains($propertyName, $value) === true); |
|
| 408 | + } |
|
| 399 | 409 | $index++; |
| 400 | 410 | } |
| 401 | - if ($flag === true) |
|
| 402 | - return $elements[$index - 1]; |
|
| 411 | + if ($flag === true) { |
|
| 412 | + return $elements[$index - 1]; |
|
| 413 | + } |
|
| 403 | 414 | } elseif ($elements instanceof BaseHtml) { |
| 404 | - if ($elements->propertyContains($propertyName, $value) === true) |
|
| 405 | - return $elements; |
|
| 415 | + if ($elements->propertyContains($propertyName, $value) === true) { |
|
| 416 | + return $elements; |
|
| 417 | + } |
|
| 406 | 418 | } |
| 407 | 419 | return null; |
| 408 | 420 | } |
@@ -41,10 +41,11 @@ |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function addRule($type,$prompt=NULL,$value=NULL){ |
| 44 | - if($type instanceof Rule) |
|
| 45 | - $this->rules[]=$type; |
|
| 46 | - else |
|
| 47 | - $this->rules[]=new Rule($type,$prompt,$value); |
|
| 44 | + if($type instanceof Rule) { |
|
| 45 | + $this->rules[]=$type; |
|
| 46 | + } else { |
|
| 47 | + $this->rules[]=new Rule($type,$prompt,$value); |
|
| 48 | + } |
|
| 48 | 49 | } |
| 49 | 50 | |
| 50 | 51 | public function jsonSerialize(){ |
@@ -55,10 +55,12 @@ |
||
| 55 | 55 | |
| 56 | 56 | public function jsonSerialize() { |
| 57 | 57 | $result= ["type"=>$this->type]; |
| 58 | - if(isset($this->prompt)) |
|
| 59 | - $result["prompt"]=$this->prompt; |
|
| 60 | - if(isset($this->value)) |
|
| 61 | - $result["value"]=$this->value; |
|
| 58 | + if(isset($this->prompt)) { |
|
| 59 | + $result["prompt"]=$this->prompt; |
|
| 60 | + } |
|
| 61 | + if(isset($this->value)) { |
|
| 62 | + $result["value"]=$this->value; |
|
| 63 | + } |
|
| 62 | 64 | return $result; |
| 63 | 65 | } |
| 64 | 66 | |
@@ -31,8 +31,9 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function htmlMessage($identifier, $content="",$styles=NULL) { |
| 33 | 33 | $msg= $this->addHtmlComponent(new HtmlMessage($identifier, $content)); |
| 34 | - if(isset($msg)) |
|
| 35 | - $msg->setStyle($styles); |
|
| 34 | + if(isset($msg)) { |
|
| 35 | + $msg->setStyle($styles); |
|
| 36 | + } |
|
| 36 | 37 | return $msg; |
| 37 | 38 | } |
| 38 | 39 | |