@@ -45,6 +45,10 @@ discard block |
||
45 | 45 | return parent::run($js); |
46 | 46 | } |
47 | 47 | |
48 | + /** |
|
49 | + * @param string $identifier |
|
50 | + * @param string $model |
|
51 | + */ |
|
48 | 52 | public function __construct($identifier,$model,$modelInstance=NULL) { |
49 | 53 | parent::__construct($identifier, $model,$modelInstance); |
50 | 54 | $this->_init(new InstanceViewer($identifier), "table", new HtmlTable($identifier, 0,0), false); |
@@ -174,6 +178,9 @@ discard block |
||
174 | 178 | return $this; |
175 | 179 | } |
176 | 180 | |
181 | + /** |
|
182 | + * @param PositionInTable $part |
|
183 | + */ |
|
177 | 184 | private function addToolbarRow($part,$table,$captions){ |
178 | 185 | $hasPart=$table->hasPart($part); |
179 | 186 | if($hasPart){ |
@@ -219,7 +226,7 @@ discard block |
||
219 | 226 | * @param string $caption |
220 | 227 | * @param callable $callback |
221 | 228 | * @param boolean $visibleHover |
222 | - * @return callable |
|
229 | + * @return \Closure |
|
223 | 230 | */ |
224 | 231 | private function getFieldButtonCallable($caption,$visibleHover=true,$callback=null){ |
225 | 232 | return $this->getCallable("getFieldButton",[$caption,$visibleHover],$callback); |
@@ -229,7 +236,7 @@ discard block |
||
229 | 236 | * @param callable $thisCallback |
230 | 237 | * @param array $parameters |
231 | 238 | * @param callable $callback |
232 | - * @return callable |
|
239 | + * @return \Closure |
|
233 | 240 | */ |
234 | 241 | private function getCallable($thisCallback,$parameters,$callback=null){ |
235 | 242 | $result=function($instance) use($thisCallback,$parameters,$callback){ |
@@ -298,11 +305,19 @@ discard block |
||
298 | 305 | return $this; |
299 | 306 | } |
300 | 307 | |
308 | + /** |
|
309 | + * @param string $icon |
|
310 | + * @param string $class |
|
311 | + */ |
|
301 | 312 | private function addDefaultButton($icon,$class=null,$visibleHover=true,$callback=null){ |
302 | 313 | $this->addField($this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
303 | 314 | return $this; |
304 | 315 | } |
305 | 316 | |
317 | + /** |
|
318 | + * @param string $icon |
|
319 | + * @param string $class |
|
320 | + */ |
|
306 | 321 | private function insertDefaultButtonIn($index,$icon,$class=null,$visibleHover=true,$callback=null){ |
307 | 322 | $this->insertInField($index,$this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
308 | 323 | return $this; |
@@ -374,6 +389,9 @@ discard block |
||
374 | 389 | }, $index,$attributes); |
375 | 390 | } |
376 | 391 | |
392 | + /** |
|
393 | + * @param HtmlButton $element |
|
394 | + */ |
|
377 | 395 | protected function _visibleOver($element){ |
378 | 396 | $this->_visibleHover=true; |
379 | 397 | return $element->addToProperty("class", "visibleover")->setProperty("style","visibility:hidden;"); |
@@ -72,8 +72,9 @@ discard block |
||
72 | 72 | |
73 | 73 | $table->setRowCount(0, \sizeof($captions)); |
74 | 74 | $table->setHeaderValues($captions); |
75 | - if(isset($this->_compileParts)) |
|
76 | - $table->setCompileParts($this->_compileParts); |
|
75 | + if(isset($this->_compileParts)) { |
|
76 | + $table->setCompileParts($this->_compileParts); |
|
77 | + } |
|
77 | 78 | if(isset($this->_searchField) && isset($js)){ |
78 | 79 | $this->_searchField->postOn("change", $this->_urls,"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
79 | 80 | } |
@@ -178,7 +179,7 @@ discard block |
||
178 | 179 | $hasPart=$table->hasPart($part); |
179 | 180 | if($hasPart){ |
180 | 181 | $row=$table->getPart($part)->addRow(\sizeof($captions)); |
181 | - }else{ |
|
182 | + } else{ |
|
182 | 183 | $row=$table->getPart($part)->getRow(0); |
183 | 184 | } |
184 | 185 | $row->mergeCol(); |
@@ -257,8 +258,9 @@ discard block |
||
257 | 258 | */ |
258 | 259 | private function getFieldButton($caption,$visibleHover=true){ |
259 | 260 | $bt= new HtmlButton("",$caption); |
260 | - if($visibleHover) |
|
261 | - $this->_visibleOver($bt); |
|
261 | + if($visibleHover) { |
|
262 | + $this->_visibleOver($bt); |
|
263 | + } |
|
262 | 264 | return $bt; |
263 | 265 | } |
264 | 266 | |
@@ -311,8 +313,9 @@ discard block |
||
311 | 313 | private function getDefaultButton($icon,$class=null,$visibleHover=true){ |
312 | 314 | $bt=$this->getFieldButton("",$visibleHover); |
313 | 315 | $bt->asIcon($icon); |
314 | - if(isset($class)) |
|
315 | - $bt->addToProperty("class", $class); |
|
316 | + if(isset($class)) { |
|
317 | + $bt->addToProperty("class", $class); |
|
318 | + } |
|
316 | 319 | return $bt; |
317 | 320 | } |
318 | 321 |