Completed
Push — master ( f99fed...57dceb )
by Jean-Christophe
03:29
created
Ajax/semantic/widgets/datatable/JsonDataTable.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,17 +60,17 @@  discard block
 block discarded – undo
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 jsonArrayOn(BaseHtml $element,$event,$url, $method="get", $params="{}", $jsCallback=NULL,$parameters=[]){
69
-		return $element->_addEvent($event, $this->jsJsonArray($url,$method,$params,$jsCallback,$parameters));
68
+	public function jsonArrayOn(BaseHtml $element, $event, $url, $method="get", $params="{}", $jsCallback=NULL, $parameters=[]) {
69
+		return $element->_addEvent($event, $this->jsJsonArray($url, $method, $params, $jsCallback, $parameters));
70 70
 	}
71 71
 
72
-	public function jsonArrayOnClick(BaseHtml $element,$url, $method="get", $params="{}", $jsCallback=NULL,$parameters=[]){
73
-		return $this->jsonArrayOn($element, "click", $url,$method,$params,$jsCallback,$parameters);
72
+	public function jsonArrayOnClick(BaseHtml $element, $url, $method="get", $params="{}", $jsCallback=NULL, $parameters=[]) {
73
+		return $this->jsonArrayOn($element, "click", $url, $method, $params, $jsCallback, $parameters);
74 74
 	}
75 75
 
76 76
 	/**
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 * @param number $pages_visibles The number of visible pages in the Pagination component
82 82
 	 * @return DataTable
83 83
 	 */
84
-	public function paginate($page,$total_rowcount,$items_per_page=10,$pages_visibles=null){
85
-		return parent::paginate($page, $total_rowcount,$items_per_page,null);
84
+	public function paginate($page, $total_rowcount, $items_per_page=10, $pages_visibles=null) {
85
+		return parent::paginate($page, $total_rowcount, $items_per_page, null);
86 86
 	}
87 87
 }
88 88
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,8 +48,9 @@
 block discarded – undo
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
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/traits/SemanticWidgetsTrait.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.