@@ -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 | } |
@@ -29,8 +29,9 @@ discard block |
||
| 29 | 29 | $this->_colSizing=false; |
| 30 | 30 | $this->setWide($numCols); |
| 31 | 31 | } |
| 32 | - if($createCols) |
|
| 33 | - $this->setRowsCount($numRows, $numCols); |
|
| 32 | + if($createCols) { |
|
| 33 | + $this->setRowsCount($numRows, $numCols); |
|
| 34 | + } |
|
| 34 | 35 | } |
| 35 | 36 | |
| 36 | 37 | public function asSegment() { |
@@ -82,8 +83,9 @@ discard block |
||
| 82 | 83 | public function addCol($width=NULL) { |
| 83 | 84 | $colCount=$this->colCount() + 1; |
| 84 | 85 | $this->setColsCount($colCount, true, $width); |
| 85 | - if ($this->hasOnlyCols($this->count())) |
|
| 86 | - return $this->content[$colCount - 1]; |
|
| 86 | + if ($this->hasOnlyCols($this->count())) { |
|
| 87 | + return $this->content[$colCount - 1]; |
|
| 88 | + } |
|
| 87 | 89 | return $this; |
| 88 | 90 | } |
| 89 | 91 | |
@@ -178,8 +180,9 @@ discard block |
||
| 178 | 180 | */ |
| 179 | 181 | public function rowCount() { |
| 180 | 182 | $count=$this->count(); |
| 181 | - if ($this->hasOnlyCols($count)) |
|
| 182 | - return 0; |
|
| 183 | + if ($this->hasOnlyCols($count)) { |
|
| 184 | + return 0; |
|
| 185 | + } |
|
| 183 | 186 | return $count; |
| 184 | 187 | } |
| 185 | 188 | |
@@ -189,10 +192,12 @@ discard block |
||
| 189 | 192 | */ |
| 190 | 193 | public function colCount() { |
| 191 | 194 | $count=$this->count(); |
| 192 | - if ($this->hasOnlyCols($count)) |
|
| 193 | - return $count; |
|
| 194 | - if ($count > 0) |
|
| 195 | - return $this->getItem(0)->count(); |
|
| 195 | + if ($this->hasOnlyCols($count)) { |
|
| 196 | + return $count; |
|
| 197 | + } |
|
| 198 | + if ($count > 0) { |
|
| 199 | + return $this->getItem(0)->count(); |
|
| 200 | + } |
|
| 196 | 201 | return 0; |
| 197 | 202 | } |
| 198 | 203 | |
@@ -203,8 +208,9 @@ discard block |
||
| 203 | 208 | * @return HtmlGridCol|HtmlGridRow |
| 204 | 209 | */ |
| 205 | 210 | public function getCell($row, $col) { |
| 206 | - if ($row < 2 && $this->hasOnlyCols($this->count())) |
|
| 207 | - return $this->getItem($col); |
|
| 211 | + if ($row < 2 && $this->hasOnlyCols($this->count())) { |
|
| 212 | + return $this->getItem($col); |
|
| 213 | + } |
|
| 208 | 214 | $rowO=$this->getItem($row); |
| 209 | 215 | if (isset($rowO)) { |
| 210 | 216 | $colO=$rowO->getItem($col); |
@@ -253,8 +259,9 @@ discard block |
||
| 253 | 259 | * @return \Ajax\semantic\html\collections\HtmlGrid |
| 254 | 260 | */ |
| 255 | 261 | public function setPadded($value=NULL) { |
| 256 | - if (isset($value)) |
|
| 257 | - $this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" )); |
|
| 262 | + if (isset($value)) { |
|
| 263 | + $this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" )); |
|
| 264 | + } |
|
| 258 | 265 | return $this->addToProperty("class", "padded"); |
| 259 | 266 | } |
| 260 | 267 | |
@@ -279,8 +286,9 @@ discard block |
||
| 279 | 286 | * @see \Ajax\common\html\HtmlCollection::createItem() |
| 280 | 287 | */ |
| 281 | 288 | protected function createItem($value) { |
| 282 | - if ($this->_createCols === false) |
|
| 283 | - $value=null; |
|
| 289 | + if ($this->_createCols === false) { |
|
| 290 | + $value=null; |
|
| 291 | + } |
|
| 284 | 292 | $item=new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $value, $this->_colSizing, $this->_implicitRows); |
| 285 | 293 | return $item; |
| 286 | 294 | } |
@@ -328,8 +336,9 @@ discard block |
||
| 328 | 336 | */ |
| 329 | 337 | public function addDivider($afterColIndex, $vertical=true, $content=NULL) { |
| 330 | 338 | $col=$this->getCell(0, $afterColIndex); |
| 331 | - if($col instanceof HtmlGridCol) |
|
| 332 | - $col->addDivider($vertical, $content); |
|
| 339 | + if($col instanceof HtmlGridCol) { |
|
| 340 | + $col->addDivider($vertical, $content); |
|
| 341 | + } |
|
| 333 | 342 | return $this; |
| 334 | 343 | } |
| 335 | 344 | } |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | public function setFocusable($value=true) { |
| 59 | - if ($value === true) |
|
| 60 | - $this->setProperty("tabindex", "0"); |
|
| 61 | - else { |
|
| 59 | + if ($value === true) { |
|
| 60 | + $this->setProperty("tabindex", "0"); |
|
| 61 | + } else { |
|
| 62 | 62 | $this->removeProperty("tabindex"); |
| 63 | 63 | } |
| 64 | 64 | return $this; |
@@ -106,8 +106,9 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function addLabel($label, $before=false, $icon=NULL) { |
| 108 | 108 | $this->tagName="div";$prefix=""; |
| 109 | - if($before) |
|
| 110 | - $prefix="left "; |
|
| 109 | + if($before) { |
|
| 110 | + $prefix="left "; |
|
| 111 | + } |
|
| 111 | 112 | $this->addToProperty("class", $prefix."labeled"); |
| 112 | 113 | $isIcon=(isset($this->content[0]) && $this->content[0] instanceof HtmlIcon); |
| 113 | 114 | $this->content=new HtmlButton("button-" . $this->identifier, $this->content); |
@@ -144,12 +145,13 @@ discard block |
||
| 144 | 145 | public function setColor($color){ |
| 145 | 146 | if(\is_array($this->content)){ |
| 146 | 147 | foreach ($this->content as $content){ |
| 147 | - if($content instanceof HtmlButton) |
|
| 148 | - $content->setColor($color); |
|
| 148 | + if($content instanceof HtmlButton) { |
|
| 149 | + $content->setColor($color); |
|
| 150 | + } |
|
| 149 | 151 | } |
| 152 | + } else { |
|
| 153 | + parent::setColor($color); |
|
| 150 | 154 | } |
| 151 | - else |
|
| 152 | - parent::setColor($color); |
|
| 153 | 155 | return $this; |
| 154 | 156 | } |
| 155 | 157 | |
@@ -202,8 +204,9 @@ discard block |
||
| 202 | 204 | * @return HtmlButton |
| 203 | 205 | */ |
| 204 | 206 | public static function social($identifier, $social, $value=NULL) { |
| 205 | - if ($value === NULL) |
|
| 206 | - $value=\ucfirst($social); |
|
| 207 | + if ($value === NULL) { |
|
| 208 | + $value=\ucfirst($social); |
|
| 209 | + } |
|
| 207 | 210 | $return=new HtmlButton($identifier, $value); |
| 208 | 211 | $return->addIcon($social); |
| 209 | 212 | return $return->addToPropertyCtrl("class", $social, Social::getConstants()); |
@@ -256,8 +259,9 @@ discard block |
||
| 256 | 259 | public static function dropdown($identifier,$value,$items=[],$asCombo=false,$icon=null){ |
| 257 | 260 | $result=new HtmlButtonGroups($identifier,[$value]); |
| 258 | 261 | $dd=$result->addDropdown($items,$asCombo); |
| 259 | - if(isset($icon) && $dd instanceof HtmlDropdown) |
|
| 260 | - $dd->setIcon($icon); |
|
| 262 | + if(isset($icon) && $dd instanceof HtmlDropdown) { |
|
| 263 | + $dd->setIcon($icon); |
|
| 264 | + } |
|
| 261 | 265 | return $result; |
| 262 | 266 | } |
| 263 | 267 | } |
@@ -18,8 +18,9 @@ discard block |
||
| 18 | 18 | protected $_dropdown; |
| 19 | 19 | public function __construct($identifier, $elements=array(), $asIcons=false) { |
| 20 | 20 | parent::__construct($identifier, "div", "ui buttons"); |
| 21 | - if ($asIcons === true) |
|
| 22 | - $this->asIcons(); |
|
| 21 | + if ($asIcons === true) { |
|
| 22 | + $this->asIcons(); |
|
| 23 | + } |
|
| 23 | 24 | $this->addElements($elements, $asIcons); |
| 24 | 25 | } |
| 25 | 26 | protected function createItem($value){ |
@@ -50,8 +51,9 @@ discard block |
||
| 50 | 51 | */ |
| 51 | 52 | public function addElement($element, $asIcon=false) { |
| 52 | 53 | $item=$this->addItem($element); |
| 53 | - if($asIcon && $item instanceof HtmlButton) |
|
| 54 | - $item->asIcon($element); |
|
| 54 | + if($asIcon && $item instanceof HtmlButton) { |
|
| 55 | + $item->asIcon($element); |
|
| 56 | + } |
|
| 55 | 57 | return $item; |
| 56 | 58 | } |
| 57 | 59 | |
@@ -79,8 +81,9 @@ discard block |
||
| 79 | 81 | |
| 80 | 82 | public function asIcons() { |
| 81 | 83 | foreach ( $this->content as $item ) { |
| 82 | - if($item instanceof HtmlButton) |
|
| 83 | - $item->asIcon($item->getContent()); |
|
| 84 | + if($item instanceof HtmlButton) { |
|
| 85 | + $item->asIcon($item->getContent()); |
|
| 86 | + } |
|
| 84 | 87 | } |
| 85 | 88 | return $this->addToProperty("class", "icons"); |
| 86 | 89 | } |
@@ -92,8 +95,9 @@ discard block |
||
| 92 | 95 | */ |
| 93 | 96 | public function addIcons($icons){ |
| 94 | 97 | foreach ( $this->content as $index=>$item ) { |
| 95 | - if($item instanceof HtmlButton && isset($icons[$index])) |
|
| 96 | - $item->addIcon($icons[$index]); |
|
| 98 | + if($item instanceof HtmlButton && isset($icons[$index])) { |
|
| 99 | + $item->addIcon($icons[$index]); |
|
| 100 | + } |
|
| 97 | 101 | } |
| 98 | 102 | return $this; |
| 99 | 103 | } |
@@ -31,8 +31,9 @@ discard block |
||
| 31 | 31 | if (isset($extra)) { |
| 32 | 32 | $result->addExtraContent($extra); |
| 33 | 33 | } |
| 34 | - } else |
|
| 35 | - $result->addItemContent($value); |
|
| 34 | + } else { |
|
| 35 | + $result->addItemContent($value); |
|
| 36 | + } |
|
| 36 | 37 | return $result; |
| 37 | 38 | } |
| 38 | 39 | |
@@ -58,8 +59,9 @@ discard block |
||
| 58 | 59 | $item=$this->getItem($itemIndex); |
| 59 | 60 | if (isset($item)) { |
| 60 | 61 | $content=$item->getContent(); |
| 61 | - if(isset($content[$contentIndex])) |
|
| 62 | - return $content[$contentIndex]; |
|
| 62 | + if(isset($content[$contentIndex])) { |
|
| 63 | + return $content[$contentIndex]; |
|
| 64 | + } |
|
| 63 | 65 | } |
| 64 | 66 | } |
| 65 | 67 | |
@@ -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="") { |
@@ -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"); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | foreach ($ajaxSubmit as $ajaxSubmitItem){ |
| 50 | 50 | $compilation.=$ajaxSubmitItem->compile($js); |
| 51 | 51 | } |
| 52 | - }elseif($ajaxSubmit instanceof AjaxCall){ |
|
| 52 | + } elseif($ajaxSubmit instanceof AjaxCall){ |
|
| 53 | 53 | $compilation=$ajaxSubmit->compile($js); |
| 54 | 54 | } |
| 55 | 55 | $compilation=str_ireplace("\"","%quote%", $compilation); |
@@ -67,8 +67,9 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | public function setAttached($value=true){ |
| 69 | 69 | $form=$this->getForm(); |
| 70 | - if($value) |
|
| 71 | - $form->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
| 70 | + if($value) { |
|
| 71 | + $form->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
| 72 | + } |
|
| 72 | 73 | return $form; |
| 73 | 74 | } |
| 74 | 75 | |
@@ -90,10 +91,11 @@ discard block |
||
| 90 | 91 | */ |
| 91 | 92 | public function submitOn($event,$identifierOrElement,$url,$responseElement,$parameters=NULL){ |
| 92 | 93 | $form=$this->getForm(); |
| 93 | - if($identifierOrElement instanceof BaseHtml) |
|
| 94 | - $elem=$identifierOrElement; |
|
| 95 | - else |
|
| 96 | - $elem=$form->getElementById($identifierOrElement, $form->getContent()); |
|
| 94 | + if($identifierOrElement instanceof BaseHtml) { |
|
| 95 | + $elem=$identifierOrElement; |
|
| 96 | + } else { |
|
| 97 | + $elem=$form->getElementById($identifierOrElement, $form->getContent()); |
|
| 98 | + } |
|
| 97 | 99 | if(isset($elem)){ |
| 98 | 100 | $this->_buttonAsSubmit($elem, $event,$url,$responseElement,$parameters); |
| 99 | 101 | } |
@@ -123,8 +123,9 @@ |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | public function run(JsUtils $js){ |
| 126 | - if(JString::isNotNull($this->_identifier)) |
|
| 127 | - $js->execOn("click", "#".$this->_identifier." .ui.toggle", 'var active=$(this).hasClass("active");$(this).children("i").toggleClass("up",active).toggleClass("down",!active);var nextTd=$(this).closest("td").next("td");nextTd.children(":not(.toggle-caption)").toggle(active);nextTd.children(".toggle-caption").toggle(!active);$(this).trigger({type:"toggled",active: active,caption: nextTd.children(".toggle-caption")});'); |
|
| 126 | + if(JString::isNotNull($this->_identifier)) { |
|
| 127 | + $js->execOn("click", "#".$this->_identifier." .ui.toggle", 'var active=$(this).hasClass("active");$(this).children("i").toggleClass("up",active).toggleClass("down",!active);var nextTd=$(this).closest("td").next("td");nextTd.children(":not(.toggle-caption)").toggle(active);nextTd.children(".toggle-caption").toggle(!active);$(this).trigger({type:"toggled",active: active,caption: nextTd.children(".toggle-caption")});'); |
|
| 128 | + } |
|
| 128 | 129 | parent::run($js); |
| 129 | 130 | } |
| 130 | 131 | } |
@@ -41,8 +41,9 @@ discard block |
||
| 41 | 41 | * @param string $popupEvent |
| 42 | 42 | */ |
| 43 | 43 | public function setPopupAttributes($variation=NULL, $popupEvent=NULL) { |
| 44 | - if (isset($this->_popup)) |
|
| 45 | - $this->_popup->setAttributes($variation, $popupEvent); |
|
| 44 | + if (isset($this->_popup)) { |
|
| 45 | + $this->_popup->setAttributes($variation, $popupEvent); |
|
| 46 | + } |
|
| 46 | 47 | } |
| 47 | 48 | |
| 48 | 49 | /** |
@@ -97,8 +98,9 @@ discard block |
||
| 97 | 98 | $labelO=$label; |
| 98 | 99 | if (\is_object($label) === false) { |
| 99 | 100 | $labelO=new HtmlLabel("label-" . $this->identifier, $label); |
| 100 | - if (isset($icon)) |
|
| 101 | - $labelO->addIcon($icon); |
|
| 101 | + if (isset($icon)) { |
|
| 102 | + $labelO->addIcon($icon); |
|
| 103 | + } |
|
| 102 | 104 | } else { |
| 103 | 105 | $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
| 104 | 106 | } |
@@ -125,10 +127,12 @@ discard block |
||
| 125 | 127 | * @return HtmlSemDoubleElement |
| 126 | 128 | */ |
| 127 | 129 | public function asLink($href=NULL,$target=NULL) { |
| 128 | - if (isset($href)) |
|
| 129 | - $this->setProperty("href", $href); |
|
| 130 | - if(isset($target)) |
|
| 131 | - $this->setProperty("target", $target); |
|
| 130 | + if (isset($href)) { |
|
| 131 | + $this->setProperty("href", $href); |
|
| 132 | + } |
|
| 133 | + if(isset($target)) { |
|
| 134 | + $this->setProperty("target", $target); |
|
| 135 | + } |
|
| 132 | 136 | return $this->setTagName("a"); |
| 133 | 137 | } |
| 134 | 138 | |
@@ -139,8 +143,9 @@ discard block |
||
| 139 | 143 | */ |
| 140 | 144 | public function jsShowDimmer($show=true) { |
| 141 | 145 | $status="hide"; |
| 142 | - if ($show === true) |
|
| 143 | - $status="show"; |
|
| 146 | + if ($show === true) { |
|
| 147 | + $status="show"; |
|
| 148 | + } |
|
| 144 | 149 | return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
| 145 | 150 | } |
| 146 | 151 | |