@@ -48,8 +48,9 @@ |
||
| 48 | 48 | $('#pagination-{$id} ._firstPage').attr('data-page',Math.max(1,page-1)); |
| 49 | 49 | var lastPage=$('#pagination-{$id} ._lastPage');lastPage.attr('data-page',Math.min(lastPage.attr('data-max'),page+1));"; |
| 50 | 50 | } |
| 51 | - if(isset($this->_urls["refresh"])) |
|
| 52 | - $this->jsonArrayOnClick($menu, $this->_urls["refresh"],"post","{'p':$(this).attr('data-page')}",$callback); |
|
| 51 | + if(isset($this->_urls["refresh"])) { |
|
| 52 | + $this->jsonArrayOnClick($menu, $this->_urls["refresh"],"post","{'p':$(this).attr('data-page')}",$callback); |
|
| 53 | + } |
|
| 53 | 54 | } |
| 54 | 55 | |
| 55 | 56 | /** |
@@ -16,17 +16,17 @@ discard block |
||
| 16 | 16 | parent::__construct($identifier, $model, $modelInstance); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - protected function _generateContent($table){ |
|
| 19 | + protected function _generateContent($table) { |
|
| 20 | 20 | $this->_addRowModel($table); |
| 21 | 21 | $this->_rowClass="_json"; |
| 22 | 22 | parent::_generateContent($table); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - protected function _addRowModel($table){ |
|
| 25 | + protected function _addRowModel($table) { |
|
| 26 | 26 | $object=JReflection::jsonObject($this->_model); |
| 27 | - $row=$this->_generateRow($object, $table,"_jsonArrayChecked"); |
|
| 27 | + $row=$this->_generateRow($object, $table, "_jsonArrayChecked"); |
|
| 28 | 28 | $row->setClass($this->_modelClass); |
| 29 | - $row->addToProperty("style","display:none;"); |
|
| 29 | + $row->addToProperty("style", "display:none;"); |
|
| 30 | 30 | $table->getBody()->_addRow($row); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -34,22 +34,22 @@ discard block |
||
| 34 | 34 | * {@inheritDoc} |
| 35 | 35 | * @see DataTable::_associatePaginationBehavior() |
| 36 | 36 | */ |
| 37 | - protected function _associatePaginationBehavior(HtmlMenu $menu,JsUtils $js=NULL){ |
|
| 37 | + protected function _associatePaginationBehavior(HtmlMenu $menu, JsUtils $js=NULL) { |
|
| 38 | 38 | $callback=null; |
| 39 | - if(isset($js)){ |
|
| 39 | + if (isset($js)) { |
|
| 40 | 40 | $id=$this->identifier; |
| 41 | 41 | $offset=$js->scriptCount(); |
| 42 | 42 | $this->run($js); |
| 43 | 43 | $callback=$js->getScript($offset); |
| 44 | - $callback.=$js->trigger("#".$id." [name='selection[]']","change",false)."$('#".$id." tbody .ui.checkbox').checkbox();".$js->execOn("change", "#".$id." [name='selection[]']", $this->_getCheckedChange($js)); |
|
| 44 | + $callback.=$js->trigger("#".$id." [name='selection[]']", "change", false)."$('#".$id." tbody .ui.checkbox').checkbox();".$js->execOn("change", "#".$id." [name='selection[]']", $this->_getCheckedChange($js)); |
|
| 45 | 45 | $callback.=";var page=parseInt($(self).attr('data-page')); |
| 46 | 46 | $('#pagination-{$id} .item').removeClass('active'); |
| 47 | 47 | $('#pagination-{$id} [data-page='+page+']:not(.no-active)').addClass('active'); |
| 48 | 48 | $('#pagination-{$id} ._firstPage').attr('data-page',Math.max(1,page-1)); |
| 49 | 49 | var lastPage=$('#pagination-{$id} ._lastPage');lastPage.attr('data-page',Math.min(lastPage.attr('data-max'),page+1));"; |
| 50 | 50 | } |
| 51 | - if(isset($this->_urls["refresh"])) |
|
| 52 | - $this->jsonArrayOnClick($menu, $this->_urls["refresh"],"post","{'p':$(this).attr('data-page')}",$callback); |
|
| 51 | + if (isset($this->_urls["refresh"])) |
|
| 52 | + $this->jsonArrayOnClick($menu, $this->_urls["refresh"], "post", "{'p':$(this).attr('data-page')}", $callback); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -60,29 +60,29 @@ discard block |
||
| 60 | 60 | * @param callable $jsCallback |
| 61 | 61 | * @return AjaxCall |
| 62 | 62 | */ |
| 63 | - public function jsJsonArray($url, $method="get", $params="{}", $jsCallback=NULL,$parameters=[]){ |
|
| 64 | - $parameters=\array_merge($parameters,["modelSelector"=>"#".$this->_identifier." tr.".$this->_modelClass,"url"=>$url,"method"=>$method,"params"=>$params,"jsCallback"=>$jsCallback]); |
|
| 63 | + public function jsJsonArray($url, $method="get", $params="{}", $jsCallback=NULL, $parameters=[]) { |
|
| 64 | + $parameters=\array_merge($parameters, ["modelSelector"=>"#".$this->_identifier." tr.".$this->_modelClass, "url"=>$url, "method"=>$method, "params"=>$params, "jsCallback"=>$jsCallback]); |
|
| 65 | 65 | return new AjaxCall("jsonArray", $parameters); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function jsClear(){ |
|
| 68 | + public function jsClear() { |
|
| 69 | 69 | return "$('#{$this->identifier} tbody').find('._json').remove();"; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - public function clearOn(BaseHtml $element,$event, $stopPropagation=false, $preventDefault=false){ |
|
| 73 | - return $element->addEvent($event, $this->jsClear(),$stopPropagation,$preventDefault); |
|
| 72 | + public function clearOn(BaseHtml $element, $event, $stopPropagation=false, $preventDefault=false) { |
|
| 73 | + return $element->addEvent($event, $this->jsClear(), $stopPropagation, $preventDefault); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - public function clearOnClick(BaseHtml $element,$stopPropagation=false, $preventDefault=false){ |
|
| 77 | - return $this->clearOn($element, "click",$stopPropagation,$preventDefault); |
|
| 76 | + public function clearOnClick(BaseHtml $element, $stopPropagation=false, $preventDefault=false) { |
|
| 77 | + return $this->clearOn($element, "click", $stopPropagation, $preventDefault); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - public function jsonArrayOn(BaseHtml $element,$event,$url, $method="get", $params="{}", $jsCallback=NULL,$parameters=[]){ |
|
| 81 | - return $element->_addEvent($event, $this->jsJsonArray($url,$method,$params,$jsCallback,$parameters)); |
|
| 80 | + public function jsonArrayOn(BaseHtml $element, $event, $url, $method="get", $params="{}", $jsCallback=NULL, $parameters=[]) { |
|
| 81 | + return $element->_addEvent($event, $this->jsJsonArray($url, $method, $params, $jsCallback, $parameters)); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - public function jsonArrayOnClick(BaseHtml $element,$url, $method="get", $params="{}", $jsCallback=NULL,$parameters=[]){ |
|
| 85 | - return $this->jsonArrayOn($element, "click", $url,$method,$params,$jsCallback,$parameters); |
|
| 84 | + public function jsonArrayOnClick(BaseHtml $element, $url, $method="get", $params="{}", $jsCallback=NULL, $parameters=[]) { |
|
| 85 | + return $this->jsonArrayOn($element, "click", $url, $method, $params, $jsCallback, $parameters); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @param number $pages_visibles The number of visible pages in the Pagination component |
| 94 | 94 | * @return DataTable |
| 95 | 95 | */ |
| 96 | - public function paginate($page,$total_rowcount,$items_per_page=10,$pages_visibles=null){ |
|
| 97 | - return parent::paginate($page, $total_rowcount,$items_per_page,null); |
|
| 96 | + public function paginate($page, $total_rowcount, $items_per_page=10, $pages_visibles=null) { |
|
| 97 | + return parent::paginate($page, $total_rowcount, $items_per_page, null); |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | \ No newline at end of file |
@@ -17,8 +17,8 @@ discard block |
||
| 17 | 17 | * @param array $instances |
| 18 | 18 | * @return DataTable |
| 19 | 19 | */ |
| 20 | - public function dataTable($identifier,$model, $instances){ |
|
| 21 | - return $this->addHtmlComponent(new DataTable($identifier,$model,$instances)); |
|
| 20 | + public function dataTable($identifier, $model, $instances) { |
|
| 21 | + return $this->addHtmlComponent(new DataTable($identifier, $model, $instances)); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | * @param array $instances |
| 28 | 28 | * @return JsonDataTable |
| 29 | 29 | */ |
| 30 | - public function jsonDataTable($identifier,$model, $instances){ |
|
| 31 | - return $this->addHtmlComponent(new JsonDataTable($identifier,$model,$instances)); |
|
| 30 | + public function jsonDataTable($identifier, $model, $instances) { |
|
| 31 | + return $this->addHtmlComponent(new JsonDataTable($identifier, $model, $instances)); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | * @param object $instance |
| 37 | 37 | * @return DataElement |
| 38 | 38 | */ |
| 39 | - public function dataElement($identifier, $instance){ |
|
| 40 | - return $this->addHtmlComponent(new DataElement($identifier,$instance)); |
|
| 39 | + public function dataElement($identifier, $instance) { |
|
| 40 | + return $this->addHtmlComponent(new DataElement($identifier, $instance)); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -45,19 +45,19 @@ discard block |
||
| 45 | 45 | * @param object $instance |
| 46 | 46 | * @return DataForm |
| 47 | 47 | */ |
| 48 | - public function dataForm($identifier, $instance){ |
|
| 49 | - return $this->addHtmlComponent(new DataForm($identifier,$instance)); |
|
| 48 | + public function dataForm($identifier, $instance) { |
|
| 49 | + return $this->addHtmlComponent(new DataForm($identifier, $instance)); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - public function defaultLogin($identifier,$instance=null){ |
|
| 53 | - return $this->addHtmlComponent(FormLogin::regular($identifier,$instance)); |
|
| 52 | + public function defaultLogin($identifier, $instance=null) { |
|
| 53 | + return $this->addHtmlComponent(FormLogin::regular($identifier, $instance)); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - public function smallLogin($identifier,$instance=null){ |
|
| 57 | - return $this->addHtmlComponent(FormLogin::small($identifier,$instance)); |
|
| 56 | + public function smallLogin($identifier, $instance=null) { |
|
| 57 | + return $this->addHtmlComponent(FormLogin::small($identifier, $instance)); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - public function segmentedLogin($identifier,$instance=null){ |
|
| 61 | - return $this->addHtmlComponent(FormLogin::attachedSegment($identifier,$instance)); |
|
| 60 | + public function segmentedLogin($identifier, $instance=null) { |
|
| 61 | + return $this->addHtmlComponent(FormLogin::attachedSegment($identifier, $instance)); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | \ No newline at end of file |