@@ -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){ |
@@ -49,8 +49,9 @@ discard block |
||
49 | 49 | public function addCol($width=NULL){ |
50 | 50 | $colCount=$this->colCount()+1; |
51 | 51 | $this->setColsCount($colCount,true,$width); |
52 | - if($this->hasOnlyCols($this->count())) |
|
53 | - return $this->content[$colCount-1]; |
|
52 | + if($this->hasOnlyCols($this->count())) { |
|
53 | + return $this->content[$colCount-1]; |
|
54 | + } |
|
54 | 55 | return $this; |
55 | 56 | } |
56 | 57 | |
@@ -73,7 +74,7 @@ discard block |
||
73 | 74 | for($i=$count;$i<$colsCount;$i++){ |
74 | 75 | $this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i)); |
75 | 76 | } |
76 | - }else{ |
|
77 | + } else{ |
|
77 | 78 | if($this->hasOnlyCols($count)){ |
78 | 79 | $tmpContent=$this->content; |
79 | 80 | $item=$this->addItem($colsCount); |
@@ -93,15 +94,16 @@ discard block |
||
93 | 94 | } |
94 | 95 | |
95 | 96 | public function setColsCount($numCols,$toCreate=true,$width=NULL){ |
96 | - if(isset($width)===false) |
|
97 | - $this->setWide($numCols); |
|
97 | + if(isset($width)===false) { |
|
98 | + $this->setWide($numCols); |
|
99 | + } |
|
98 | 100 | if($toCreate==true){ |
99 | 101 | $count=$this->count(); |
100 | 102 | if($count==0 || $this->hasOnlyCols($count)){ |
101 | 103 | for($i=$count;$i<$numCols;$i++){ |
102 | 104 | $this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i,$width)); |
103 | 105 | } |
104 | - }else{ |
|
106 | + } else{ |
|
105 | 107 | for($i=0;$i<$count;$i++){ |
106 | 108 | $this->getItem($i)->setColsCount($numCols); |
107 | 109 | } |
@@ -121,17 +123,20 @@ discard block |
||
121 | 123 | |
122 | 124 | public function rowCount(){ |
123 | 125 | $count=$this->count(); |
124 | - if($this->hasOnlyCols($count)) |
|
125 | - return 0; |
|
126 | + if($this->hasOnlyCols($count)) { |
|
127 | + return 0; |
|
128 | + } |
|
126 | 129 | return $count; |
127 | 130 | } |
128 | 131 | |
129 | 132 | public function colCount(){ |
130 | 133 | $count=$this->count(); |
131 | - if($this->hasOnlyCols($count)) |
|
132 | - return $count; |
|
133 | - if($count>0) |
|
134 | - return $this->getItem(0)->count(); |
|
134 | + if($this->hasOnlyCols($count)) { |
|
135 | + return $count; |
|
136 | + } |
|
137 | + if($count>0) { |
|
138 | + return $this->getItem(0)->count(); |
|
139 | + } |
|
135 | 140 | return 0; |
136 | 141 | } |
137 | 142 | |
@@ -141,8 +146,9 @@ discard block |
||
141 | 146 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
142 | 147 | */ |
143 | 148 | public function getCell($row,$col){ |
144 | - if($row<2 && $this->hasOnlyCols($this->count())) |
|
145 | - return $this->getItem($col); |
|
149 | + if($row<2 && $this->hasOnlyCols($this->count())) { |
|
150 | + return $this->getItem($col); |
|
151 | + } |
|
146 | 152 | $row=$this->getItem($row); |
147 | 153 | if(isset($row)){ |
148 | 154 | $col=$row->getItem($col); |
@@ -191,8 +197,9 @@ discard block |
||
191 | 197 | * @return \Ajax\semantic\html\collections\HtmlGrid |
192 | 198 | */ |
193 | 199 | public function setPadded($value=NULL){ |
194 | - if(isset($value)) |
|
195 | - $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
200 | + if(isset($value)) { |
|
201 | + $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
202 | + } |
|
196 | 203 | return $this->addToProperty("class", "padded"); |
197 | 204 | } |
198 | 205 | |
@@ -214,8 +221,9 @@ discard block |
||
214 | 221 | * @see \Ajax\common\html\HtmlCollection::createItem() |
215 | 222 | */ |
216 | 223 | protected function createItem($value){ |
217 | - if($this->_createCols===false) |
|
218 | - $value=null; |
|
224 | + if($this->_createCols===false) { |
|
225 | + $value=null; |
|
226 | + } |
|
219 | 227 | $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing,$this->_implicitRows); |
220 | 228 | return $item; |
221 | 229 | } |