@@ -10,8 +10,9 @@ |
||
| 10 | 10 | |
| 11 | 11 | public function __construct($identifier,$context=NULL,$content=NULL) { |
| 12 | 12 | parent::__construct($identifier, "div", "ui sticky", $content); |
| 13 | - if(isset($content)) |
|
| 14 | - $this->setContext($context); |
|
| 13 | + if(isset($content)) { |
|
| 14 | + $this->setContext($context); |
|
| 15 | + } |
|
| 15 | 16 | } |
| 16 | 17 | |
| 17 | 18 | public function setContext($context){ |
@@ -12,8 +12,9 @@ discard block |
||
| 12 | 12 | $image=new HtmlImg("img-", $src, $alt); |
| 13 | 13 | $image->setClass(""); |
| 14 | 14 | parent::__construct($identifier, "div", "ui image", $image); |
| 15 | - if (isset($size)) |
|
| 16 | - $this->setSize($size); |
|
| 15 | + if (isset($size)) { |
|
| 16 | + $this->setSize($size); |
|
| 17 | + } |
|
| 17 | 18 | } |
| 18 | 19 | |
| 19 | 20 | public function setCircular() { |
@@ -21,8 +22,9 @@ discard block |
||
| 21 | 22 | } |
| 22 | 23 | |
| 23 | 24 | public function asAvatar($caption=NULL) { |
| 24 | - if (isset($caption)) |
|
| 25 | - $this->wrap("", $caption); |
|
| 25 | + if (isset($caption)) { |
|
| 26 | + $this->wrap("", $caption); |
|
| 27 | + } |
|
| 26 | 28 | return $this->addToProperty("class", "avatar"); |
| 27 | 29 | } |
| 28 | 30 | |
@@ -102,8 +102,9 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function setBordered($inverted=false) { |
| 104 | 104 | $invertedStr=""; |
| 105 | - if ($inverted !== false) |
|
| 106 | - $invertedStr=" inverted"; |
|
| 105 | + if ($inverted !== false) { |
|
| 106 | + $invertedStr=" inverted"; |
|
| 107 | + } |
|
| 107 | 108 | return $this->addToProperty("class", "bordered" . $invertedStr); |
| 108 | 109 | } |
| 109 | 110 | |
@@ -116,12 +117,14 @@ discard block |
||
| 116 | 117 | } |
| 117 | 118 | |
| 118 | 119 | public function addLabel($label, $before=false, $icon=NULL) { |
| 119 | - if($before) |
|
| 120 | - $this->wrap($label); |
|
| 121 | - else |
|
| 122 | - $this->wrap("", $label); |
|
| 123 | - if(isset($icon)) |
|
| 124 | - $this->addToIcon($icon); |
|
| 120 | + if($before) { |
|
| 121 | + $this->wrap($label); |
|
| 122 | + } else { |
|
| 123 | + $this->wrap("", $label); |
|
| 124 | + } |
|
| 125 | + if(isset($icon)) { |
|
| 126 | + $this->addToIcon($icon); |
|
| 127 | + } |
|
| 125 | 128 | return $this; |
| 126 | 129 | } |
| 127 | 130 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | } |
| 24 | 24 | if($content instanceof HtmlSemDoubleElement){ |
| 25 | 25 | $content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content); |
| 26 | - }elseif ($content instanceof HtmlImg){ |
|
| 26 | + } elseif ($content instanceof HtmlImg){ |
|
| 27 | 27 | $this->addToPropertyCtrl("class", "image", array("image")); |
| 28 | 28 | } |
| 29 | 29 | $content->addToProperty("class",(($index===0)?"visible":"hidden")." content"); |
@@ -19,8 +19,9 @@ |
||
| 19 | 19 | if (isset($type)) { |
| 20 | 20 | if ($type == "page") { |
| 21 | 21 | $this->asPageHeader($niveau); |
| 22 | - } else |
|
| 23 | - $this->asContentHeader($niveau); |
|
| 22 | + } else { |
|
| 23 | + $this->asContentHeader($niveau); |
|
| 24 | + } |
|
| 24 | 25 | } |
| 25 | 26 | $this->content=$content; |
| 26 | 27 | } |
@@ -31,8 +31,9 @@ discard block |
||
| 31 | 31 | protected function createTitleElement(){ |
| 32 | 32 | $element=new HtmlSemDoubleElement("title-".$this->identifier,"div","title"); |
| 33 | 33 | $element->setContent(array(new HtmlIcon("", $this->_icon),$this->_title)); |
| 34 | - if($this->_active===true) |
|
| 35 | - $element->addToProperty("class", "active"); |
|
| 34 | + if($this->_active===true) { |
|
| 35 | + $element->addToProperty("class", "active"); |
|
| 36 | + } |
|
| 36 | 37 | return $element; |
| 37 | 38 | } |
| 38 | 39 | |
@@ -43,10 +44,11 @@ discard block |
||
| 43 | 44 | |
| 44 | 45 | public function setActive($value=true){ |
| 45 | 46 | $this->_active=$value; |
| 46 | - if($value===true) |
|
| 47 | - $this->addToPropertyCtrl("class", "active", array("active")); |
|
| 48 | - else |
|
| 49 | - $this->removePropertyValue("class", "active"); |
|
| 47 | + if($value===true) { |
|
| 48 | + $this->addToPropertyCtrl("class", "active", array("active")); |
|
| 49 | + } else { |
|
| 50 | + $this->removePropertyValue("class", "active"); |
|
| 51 | + } |
|
| 50 | 52 | return $this; |
| 51 | 53 | } |
| 52 | 54 | } |
| 53 | 55 | \ No newline at end of file |
@@ -34,8 +34,9 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function addImage($src="", $alt="", $size=NULL) { |
| 36 | 36 | $image=new HtmlImg("img-", $src, $alt); |
| 37 | - if (isset($size)) |
|
| 38 | - $image->setSize($size); |
|
| 37 | + if (isset($size)) { |
|
| 38 | + $image->setSize($size); |
|
| 39 | + } |
|
| 39 | 40 | $this->content["image"]=$image; |
| 40 | 41 | return $image; |
| 41 | 42 | } |
@@ -45,8 +46,9 @@ discard block |
||
| 45 | 46 | foreach ( $metas as $meta ) { |
| 46 | 47 | $this->addMeta($meta); |
| 47 | 48 | } |
| 48 | - } else |
|
| 49 | - $this->addMeta($metas); |
|
| 49 | + } else { |
|
| 50 | + $this->addMeta($metas); |
|
| 51 | + } |
|
| 50 | 52 | return $this; |
| 51 | 53 | } |
| 52 | 54 | |
@@ -73,8 +75,9 @@ discard block |
||
| 73 | 75 | $result=new HtmlSemDoubleElement("", "span", "", $caption); |
| 74 | 76 | $this->addContent($result); |
| 75 | 77 | $result->setFloated($direction); |
| 76 | - } else |
|
| 77 | - $result=$this->addContent($caption); |
|
| 78 | + } else { |
|
| 79 | + $result=$this->addContent($caption); |
|
| 80 | + } |
|
| 78 | 81 | return $result; |
| 79 | 82 | } |
| 80 | 83 | |
@@ -105,17 +105,20 @@ discard block |
||
| 105 | 105 | $max=\min($colIndex, $rows[$i]->count()); |
| 106 | 106 | for($j=0; $j < $max; $j++) { |
| 107 | 107 | $rowspan=$rows[$i]->getItem($j)->getRowspan(); |
| 108 | - if ($rowspan + $i > $this->_row) |
|
| 109 | - $pos++; |
|
| 108 | + if ($rowspan + $i > $this->_row) { |
|
| 109 | + $pos++; |
|
| 110 | + } |
|
| 110 | 111 | } |
| 111 | 112 | } |
| 112 | - if ($pos > $colIndex) |
|
| 113 | - return NULL; |
|
| 113 | + if ($pos > $colIndex) { |
|
| 114 | + return NULL; |
|
| 115 | + } |
|
| 114 | 116 | $count=$this->count(); |
| 115 | 117 | for($i=0; $i < $count; $i++) { |
| 116 | 118 | $pos+=$this->content[$i]->getColspan(); |
| 117 | - if ($pos >= $colIndex + 1) |
|
| 118 | - return $i; |
|
| 119 | + if ($pos >= $colIndex + 1) { |
|
| 120 | + return $i; |
|
| 121 | + } |
|
| 119 | 122 | } |
| 120 | 123 | return null; |
| 121 | 124 | } |
@@ -138,8 +141,9 @@ discard block |
||
| 138 | 141 | public function containsStr($needle) { |
| 139 | 142 | $cells=$this->content; |
| 140 | 143 | foreach ( $cells as $cell ) { |
| 141 | - if (\strpos($cell->getContent(), $needle) !== false) |
|
| 142 | - return true; |
|
| 144 | + if (\strpos($cell->getContent(), $needle) !== false) { |
|
| 145 | + return true; |
|
| 146 | + } |
|
| 143 | 147 | } |
| 144 | 148 | return false; |
| 145 | 149 | } |
@@ -22,8 +22,9 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) { |
| 24 | 24 | parent::__construct($identifier, $tagName, ""); |
| 25 | - if (isset($rowCount) && isset($colCount)) |
|
| 26 | - $this->setRowCount($rowCount, $colCount); |
|
| 25 | + if (isset($rowCount) && isset($colCount)) { |
|
| 26 | + $this->setRowCount($rowCount, $colCount); |
|
| 27 | + } |
|
| 27 | 28 | } |
| 28 | 29 | |
| 29 | 30 | /** |
@@ -129,8 +130,9 @@ discard block |
||
| 129 | 130 | $values=\array_fill(0, $count, $values); |
| 130 | 131 | $isArray=false; |
| 131 | 132 | } |
| 132 | - if (JArray::dimension($values) == 1 && $isArray) |
|
| 133 | - $values=[ $values ]; |
|
| 133 | + if (JArray::dimension($values) == 1 && $isArray) { |
|
| 134 | + $values=[ $values ]; |
|
| 135 | + } |
|
| 134 | 136 | |
| 135 | 137 | $count=\min(\sizeof($values), $count); |
| 136 | 138 | |
@@ -174,8 +176,9 @@ discard block |
||
| 174 | 176 | $count=$this->count(); |
| 175 | 177 | for($i=0; $i < $count; $i++) { |
| 176 | 178 | $index=$this->content[$i]->getColPosition($colIndex); |
| 177 | - if ($index !== NULL) |
|
| 178 | - $this->getCell($i, $index)->$function(); |
|
| 179 | + if ($index !== NULL) { |
|
| 180 | + $this->getCell($i, $index)->$function(); |
|
| 181 | + } |
|
| 179 | 182 | } |
| 180 | 183 | return $this; |
| 181 | 184 | } |
@@ -206,8 +209,9 @@ discard block |
||
| 206 | 209 | */ |
| 207 | 210 | public function getColCount() { |
| 208 | 211 | $result=0; |
| 209 | - if ($this->count() > 0) |
|
| 210 | - $result=$this->getItem(0)->getColCount(); |
|
| 212 | + if ($this->count() > 0) { |
|
| 213 | + $result=$this->getItem(0)->getColCount(); |
|
| 214 | + } |
|
| 211 | 215 | return $result; |
| 212 | 216 | } |
| 213 | 217 | |