@@ -28,29 +28,29 @@ |
||
| 28 | 28 | $method="get"; |
| 29 | 29 | extract($this->parameters); |
| 30 | 30 | $result=$this->_eventPreparing($preventDefault, $stopPropagation); |
| 31 | - switch($this->method) { |
|
| 31 | + switch ($this->method) { |
|
| 32 | 32 | case "get": |
| 33 | - $result.=$js->getDeferred($url, $responseElement, $params, $jsCallback, $attr,$jqueryDone,$ajaxTransition); |
|
| 33 | + $result.=$js->getDeferred($url, $responseElement, $params, $jsCallback, $attr, $jqueryDone, $ajaxTransition); |
|
| 34 | 34 | break; |
| 35 | 35 | case "post": |
| 36 | - $result.=$js->postDeferred($url, $responseElement, $params, $jsCallback, $attr,$hasLoader,$jqueryDone,$ajaxTransition); |
|
| 36 | + $result.=$js->postDeferred($url, $responseElement, $params, $jsCallback, $attr, $hasLoader, $jqueryDone, $ajaxTransition); |
|
| 37 | 37 | break; |
| 38 | 38 | case "postForm": |
| 39 | - $result.=$js->postFormDeferred($url, $form, $responseElement, $validation, $jsCallback, $attr,$hasLoader,$jqueryDone,$ajaxTransition); |
|
| 39 | + $result.=$js->postFormDeferred($url, $form, $responseElement, $validation, $jsCallback, $attr, $hasLoader, $jqueryDone, $ajaxTransition); |
|
| 40 | 40 | break; |
| 41 | 41 | case "json": |
| 42 | - $result.=$js->jsonDeferred($url,$method,$params,$jsCallback); |
|
| 42 | + $result.=$js->jsonDeferred($url, $method, $params, $jsCallback); |
|
| 43 | 43 | break; |
| 44 | 44 | case "jsonArray": |
| 45 | - $result.=$js->jsonArrayDeferred($modelSelector, $url,$method,$params,$jsCallback); |
|
| 45 | + $result.=$js->jsonArrayDeferred($modelSelector, $url, $method, $params, $jsCallback); |
|
| 46 | 46 | break; |
| 47 | 47 | } |
| 48 | - if(isset($eventItemSelector)) |
|
| 48 | + if (isset($eventItemSelector)) |
|
| 49 | 49 | $result="{{".$eventItemSelector."}}".$result; |
| 50 | 50 | return $result; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - protected function _eventPreparing($preventDefault,$stopPropagation){ |
|
| 53 | + protected function _eventPreparing($preventDefault, $stopPropagation) { |
|
| 54 | 54 | $result=""; |
| 55 | 55 | if ($preventDefault===true) { |
| 56 | 56 | $result.=Javascript::$preventDefault; |
@@ -14,8 +14,9 @@ discard block |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function compile(JsUtils $js=null) { |
| 17 | - if ($js==null) |
|
| 18 | - return; |
|
| 17 | + if ($js==null) { |
|
| 18 | + return; |
|
| 19 | + } |
|
| 19 | 20 | $params="{}"; |
| 20 | 21 | $jsCallback=NULL; |
| 21 | 22 | $attr="id"; |
@@ -45,8 +46,9 @@ discard block |
||
| 45 | 46 | $result.=$js->jsonArrayDeferred($modelSelector, $url,$method,$params,$jsCallback); |
| 46 | 47 | break; |
| 47 | 48 | } |
| 48 | - if(isset($eventItemSelector)) |
|
| 49 | - $result="{{".$eventItemSelector."}}".$result; |
|
| 49 | + if(isset($eventItemSelector)) { |
|
| 50 | + $result="{{".$eventItemSelector."}}".$result; |
|
| 51 | + } |
|
| 50 | 52 | return $result; |
| 51 | 53 | } |
| 52 | 54 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | $this->params["onUnchecked"]="%function(){".$value."}%"; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function setOnChange($value){ |
|
| 23 | + public function setOnChange($value) { |
|
| 24 | 24 | $this->params["onChange"]="%function(){".$value."}%"; |
| 25 | 25 | } |
| 26 | 26 | //TODO other events implementation |
@@ -28,10 +28,10 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | public function __construct($identifier, $rowCount, $colCount) { |
| 30 | 30 | parent::__construct($identifier, "table", "ui table"); |
| 31 | - $this->content=array (); |
|
| 31 | + $this->content=array(); |
|
| 32 | 32 | $this->setRowCount($rowCount, $colCount); |
| 33 | - $this->_variations=[ Variation::CELLED,Variation::PADDED,Variation::COMPACT ]; |
|
| 34 | - $this->_compileParts=["thead","tbody","tfoot"]; |
|
| 33 | + $this->_variations=[Variation::CELLED, Variation::PADDED, Variation::COMPACT]; |
|
| 34 | + $this->_compileParts=["thead", "tbody", "tfoot"]; |
|
| 35 | 35 | $this->_afterCompileEvents=[]; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | * @return HtmlTableContent |
| 50 | 50 | */ |
| 51 | 51 | public function getPart($key) { |
| 52 | - if (\array_key_exists($key, $this->content) === false) { |
|
| 52 | + if (\array_key_exists($key, $this->content)===false) { |
|
| 53 | 53 | $this->content[$key]=new HtmlTableContent("", $key); |
| 54 | - if ($key !== "tbody") { |
|
| 54 | + if ($key!=="tbody") { |
|
| 55 | 55 | $this->content[$key]->setRowCount(1, $this->_colCount); |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @return boolean |
| 97 | 97 | */ |
| 98 | 98 | public function hasPart($key) { |
| 99 | - return \array_key_exists($key, $this->content) === true; |
|
| 99 | + return \array_key_exists($key, $this->content)===true; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | private function colAlign($colIndex, $function) { |
| 203 | 203 | if (\is_array($colIndex)) { |
| 204 | - foreach ( $colIndex as $cIndex ) { |
|
| 204 | + foreach ($colIndex as $cIndex) { |
|
| 205 | 205 | $this->colAlign($cIndex, $function); |
| 206 | 206 | } |
| 207 | 207 | } else { |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
| 241 | 241 | */ |
| 242 | 242 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 243 | - if(\sizeof($this->_compileParts)<3){ |
|
| 243 | + if (\sizeof($this->_compileParts)<3) { |
|
| 244 | 244 | $this->_template="%content%"; |
| 245 | 245 | $this->refresh(); |
| 246 | 246 | } |
@@ -250,9 +250,9 @@ discard block |
||
| 250 | 250 | |
| 251 | 251 | protected function compile_once(JsUtils $js=NULL, &$view=NULL) { |
| 252 | 252 | if ($this->propertyContains("class", "sortable")) { |
| 253 | - $this->addEvent("execute", "$('#" . $this->identifier . "').tablesort().data('tablesort').sort($('th.default-sort'));"); |
|
| 253 | + $this->addEvent("execute", "$('#".$this->identifier."').tablesort().data('tablesort').sort($('th.default-sort'));"); |
|
| 254 | 254 | } |
| 255 | - if(isset($this->_activeClass)){ |
|
| 255 | + if (isset($this->_activeClass)) { |
|
| 256 | 256 | $this->onRow($this->_activeRowEvent, "$(this).toggleClass('".$this->_activeClass."');"); |
| 257 | 257 | } |
| 258 | 258 | } |
@@ -266,13 +266,13 @@ discard block |
||
| 266 | 266 | public function fromDatabaseObject($object, $function) { |
| 267 | 267 | $result=$function($object); |
| 268 | 268 | if (\is_array($result)) { |
| 269 | - $result= $this->addRow($function($object)); |
|
| 269 | + $result=$this->addRow($function($object)); |
|
| 270 | 270 | } else { |
| 271 | - $result= $this->getBody()->_addRow($result); |
|
| 271 | + $result=$this->getBody()->_addRow($result); |
|
| 272 | 272 | } |
| 273 | - if(isset($this->_afterCompileEvents["onNewRow"])){ |
|
| 274 | - if(\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
| 275 | - $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 273 | + if (isset($this->_afterCompileEvents["onNewRow"])) { |
|
| 274 | + if (\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
| 275 | + $this->_afterCompileEvents["onNewRow"]($result, $object); |
|
| 276 | 276 | } |
| 277 | 277 | return $result; |
| 278 | 278 | } |
@@ -286,14 +286,14 @@ discard block |
||
| 286 | 286 | return $this; |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | - public function refresh(){ |
|
| 289 | + public function refresh() { |
|
| 290 | 290 | $this->_footer=$this->getFooter(); |
| 291 | 291 | $this->addEvent("execute", '$("#'.$this->identifier.' tfoot").replaceWith("'.\addslashes($this->_footer).'");'); |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - public function run(JsUtils $js){ |
|
| 295 | - $result= parent::run($js); |
|
| 296 | - if(isset($this->_footer)) |
|
| 294 | + public function run(JsUtils $js) { |
|
| 295 | + $result=parent::run($js); |
|
| 296 | + if (isset($this->_footer)) |
|
| 297 | 297 | $this->_footer->run($js); |
| 298 | 298 | return $result; |
| 299 | 299 | } |
@@ -271,8 +271,9 @@ discard block |
||
| 271 | 271 | $result= $this->getBody()->_addRow($result); |
| 272 | 272 | } |
| 273 | 273 | if(isset($this->_afterCompileEvents["onNewRow"])){ |
| 274 | - if(\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
| 275 | - $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 274 | + if(\is_callable($this->_afterCompileEvents["onNewRow"])) { |
|
| 275 | + $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 276 | + } |
|
| 276 | 277 | } |
| 277 | 278 | return $result; |
| 278 | 279 | } |
@@ -293,8 +294,9 @@ discard block |
||
| 293 | 294 | |
| 294 | 295 | public function run(JsUtils $js){ |
| 295 | 296 | $result= parent::run($js); |
| 296 | - if(isset($this->_footer)) |
|
| 297 | - $this->_footer->run($js); |
|
| 297 | + if(isset($this->_footer)) { |
|
| 298 | + $this->_footer->run($js); |
|
| 299 | + } |
|
| 298 | 300 | return $result; |
| 299 | 301 | } |
| 300 | 302 | |