@@ -25,16 +25,17 @@ |
||
| 25 | 25 | if(isset($title)){ |
| 26 | 26 | $this->setTitle($title,$desc); |
| 27 | 27 | } |
| 28 | - }else{ |
|
| 28 | + } else{ |
|
| 29 | 29 | $this->setContent($content); |
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public function setActive($value=true){ |
| 34 | - if($value) |
|
| 35 | - $this->setStatus(StepStatus::ACTIVE); |
|
| 36 | - else |
|
| 37 | - $this->setStatus(StepStatus::NONE); |
|
| 34 | + if($value) { |
|
| 35 | + $this->setStatus(StepStatus::ACTIVE); |
|
| 36 | + } else { |
|
| 37 | + $this->setStatus(StepStatus::NONE); |
|
| 38 | + } |
|
| 38 | 39 | return $this; |
| 39 | 40 | } |
| 40 | 41 | |
@@ -24,8 +24,9 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public function removeIcon(){ |
| 27 | - if(isset($this->content["icon"])) |
|
| 28 | - unset($this->content["icon"]); |
|
| 27 | + if(isset($this->content["icon"])) { |
|
| 28 | + unset($this->content["icon"]); |
|
| 29 | + } |
|
| 29 | 30 | return $this; |
| 30 | 31 | } |
| 31 | 32 | |
@@ -77,7 +78,7 @@ discard block |
||
| 77 | 78 | $this->setTagName("div"); |
| 78 | 79 | $this->removeProperty("href"); |
| 79 | 80 | $this->addToPropertyCtrl("class", "active", array("active")); |
| 80 | - }else{ |
|
| 81 | + } else{ |
|
| 81 | 82 | $this->removePropertyValue("class", "active"); |
| 82 | 83 | } |
| 83 | 84 | return $this; |
@@ -85,8 +86,9 @@ discard block |
||
| 85 | 86 | |
| 86 | 87 | public function asLink($href=NULL,$part=NULL){ |
| 87 | 88 | $this->setTagName("a"); |
| 88 | - if(isset($href)) |
|
| 89 | - $this->setProperty("href", $href); |
|
| 89 | + if(isset($href)) { |
|
| 90 | + $this->setProperty("href", $href); |
|
| 91 | + } |
|
| 90 | 92 | return $this; |
| 91 | 93 | } |
| 92 | 94 | |
@@ -97,8 +99,9 @@ discard block |
||
| 97 | 99 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
| 98 | 100 | */ |
| 99 | 101 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 100 | - if(\is_array($this->content) && JArray::isAssociative($this->content)) |
|
| 101 | - $this->content=JArray::sortAssociative($this->content, [ "right-content","icon","image","content" ]); |
|
| 102 | + if(\is_array($this->content) && JArray::isAssociative($this->content)) { |
|
| 103 | + $this->content=JArray::sortAssociative($this->content, [ "right-content","icon","image","content" ]); |
|
| 104 | + } |
|
| 102 | 105 | return parent::compile($js, $view); |
| 103 | 106 | } |
| 104 | 107 | } |
@@ -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 | |
@@ -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 | } |
@@ -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 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | if(JArray::isAssociative($content)===false){ |
| 18 | 18 | $icon=@$content[0]; |
| 19 | 19 | $title=@$content[1]; |
| 20 | - }else{ |
|
| 20 | + } else{ |
|
| 21 | 21 | $icon=@$content["icon"]; |
| 22 | 22 | $title=@$content["title"]; |
| 23 | 23 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | if(isset($title)){ |
| 28 | 28 | $this->setTitle($title); |
| 29 | 29 | } |
| 30 | - }else{ |
|
| 30 | + } else{ |
|
| 31 | 31 | $this->setContent($content); |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -40,8 +40,9 @@ |
||
| 40 | 40 | * @return HtmlBsDoubleElement default : "list-group-item-default" |
| 41 | 41 | */ |
| 42 | 42 | public function setStyle($cssStyle) { |
| 43 | - if (!JString::startsWith($cssStyle, "list-group-item")) |
|
| 44 | - $cssStyle="list-group-item".$cssStyle; |
|
| 43 | + if (!JString::startsWith($cssStyle, "list-group-item")) { |
|
| 44 | + $cssStyle="list-group-item".$cssStyle; |
|
| 45 | + } |
|
| 45 | 46 | $this->element->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("list-group-item")); |
| 46 | 47 | return $this->element; |
| 47 | 48 | } |