@@ -48,8 +48,9 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function setVariations($variations) { |
| 50 | 50 | $this->_self->setProperty("class", $this->_self->getBaseClass()); |
| 51 | - if (\is_string($variations)) |
|
| 52 | - $variations=\explode(" ", $variations); |
|
| 51 | + if (\is_string($variations)) { |
|
| 52 | + $variations=\explode(" ", $variations); |
|
| 53 | + } |
|
| 53 | 54 | foreach ( $variations as $variation ) { |
| 54 | 55 | $this->_self->addVariation($variation); |
| 55 | 56 | } |
@@ -62,8 +63,9 @@ discard block |
||
| 62 | 63 | } |
| 63 | 64 | |
| 64 | 65 | public function addVariations($variations=array()) { |
| 65 | - if (\is_string($variations)) |
|
| 66 | - $variations=\explode(" ", $variations); |
|
| 66 | + if (\is_string($variations)) { |
|
| 67 | + $variations=\explode(" ", $variations); |
|
| 68 | + } |
|
| 67 | 69 | foreach ( $variations as $variation ) { |
| 68 | 70 | $this->_self->addVariation($variation); |
| 69 | 71 | } |
@@ -71,8 +73,9 @@ discard block |
||
| 71 | 73 | } |
| 72 | 74 | |
| 73 | 75 | public function addStates($states=array()) { |
| 74 | - if (\is_string($states)) |
|
| 75 | - $states=\explode(" ", $states); |
|
| 76 | + if (\is_string($states)) { |
|
| 77 | + $states=\explode(" ", $states); |
|
| 78 | + } |
|
| 76 | 79 | foreach ( $states as $state ) { |
| 77 | 80 | $this->_self->addState($state); |
| 78 | 81 | } |
@@ -81,8 +84,9 @@ discard block |
||
| 81 | 84 | |
| 82 | 85 | public function setStates($states) { |
| 83 | 86 | $this->_self->setProperty("class", $this->_self->getBaseClass()); |
| 84 | - if (\is_string($states)) |
|
| 85 | - $states=\explode(" ", $states); |
|
| 87 | + if (\is_string($states)) { |
|
| 88 | + $states=\explode(" ", $states); |
|
| 89 | + } |
|
| 86 | 90 | foreach ( $states as $state ) { |
| 87 | 91 | $this->_self->addState($state); |
| 88 | 92 | } |
@@ -114,8 +118,9 @@ discard block |
||
| 114 | 118 | * @return HtmlSemDoubleElement |
| 115 | 119 | */ |
| 116 | 120 | public function setDisabled($disable=true) { |
| 117 | - if($disable) |
|
| 118 | - $this->_self->addToProperty("class", "disabled"); |
|
| 121 | + if($disable) { |
|
| 122 | + $this->_self->addToProperty("class", "disabled"); |
|
| 123 | + } |
|
| 119 | 124 | return $this; |
| 120 | 125 | } |
| 121 | 126 | |
@@ -149,14 +154,16 @@ discard block |
||
| 149 | 154 | * @return HtmlSemDoubleElement |
| 150 | 155 | */ |
| 151 | 156 | public function setActive($value=true){ |
| 152 | - if($value) |
|
| 153 | - $this->_self->addToProperty("class", "active"); |
|
| 157 | + if($value) { |
|
| 158 | + $this->_self->addToProperty("class", "active"); |
|
| 159 | + } |
|
| 154 | 160 | return $this; |
| 155 | 161 | } |
| 156 | 162 | |
| 157 | 163 | public function setAttached($value=true){ |
| 158 | - if($value) |
|
| 159 | - $this->_self->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
| 164 | + if($value) { |
|
| 165 | + $this->_self->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
| 166 | + } |
|
| 160 | 167 | return $this; |
| 161 | 168 | } |
| 162 | 169 | |
@@ -166,9 +173,9 @@ discard block |
||
| 166 | 173 | public function setInverted($recursive=true) { |
| 167 | 174 | if($recursive===true){ |
| 168 | 175 | $content=$this->_self->getContent(); |
| 169 | - if($content instanceof HtmlSemDoubleElement) |
|
| 170 | - $content->setInverted($recursive); |
|
| 171 | - elseif(\is_array($content) || $content instanceof \Traversable){ |
|
| 176 | + if($content instanceof HtmlSemDoubleElement) { |
|
| 177 | + $content->setInverted($recursive); |
|
| 178 | + } elseif(\is_array($content) || $content instanceof \Traversable){ |
|
| 172 | 179 | foreach ($content as $elm){ |
| 173 | 180 | if($elm instanceof HtmlSemDoubleElement){ |
| 174 | 181 | $elm->setInverted($recursive); |
@@ -204,9 +211,10 @@ discard block |
||
| 204 | 211 | if(isset($array[$key])){ |
| 205 | 212 | $p=JString::replaceAtFirstAndLast($array[$key], $before, "", $after, ""); |
| 206 | 213 | $array[$key]=$before.$p.$value.$after; |
| 207 | - }else |
|
| 208 | - $array[$key]=$before.$value.$after; |
|
| 209 | - }else{ |
|
| 214 | + } else { |
|
| 215 | + $array[$key]=$before.$value.$after; |
|
| 216 | + } |
|
| 217 | + } else{ |
|
| 210 | 218 | $array[$key]=$value; |
| 211 | 219 | } |
| 212 | 220 | return $this; |
@@ -55,26 +55,29 @@ |
||
| 55 | 55 | for($i=$this->_startStep;$i<$count;$i++){ |
| 56 | 56 | $step=$this->content[$i]; |
| 57 | 57 | $step->removeStatus(); |
| 58 | - if($i<$activestep) |
|
| 59 | - $step->setCompleted(); |
|
| 60 | - elseif ($i===$activestep) |
|
| 61 | - $step->setActive(); |
|
| 62 | - else |
|
| 63 | - $step->setDisabled(); |
|
| 58 | + if($i<$activestep) { |
|
| 59 | + $step->setCompleted(); |
|
| 60 | + } elseif ($i===$activestep) { |
|
| 61 | + $step->setActive(); |
|
| 62 | + } else { |
|
| 63 | + $step->setDisabled(); |
|
| 64 | + } |
|
| 64 | 65 | } |
| 65 | - }else{ |
|
| 66 | + } else{ |
|
| 66 | 67 | foreach ($this->content as $step){ |
| 67 | 68 | $step->removeStatus(); |
| 68 | 69 | } |
| 69 | - if($activestep<$count) |
|
| 70 | - $this->content[$activestep]->setActive(); |
|
| 70 | + if($activestep<$count) { |
|
| 71 | + $this->content[$activestep]->setActive(); |
|
| 72 | + } |
|
| 71 | 73 | } |
| 72 | 74 | return $this; |
| 73 | 75 | } |
| 74 | 76 | |
| 75 | 77 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 76 | - if(isset($this->_activeStep) && \is_numeric($this->_activeStep)) |
|
| 77 | - $this->defineActiveStep(); |
|
| 78 | + if(isset($this->_activeStep) && \is_numeric($this->_activeStep)) { |
|
| 79 | + $this->defineActiveStep(); |
|
| 80 | + } |
|
| 78 | 81 | return parent::compile($js,$view); |
| 79 | 82 | } |
| 80 | 83 | |
@@ -25,8 +25,9 @@ |
||
| 25 | 25 | |
| 26 | 26 | private static function containsElement($input) { |
| 27 | 27 | foreach ( $input as $v ) { |
| 28 | - if (\is_object($v) || \is_array($v)) |
|
| 29 | - return true; |
|
| 28 | + if (\is_object($v) || \is_array($v)) { |
|
| 29 | + return true; |
|
| 30 | + } |
|
| 30 | 31 | } |
| 31 | 32 | return false; |
| 32 | 33 | } |
@@ -23,8 +23,9 @@ discard block |
||
| 23 | 23 | public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") { |
| 24 | 24 | parent::__construct($identifier, $tagName, "ui label"); |
| 25 | 25 | $this->content=$caption; |
| 26 | - if (isset($icon)) |
|
| 27 | - $this->addIcon($icon); |
|
| 26 | + if (isset($icon)) { |
|
| 27 | + $this->addIcon($icon); |
|
| 28 | + } |
|
| 28 | 29 | } |
| 29 | 30 | |
| 30 | 31 | /** |
@@ -33,10 +34,11 @@ discard block |
||
| 33 | 34 | * @return HtmlLabel |
| 34 | 35 | */ |
| 35 | 36 | public function setPointing($value=Direction::NONE) { |
| 36 | - if($value==="left" || $value==="right") |
|
| 37 | - return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
| 38 | - else |
|
| 39 | - return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
| 37 | + if($value==="left" || $value==="right") { |
|
| 38 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
| 39 | + } else { |
|
| 40 | + return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
| 41 | + } |
|
| 40 | 42 | } |
| 41 | 43 | |
| 42 | 44 | /** |
@@ -134,10 +136,11 @@ discard block |
||
| 134 | 136 | } |
| 135 | 137 | |
| 136 | 138 | public function setAttached($side=Side::TOP,$direction=Direction::NONE){ |
| 137 | - if($direction!==Direction::NONE) |
|
| 138 | - return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
| 139 | - else |
|
| 140 | - return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
| 139 | + if($direction!==Direction::NONE) { |
|
| 140 | + return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
| 141 | + } else { |
|
| 142 | + return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
| 143 | + } |
|
| 141 | 144 | } |
| 142 | 145 | |
| 143 | 146 | /** |
@@ -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 | } |