@@ -15,14 +15,15 @@ discard block |
||
| 15 | 15 | $field=new \Ajax\common\html\html5\HtmlInput($identifier, $inputType, $value); |
| 16 | 16 | $field->setProperty("name", $name); |
| 17 | 17 | $this->setField($field); |
| 18 | - if (isset($label)) |
|
| 19 | - $this->setLabel($label,$value); |
|
| 18 | + if (isset($label)) { |
|
| 19 | + $this->setLabel($label,$value); |
|
| 20 | + } |
|
| 20 | 21 | } |
| 21 | 22 | |
| 22 | 23 | public function setChecked($value=true){ |
| 23 | 24 | if($value===true){ |
| 24 | 25 | $this->getField()->setProperty("checked", "checked"); |
| 25 | - }else{ |
|
| 26 | + } else{ |
|
| 26 | 27 | $this->getField()->removeProperty("checked"); |
| 27 | 28 | } |
| 28 | 29 | return $this; |
@@ -38,8 +39,9 @@ discard block |
||
| 38 | 39 | $labelO=new HtmlSemDoubleElement("", "label", ""); |
| 39 | 40 | $labelO->setContent($label); |
| 40 | 41 | $labelO->setProperty("for", $this->getField()->getIdentifier()); |
| 41 | - if(isset($value)) |
|
| 42 | - $labelO->setProperty("data-value", $value); |
|
| 42 | + if(isset($value)) { |
|
| 43 | + $labelO->setProperty("data-value", $value); |
|
| 44 | + } |
|
| 43 | 45 | } |
| 44 | 46 | $this->content["label"]=$labelO; |
| 45 | 47 | } |
@@ -53,8 +55,9 @@ discard block |
||
| 53 | 55 | * @return mixed |
| 54 | 56 | */ |
| 55 | 57 | public function getLabel() { |
| 56 | - if (\array_key_exists("label", $this->content)) |
|
| 57 | - return $this->content["label"]; |
|
| 58 | + if (\array_key_exists("label", $this->content)) { |
|
| 59 | + return $this->content["label"]; |
|
| 60 | + } |
|
| 58 | 61 | } |
| 59 | 62 | |
| 60 | 63 | /** |
@@ -129,8 +132,9 @@ discard block |
||
| 129 | 132 | } |
| 130 | 133 | |
| 131 | 134 | public function run(JsUtils $js) { |
| 132 | - if(!isset($this->_bsComponent)) |
|
| 133 | - $this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params); |
|
| 135 | + if(!isset($this->_bsComponent)) { |
|
| 136 | + $this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params); |
|
| 137 | + } |
|
| 134 | 138 | return parent::run($js); |
| 135 | 139 | } |
| 136 | 140 | } |
@@ -14,8 +14,9 @@ |
||
| 14 | 14 | class DialogButton extends BaseComponent { |
| 15 | 15 | |
| 16 | 16 | private function addFunction($jsCode) { |
| 17 | - if (!JString::startsWith($jsCode, "function")) |
|
| 18 | - $jsCode="%function(){" . $jsCode . "}%"; |
|
| 17 | + if (!JString::startsWith($jsCode, "function")) { |
|
| 18 | + $jsCode="%function(){" . $jsCode . "}%"; |
|
| 19 | + } |
|
| 19 | 20 | return $jsCode; |
| 20 | 21 | } |
| 21 | 22 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | public function addItem($caption, $href="#") { |
| 91 | 91 | if($caption instanceof HtmlDropdownItem){ |
| 92 | 92 | $item=$caption; |
| 93 | - }else{ |
|
| 93 | + } else{ |
|
| 94 | 94 | $iid=$this->getItemsCount()+1; |
| 95 | 95 | $item=new HtmlDropdownItem($this->identifier."-dropdown-item-".$iid); |
| 96 | 96 | $item->setCaption($caption)->setHref($href); |
@@ -130,10 +130,11 @@ discard block |
||
| 130 | 130 | * @see BaseHtml::fromArray() |
| 131 | 131 | */ |
| 132 | 132 | public function fromArray($array) { |
| 133 | - if (array_keys($array)!==range(0, count($array)-1)) |
|
| 134 | - return parent::fromArray($array); |
|
| 135 | - else |
|
| 136 | - return $this->addItems($array); |
|
| 133 | + if (array_keys($array)!==range(0, count($array)-1)) { |
|
| 134 | + return parent::fromArray($array); |
|
| 135 | + } else { |
|
| 136 | + return $this->addItems($array); |
|
| 137 | + } |
|
| 137 | 138 | } |
| 138 | 139 | |
| 139 | 140 | public function setItems($items) { |
@@ -186,8 +187,9 @@ discard block |
||
| 186 | 187 | * @see BaseHtml::setTagName() |
| 187 | 188 | */ |
| 188 | 189 | public function setTagName($tagName) { |
| 189 | - if ($tagName=="button") |
|
| 190 | - $this->class="btn dropdown-toggle"; |
|
| 190 | + if ($tagName=="button") { |
|
| 191 | + $this->class="btn dropdown-toggle"; |
|
| 192 | + } |
|
| 191 | 193 | return parent::setTagName($tagName); |
| 192 | 194 | } |
| 193 | 195 | |
@@ -205,8 +207,9 @@ discard block |
||
| 205 | 207 | } |
| 206 | 208 | |
| 207 | 209 | public function setAlignment($alignment) { |
| 208 | - if (is_int($alignment)) |
|
| 209 | - $alignment="dropdown-menu-".CssRef::alignment()[$alignment]; |
|
| 210 | + if (is_int($alignment)) { |
|
| 211 | + $alignment="dropdown-menu-".CssRef::alignment()[$alignment]; |
|
| 212 | + } |
|
| 210 | 213 | return $this->addToMemberCtrl($this->class, $alignment, CssRef::alignment()); |
| 211 | 214 | } |
| 212 | 215 | |
@@ -52,10 +52,11 @@ discard block |
||
| 52 | 52 | $this->from=$from; |
| 53 | 53 | $this->to=$to; |
| 54 | 54 | $this->urlMask="%page%"; |
| 55 | - if(!isset($countVisible)) |
|
| 56 | - $this->countVisible=$to-$from+1; |
|
| 57 | - else |
|
| 58 | - $this->countVisible=$countVisible; |
|
| 55 | + if(!isset($countVisible)) { |
|
| 56 | + $this->countVisible=$to-$from+1; |
|
| 57 | + } else { |
|
| 58 | + $this->countVisible=$countVisible; |
|
| 59 | + } |
|
| 59 | 60 | $this->createContent(); |
| 60 | 61 | } |
| 61 | 62 | |
@@ -74,7 +75,7 @@ discard block |
||
| 74 | 75 | $href=new HtmlLink("a-".$this->identifier."-".$count,$url,$content); |
| 75 | 76 | $href->setProperty($this->attr, $url); |
| 76 | 77 | $elem->setContent($href); |
| 77 | - }else{ |
|
| 78 | + } else{ |
|
| 78 | 79 | $elem->setContent($content); |
| 79 | 80 | } |
| 80 | 81 | $this->content[]=$elem; |
@@ -107,8 +108,9 @@ discard block |
||
| 107 | 108 | public function _addEvent($event, $jsCode) { |
| 108 | 109 | foreach ($this->content as $li){ |
| 109 | 110 | $content=$li->getContent(); |
| 110 | - if($content instanceof BaseHtml) |
|
| 111 | - $content->_addEvent($event,$jsCode); |
|
| 111 | + if($content instanceof BaseHtml) { |
|
| 112 | + $content->_addEvent($event,$jsCode); |
|
| 113 | + } |
|
| 112 | 114 | } |
| 113 | 115 | } |
| 114 | 116 | /** |
@@ -146,8 +148,9 @@ discard block |
||
| 146 | 148 | if (is_int($size)) { |
| 147 | 149 | return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination")); |
| 148 | 150 | } |
| 149 | - if(!JString::startsWith($size, "pagination-") && $size!=="") |
|
| 150 | - $size="pagination-".$size; |
|
| 151 | + if(!JString::startsWith($size, "pagination-") && $size!=="") { |
|
| 152 | + $size="pagination-".$size; |
|
| 153 | + } |
|
| 151 | 154 | return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination")); |
| 152 | 155 | } |
| 153 | 156 | |
@@ -33,8 +33,9 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function getProperty($name) { |
| 36 | - if (array_key_exists($name, $this->_self->properties)) |
|
| 37 | - return $this->_self->properties[$name]; |
|
| 36 | + if (array_key_exists($name, $this->_self->properties)) { |
|
| 37 | + return $this->_self->properties[$name]; |
|
| 38 | + } |
|
| 38 | 39 | } |
| 39 | 40 | |
| 40 | 41 | /** |
@@ -51,10 +52,11 @@ discard block |
||
| 51 | 52 | } else if ($value !== "" && $this->_self->propertyContains($name, $value) === false) { |
| 52 | 53 | if(isset($this->_self->properties[$name])){ |
| 53 | 54 | $v=$this->_self->properties[$name]; |
| 54 | - if (isset($v) && $v !== "") |
|
| 55 | - $v=$v . $separator . $value; |
|
| 56 | - else |
|
| 57 | - $v=$value; |
|
| 55 | + if (isset($v) && $v !== "") { |
|
| 56 | + $v=$v . $separator . $value; |
|
| 57 | + } else { |
|
| 58 | + $v=$value; |
|
| 59 | + } |
|
| 58 | 60 | |
| 59 | 61 | return $this->_self->setProperty($name, $v); |
| 60 | 62 | } |
@@ -78,8 +80,9 @@ discard block |
||
| 78 | 80 | } |
| 79 | 81 | |
| 80 | 82 | protected function addToPropertyUnique($name, $value, $typeCtrl) { |
| 81 | - if (is_string($typeCtrl) && @class_exists($typeCtrl, true)) |
|
| 82 | - $typeCtrl=$typeCtrl::getConstants(); |
|
| 83 | + if (is_string($typeCtrl) && @class_exists($typeCtrl, true)) { |
|
| 84 | + $typeCtrl=$typeCtrl::getConstants(); |
|
| 85 | + } |
|
| 83 | 86 | if (\is_array($typeCtrl)) { |
| 84 | 87 | $this->_self->removeOldValues($this->_self->properties[$name], $typeCtrl); |
| 85 | 88 | } |
@@ -98,8 +101,9 @@ discard block |
||
| 98 | 101 | } |
| 99 | 102 | |
| 100 | 103 | public function removeProperty($name) { |
| 101 | - if (\array_key_exists($name, $this->_self->properties)) |
|
| 102 | - unset($this->_self->properties[$name]); |
|
| 104 | + if (\array_key_exists($name, $this->_self->properties)) { |
|
| 105 | + unset($this->_self->properties[$name]); |
|
| 106 | + } |
|
| 103 | 107 | return $this; |
| 104 | 108 | } |
| 105 | 109 | |
@@ -112,8 +116,9 @@ discard block |
||
| 112 | 116 | } |
| 113 | 117 | |
| 114 | 118 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
| 115 | - if ($this->_self->ctrl($name, $value, $typeCtrl) === true) |
|
| 116 | - return $this->_self->setProperty($name, $value); |
|
| 119 | + if ($this->_self->ctrl($name, $value, $typeCtrl) === true) { |
|
| 120 | + return $this->_self->setProperty($name, $value); |
|
| 121 | + } |
|
| 117 | 122 | return $this; |
| 118 | 123 | } |
| 119 | 124 | |
@@ -89,8 +89,9 @@ discard block |
||
| 89 | 89 | * @return \Ajax\bootstrap\html\HtmlPanel default : "panel-default" |
| 90 | 90 | */ |
| 91 | 91 | public function setStyle($cssStyle) { |
| 92 | - if (!JString::startsWith($cssStyle, "panel")) |
|
| 93 | - $cssStyle="panel".$cssStyle; |
|
| 92 | + if (!JString::startsWith($cssStyle, "panel")) { |
|
| 93 | + $cssStyle="panel".$cssStyle; |
|
| 94 | + } |
|
| 94 | 95 | return $this->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("panel")); |
| 95 | 96 | } |
| 96 | 97 | |
@@ -132,7 +133,8 @@ discard block |
||
| 132 | 133 | * @return $this default : false |
| 133 | 134 | */ |
| 134 | 135 | public function show($value) { |
| 135 | - if ($this->_collapsable) |
|
| 136 | - $this->_showOnStartup=$value; |
|
| 136 | + if ($this->_collapsable) { |
|
| 137 | + $this->_showOnStartup=$value; |
|
| 138 | + } |
|
| 137 | 139 | } |
| 138 | 140 | } |
@@ -25,8 +25,9 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) { |
| 27 | 27 | parent::__construct($identifier, $tagName, ""); |
| 28 | - if (isset($rowCount) && isset($colCount)) |
|
| 29 | - $this->setRowCount($rowCount, $colCount); |
|
| 28 | + if (isset($rowCount) && isset($colCount)) { |
|
| 29 | + $this->setRowCount($rowCount, $colCount); |
|
| 30 | + } |
|
| 30 | 31 | } |
| 31 | 32 | |
| 32 | 33 | /** |
@@ -102,7 +103,7 @@ discard block |
||
| 102 | 103 | $row=$this->getItem($row); |
| 103 | 104 | if (isset($row) && $row instanceof HtmlCollection) { |
| 104 | 105 | $col=$row->getItem($col); |
| 105 | - }else{ |
|
| 106 | + } else{ |
|
| 106 | 107 | $col=$row; |
| 107 | 108 | } |
| 108 | 109 | return $col; |
@@ -160,8 +161,9 @@ discard block |
||
| 160 | 161 | $values=\array_fill(0, $count, $values); |
| 161 | 162 | $isArray=false; |
| 162 | 163 | } |
| 163 | - if (JArray::dimension($values) == 1 && $isArray) |
|
| 164 | - $values=[ $values ]; |
|
| 164 | + if (JArray::dimension($values) == 1 && $isArray) { |
|
| 165 | + $values=[ $values ]; |
|
| 166 | + } |
|
| 165 | 167 | |
| 166 | 168 | $count=\min(\sizeof($values), $count); |
| 167 | 169 | |
@@ -205,8 +207,9 @@ discard block |
||
| 205 | 207 | $count=$this->count(); |
| 206 | 208 | for($i=0; $i < $count; $i++) { |
| 207 | 209 | $index=$this->content[$i]->getColPosition($colIndex); |
| 208 | - if ($index !== NULL) |
|
| 209 | - $this->getCell($i, $index)->$function(); |
|
| 210 | + if ($index !== NULL) { |
|
| 211 | + $this->getCell($i, $index)->$function(); |
|
| 212 | + } |
|
| 210 | 213 | } |
| 211 | 214 | return $this; |
| 212 | 215 | } |
@@ -237,8 +240,9 @@ discard block |
||
| 237 | 240 | */ |
| 238 | 241 | public function getColCount() { |
| 239 | 242 | $result=0; |
| 240 | - if ($this->count() > 0) |
|
| 241 | - $result=$this->getItem(0)->count(); |
|
| 243 | + if ($this->count() > 0) { |
|
| 244 | + $result=$this->getItem(0)->count(); |
|
| 245 | + } |
|
| 242 | 246 | return $result; |
| 243 | 247 | } |
| 244 | 248 | |
@@ -262,8 +266,9 @@ discard block |
||
| 262 | 266 | |
| 263 | 267 | public function toDelete($rowIndex, $colIndex){ |
| 264 | 268 | $row=$this->getItem($rowIndex); |
| 265 | - if (isset($row) === true) |
|
| 266 | - $row->toDelete($colIndex); |
|
| 269 | + if (isset($row) === true) { |
|
| 270 | + $row->toDelete($colIndex); |
|
| 271 | + } |
|
| 267 | 272 | return $this; |
| 268 | 273 | } |
| 269 | 274 | |
@@ -361,8 +366,9 @@ discard block |
||
| 361 | 366 | foreach ( $rows as $row ) { |
| 362 | 367 | $cell=$row->getItem($colIndex); |
| 363 | 368 | $value=$cell->getContent(); |
| 364 | - if($functionExists) |
|
| 365 | - $value=\call_user_func($function,$value); |
|
| 369 | + if($functionExists) { |
|
| 370 | + $value=\call_user_func($function,$value); |
|
| 371 | + } |
|
| 366 | 372 | if($value!==$identiqual){ |
| 367 | 373 | if($counter>0 && isset($cellToMerge)){ |
| 368 | 374 | $cellToMerge->setRowspan($counter); |
@@ -250,8 +250,9 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | public function addItemInToolbar($caption,$icon=NULL,$callback=NULL){ |
| 252 | 252 | $result=$this->addInToolbar($caption,$callback); |
| 253 | - if(isset($icon) && method_exists($result, "addIcon")) |
|
| 254 | - $result->addIcon($icon); |
|
| 253 | + if(isset($icon) && method_exists($result, "addIcon")) { |
|
| 254 | + $result->addIcon($icon); |
|
| 255 | + } |
|
| 255 | 256 | return $result; |
| 256 | 257 | } |
| 257 | 258 | |
@@ -265,7 +266,7 @@ discard block |
||
| 265 | 266 | foreach ($items as $icon=>$item){ |
| 266 | 267 | $this->addItemInToolbar($item,$icon,$callback); |
| 267 | 268 | } |
| 268 | - }else{ |
|
| 269 | + } else{ |
|
| 269 | 270 | foreach ($items as $item){ |
| 270 | 271 | $this->addItemInToolbar($item,null,$callback); |
| 271 | 272 | } |
@@ -416,8 +417,9 @@ discard block |
||
| 416 | 417 | protected function _compileForm(){ |
| 417 | 418 | if(isset($this->_form)){ |
| 418 | 419 | $noValidate=""; |
| 419 | - if(\sizeof($this->_form->getValidationParams())>0) |
|
| 420 | - $noValidate="novalidate"; |
|
| 420 | + if(\sizeof($this->_form->getValidationParams())>0) { |
|
| 421 | + $noValidate="novalidate"; |
|
| 422 | + } |
|
| 421 | 423 | $this->wrapContent("<form class='ui form' id='frm-".$this->identifier."' name='frm-".$this->identifier."' ".$noValidate.">","</form>"); |
| 422 | 424 | } |
| 423 | 425 | } |
@@ -63,15 +63,17 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | private function getFieldButton($caption,$visibleHover=true){ |
| 65 | 65 | $bt= new HtmlButton($this->cleanIdentifier($caption),$caption); |
| 66 | - if($visibleHover) |
|
| 67 | - $this->_visibleOver($bt); |
|
| 66 | + if($visibleHover) { |
|
| 67 | + $this->_visibleOver($bt); |
|
| 68 | + } |
|
| 68 | 69 | return $bt; |
| 69 | 70 | } |
| 70 | 71 | |
| 71 | 72 | private function getFieldButtons($buttons,$visibleHover=true){ |
| 72 | 73 | $bts=new HtmlButtonGroups("",$buttons); |
| 73 | - if($visibleHover) |
|
| 74 | - $this->_visibleOver($bts); |
|
| 74 | + if($visibleHover) { |
|
| 75 | + $this->_visibleOver($bts); |
|
| 76 | + } |
|
| 75 | 77 | return $bts; |
| 76 | 78 | } |
| 77 | 79 | |
@@ -88,8 +90,9 @@ discard block |
||
| 88 | 90 | return $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$attributes){ |
| 89 | 91 | $button=new HtmlButton($id,$value,$cssStyle); |
| 90 | 92 | $button->postOnClick($url,"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes["ajax"]); |
| 91 | - if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) |
|
| 92 | - $this->_visibleOver($button); |
|
| 93 | + if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) { |
|
| 94 | + $this->_visibleOver($button); |
|
| 95 | + } |
|
| 93 | 96 | return $button; |
| 94 | 97 | }, $index,$attributes); |
| 95 | 98 | } |
@@ -160,8 +163,9 @@ discard block |
||
| 160 | 163 | private function getDefaultButton($icon,$class=null,$visibleHover=true){ |
| 161 | 164 | $bt=$this->getFieldButton("",$visibleHover); |
| 162 | 165 | $bt->asIcon($icon); |
| 163 | - if(isset($class)) |
|
| 164 | - $bt->addClass($class); |
|
| 166 | + if(isset($class)) { |
|
| 167 | + $bt->addClass($class); |
|
| 168 | + } |
|
| 165 | 169 | return $bt; |
| 166 | 170 | } |
| 167 | 171 | |