Passed
Push — master ( 514b5f...6cf655 )
by Jean-Christophe
02:23
created
Ajax/semantic/html/collections/HtmlBreadcrumb.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 *
21 21
 	 * @var integer the start index for href generation
22 22
 	 */
23
-	protected $startIndex = 0;
23
+	protected $startIndex=0;
24 24
 
25 25
 	/**
26 26
 	 *
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 *
33 33
 	 * @var boolean if set to true, the path of the elements is absolute
34 34
 	 */
35
-	protected $absolutePaths = false;
35
+	protected $absolutePaths=false;
36 36
 
37 37
 	/**
38 38
 	 *
@@ -49,16 +49,16 @@  discard block
 block discarded – undo
49 49
 	 * @param callable $hrefFunction
50 50
 	 *        	the function who generates the href elements. default : function($e){return $e->getContent()}
51 51
 	 */
52
-	public function __construct($identifier, $items = array(), $autoActive = true, $startIndex = 0, $hrefFunction = NULL) {
52
+	public function __construct($identifier, $items=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) {
53 53
 		parent::__construct($identifier, "div", "ui breadcrumb");
54
-		$this->startIndex = $startIndex;
55
-		$this->autoActive = $autoActive;
56
-		$this->_contentSeparator = "<div class='divider'> / </div>";
57
-		$this->_hrefFunction = function (HtmlSemDoubleElement $e) {
54
+		$this->startIndex=$startIndex;
55
+		$this->autoActive=$autoActive;
56
+		$this->_contentSeparator="<div class='divider'> / </div>";
57
+		$this->_hrefFunction=function(HtmlSemDoubleElement $e) {
58 58
 			return $e->getContent();
59 59
 		};
60 60
 		if (isset($hrefFunction)) {
61
-			$this->_hrefFunction = $hrefFunction;
61
+			$this->_hrefFunction=$hrefFunction;
62 62
 		}
63 63
 		$this->addItems($items);
64 64
 	}
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 	 *
89 89
 	 * @param int $index
90 90
 	 */
91
-	public function setActive($index = null) {
92
-		if (! isset($index)) {
93
-			$index = sizeof($this->content) - 1;
91
+	public function setActive($index=null) {
92
+		if (!isset($index)) {
93
+			$index=sizeof($this->content)-1;
94 94
 		}
95
-		$activeItem = $this->content[$index];
95
+		$activeItem=$this->content[$index];
96 96
 		$activeItem->addToProperty("class", "active");
97 97
 		$activeItem->setTagName("div");
98 98
 	}
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 	 *        	the request dispatcher
106 106
 	 * @return HtmlBreadcrumb
107 107
 	 */
108
-	public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex = 0) {
109
-		$this->startIndex = $startIndex;
108
+	public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0) {
109
+		$this->startIndex=$startIndex;
110 110
 		return $this->addItems($js->fromDispatcher($dispatcher));
111 111
 	}
112 112
 
@@ -117,16 +117,16 @@  discard block
 block discarded – undo
117 117
 	 * @param string $separator
118 118
 	 * @return string
119 119
 	 */
120
-	public function getHref($index = null, $separator = "/") {
121
-		if (! isset($index)) {
122
-			$index = sizeof($this->content);
120
+	public function getHref($index=null, $separator="/") {
121
+		if (!isset($index)) {
122
+			$index=sizeof($this->content);
123 123
 		}
124
-		if ($this->absolutePaths === true) {
124
+		if ($this->absolutePaths===true) {
125 125
 			return $this->_hrefFunction($this->content[$index]);
126 126
 		} else {
127
-			return $this->root . implode($separator, array_slice(array_map(function ($e) {
127
+			return $this->root.implode($separator, array_slice(array_map(function($e) {
128 128
 				return $this->_hrefFunction($e);
129
-			}, $this->content), $this->startIndex, $index + 1));
129
+			}, $this->content), $this->startIndex, $index+1));
130 130
 		}
131 131
 	}
132 132
 
@@ -138,17 +138,17 @@  discard block
 block discarded – undo
138 138
 	 * @return HtmlBreadcrumb
139 139
 	 */
140 140
 	public function setHrefFunction($_hrefFunction) {
141
-		$this->_hrefFunction = $_hrefFunction;
141
+		$this->_hrefFunction=$_hrefFunction;
142 142
 		return $this;
143 143
 	}
144 144
 
145 145
 	public function setStartIndex($startIndex) {
146
-		$this->startIndex = $startIndex;
146
+		$this->startIndex=$startIndex;
147 147
 		return $this;
148 148
 	}
149 149
 
150 150
 	public function setAutoActive($autoActive) {
151
-		$this->autoActive = $autoActive;
151
+		$this->autoActive=$autoActive;
152 152
 		return $this;
153 153
 	}
154 154
 
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
 	 * (non-PHPdoc)
157 157
 	 * @see \Ajax\bootstrap\html\BaseHtml::compile()
158 158
 	 */
159
-	public function compile(JsUtils $js = NULL, &$view = NULL) {
159
+	public function compile(JsUtils $js=NULL, &$view=NULL) {
160 160
 		if ($this->autoActive) {
161 161
 			$this->setActive();
162 162
 		}
163
-		$count = $this->count();
164
-		for ($i = 1; $i < $count; $i ++) {
165
-			$this->content[$i]->wrap($this->getContentDivider($i - 1));
163
+		$count=$this->count();
164
+		for ($i=1; $i<$count; $i++) {
165
+			$this->content[$i]->wrap($this->getContentDivider($i-1));
166 166
 		}
167 167
 		return parent::compile($js, $view);
168 168
 	}
@@ -171,16 +171,16 @@  discard block
 block discarded – undo
171 171
 	 * (non-PHPdoc)
172 172
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::on()
173 173
 	 */
174
-	public function on($event, $jsCode, $stopPropagation = false, $preventDefault = false) {
174
+	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
175 175
 		foreach ($this->content as $element) {
176 176
 			$element->on($event, $jsCode, $stopPropagation, $preventDefault);
177 177
 		}
178 178
 		return $this;
179 179
 	}
180 180
 
181
-	public function _ajaxOn($operation, $event, $url, $responseElement = "", $parameters = array()) {
181
+	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
182 182
 		foreach ($this->content as $element) {
183
-			if ($element->getProperty($this->attr) != NULL) {
183
+			if ($element->getProperty($this->attr)!=NULL) {
184 184
 				$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
185 185
 			}
186 186
 		}
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
195 195
 	 */
196 196
 	protected function createItem($value) {
197
-		$count = $this->count();
198
-		$itemO = new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "a", "section");
197
+		$count=$this->count();
198
+		$itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "a", "section");
199 199
 		if (\is_array($value)) {
200
-			@list ($text, $href) = $value;
200
+			@list ($text, $href)=$value;
201 201
 			$itemO->setContent($text);
202 202
 			$itemO->setProperty('href', $href);
203 203
 		} else {
@@ -207,16 +207,16 @@  discard block
 block discarded – undo
207 207
 	}
208 208
 
209 209
 	public function addIconAt($icon, $index) {
210
-		$item = $this->getItem($index);
210
+		$item=$this->getItem($index);
211 211
 		if (isset($item)) {
212
-			$icon = new HtmlIcon("icon-" . $this->identifier, $icon);
212
+			$icon=new HtmlIcon("icon-".$this->identifier, $icon);
213 213
 			$item->wrapContent($icon);
214 214
 		}
215 215
 	}
216 216
 
217 217
 	public function addItem($item) {
218
-		$count = $this->count();
219
-		$itemO = parent::addItem($item);
218
+		$count=$this->count();
219
+		$itemO=parent::addItem($item);
220 220
 		$this->addToPropertyCtrl("class", "section", array(
221 221
 			"section"
222 222
 		));
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
 	}
230 230
 
231 231
 	public function setAbsolutePaths($absolutePaths) {
232
-		$this->absolutePaths = $absolutePaths;
233
-		$size = \sizeof($this->content);
234
-		for ($i = 0; $i < $size; $i ++) {
232
+		$this->absolutePaths=$absolutePaths;
233
+		$size=\sizeof($this->content);
234
+		for ($i=0; $i<$size; $i++) {
235 235
 			$this->content[$i]->setProperty($this->attr, $this->getHref($i));
236 236
 		}
237 237
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/DataTableFieldAsTrait.php 2 patches
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@  discard block
 block discarded – undo
14 14
  * @property boolean $_visibleHover
15 15
  * @property InstanceViewer $_instanceViewer
16 16
  */
17
-trait DataTableFieldAsTrait{
18
-	protected $_buttons=["display","edit","delete"];
17
+trait DataTableFieldAsTrait {
18
+	protected $_buttons=["display", "edit", "delete"];
19 19
 	protected $_buttonsColumn;
20
-	abstract public function addField($field,$key=null);
21
-	abstract public function insertField($index,$field,$key=null);
22
-	abstract public function insertInField($index,$field,$key=null);
23
-	abstract public function fieldAs($index,$type,$attributes=NULL);
20
+	abstract public function addField($field, $key=null);
21
+	abstract public function insertField($index, $field, $key=null);
22
+	abstract public function insertInField($index, $field, $key=null);
23
+	abstract public function fieldAs($index, $type, $attributes=NULL);
24 24
 	abstract protected function cleanIdentifier($id);
25
-	abstract protected function _fieldAs($elementCallback,&$index,$attributes=NULL,$prefix=null);
25
+	abstract protected function _fieldAs($elementCallback, &$index, $attributes=NULL, $prefix=null);
26 26
 	
27 27
 	/**
28 28
 	 * @param string $caption
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 	 * @param boolean $visibleHover
31 31
 	 * @return callable
32 32
 	 */
33
-	private function getFieldButtonCallable($caption,$visibleHover=true,$callback=null){
34
-		return $this->getCallable("getFieldButton",[$caption,$visibleHover],$callback);
33
+	private function getFieldButtonCallable($caption, $visibleHover=true, $callback=null) {
34
+		return $this->getCallable("getFieldButton", [$caption, $visibleHover], $callback);
35 35
 	}
36 36
 
37 37
 	/**
@@ -40,20 +40,20 @@  discard block
 block discarded – undo
40 40
 	 * @param callable $callback
41 41
 	 * @return callable
42 42
 	 */
43
-	private function getCallable($thisCallback,$parameters,$callback=null){
44
-		$result=function($instance) use($thisCallback,$parameters,$callback){
45
-			$object=call_user_func_array(array($this,$thisCallback), $parameters);
46
-			if(isset($callback)){
47
-				if(\is_callable($callback)){
48
-					$callback($object,$instance,$this->_instanceViewer->count()+1);
43
+	private function getCallable($thisCallback, $parameters, $callback=null) {
44
+		$result=function($instance) use($thisCallback, $parameters, $callback){
45
+			$object=call_user_func_array(array($this, $thisCallback), $parameters);
46
+			if (isset($callback)) {
47
+				if (\is_callable($callback)) {
48
+					$callback($object, $instance, $this->_instanceViewer->count()+1);
49 49
 				}
50 50
 			}
51
-			if($object instanceof HtmlSemDoubleElement){
51
+			if ($object instanceof HtmlSemDoubleElement) {
52 52
 				$id=$this->_instanceViewer->getIdentifier();
53
-				$object->setProperty("data-ajax",$id);
54
-				if($object->propertyContains("class","visibleover")){
53
+				$object->setProperty("data-ajax", $id);
54
+				if ($object->propertyContains("class", "visibleover")) {
55 55
 					$this->_visibleHover=true;
56
-					$object->setProperty("style","visibility:hidden;");
56
+					$object->setProperty("style", "visibility:hidden;");
57 57
 				}
58 58
 			}
59 59
 			return $object;
@@ -65,17 +65,17 @@  discard block
 block discarded – undo
65 65
 	 * @param string $caption
66 66
 	 * @return HtmlButton
67 67
 	 */
68
-	private function getFieldButton($caption,$visibleHover=true,$icon=null){
68
+	private function getFieldButton($caption, $visibleHover=true, $icon=null) {
69 69
 		$id=$this->_instanceViewer->getIdentifier();
70
-		$bt= new HtmlButton($this->cleanIdentifier($icon??$caption).'-'.$id,$caption);
71
-		if($visibleHover)
70
+		$bt=new HtmlButton($this->cleanIdentifier($icon ?? $caption).'-'.$id, $caption);
71
+		if ($visibleHover)
72 72
 			$this->_visibleOver($bt);
73 73
 		return $bt;
74 74
 	}
75 75
 
76
-	private function getFieldButtons($buttons,$visibleHover=true){
77
-		$bts=new HtmlButtonGroups("",$buttons);
78
-		if($visibleHover)
76
+	private function getFieldButtons($buttons, $visibleHover=true) {
77
+		$bts=new HtmlButtonGroups("", $buttons);
78
+		if ($visibleHover)
79 79
 			$this->_visibleOver($bts);
80 80
 		return $bts;
81 81
 	}
@@ -89,19 +89,19 @@  discard block
 block discarded – undo
89 89
 	 * @param array $attributes associative array (<b>ajax</b> key is for ajax post)
90 90
 	 * @return DataTable
91 91
 	 */
92
-	public function fieldAsSubmit($index,$cssStyle=NULL,$url=NULL,$responseElement=NULL,$attributes=NULL){
93
-		return $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$attributes){
94
-			$button=new HtmlButton($id,$value,$cssStyle);
95
-			$button->postOnClick($url,"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes["ajax"]);
96
-			if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"])
92
+	public function fieldAsSubmit($index, $cssStyle=NULL, $url=NULL, $responseElement=NULL, $attributes=NULL) {
93
+		return $this->_fieldAs(function($id, $name, $value, $caption) use ($url, $responseElement, $cssStyle, $attributes){
94
+			$button=new HtmlButton($id, $value, $cssStyle);
95
+			$button->postOnClick($url, "$(event.target).closest('tr').find(':input').serialize()", $responseElement, $attributes["ajax"]);
96
+			if (!isset($attributes["visibleHover"]) || $attributes["visibleHover"])
97 97
 				$this->_visibleOver($button);
98 98
 				return $button;
99
-		}, $index,$attributes);
99
+		}, $index, $attributes);
100 100
 	}
101 101
 
102
-	protected function _visibleOver(BaseHtml $element){
102
+	protected function _visibleOver(BaseHtml $element) {
103 103
 		$this->_visibleHover=true;
104
-		return $element->addToProperty("class", "visibleover")->setProperty("style","visibility:hidden;");
104
+		return $element->addToProperty("class", "visibleover")->setProperty("style", "visibility:hidden;");
105 105
 	}
106 106
 
107 107
 	/**
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 	 * @param boolean $visibleHover
112 112
 	 * @return DataTable
113 113
 	 */
114
-	public function addFieldButton($caption,$visibleHover=true,$callback=null){
115
-		$this->addField($this->getCallable("getFieldButton",[$caption,$visibleHover],$callback));
114
+	public function addFieldButton($caption, $visibleHover=true, $callback=null) {
115
+		$this->addField($this->getCallable("getFieldButton", [$caption, $visibleHover], $callback));
116 116
 		return $this;
117 117
 	}
118 118
 
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 	 * @param boolean $visibleHover
124 124
 	 * @return DataTable
125 125
 	 */
126
-	public function addFieldButtons($buttons,$visibleHover=true,$callback=null){
127
-		$this->addField($this->getCallable("getFieldButtons",[$buttons,$visibleHover],$callback));
126
+	public function addFieldButtons($buttons, $visibleHover=true, $callback=null) {
127
+		$this->addField($this->getCallable("getFieldButtons", [$buttons, $visibleHover], $callback));
128 128
 		return $this;
129 129
 	}
130 130
 
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 	 * @param callable $callback
136 136
 	 * @return DataTable
137 137
 	 */
138
-	public function insertFieldButton($index,$caption,$visibleHover=true,$callback=null){
139
-		$this->insertField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback));
138
+	public function insertFieldButton($index, $caption, $visibleHover=true, $callback=null) {
139
+		$this->insertField($index, $this->getFieldButtonCallable($caption, $visibleHover, $callback));
140 140
 		return $this;
141 141
 	}
142 142
 
@@ -147,25 +147,25 @@  discard block
 block discarded – undo
147 147
 	 * @param callable $callback
148 148
 	 * @return DataTable
149 149
 	 */
150
-	public function insertInFieldButton($index,$caption,$visibleHover=true,$callback=null,$key=null){
151
-		$this->insertInField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback),$key);
150
+	public function insertInFieldButton($index, $caption, $visibleHover=true, $callback=null, $key=null) {
151
+		$this->insertInField($index, $this->getFieldButtonCallable($caption, $visibleHover, $callback), $key);
152 152
 		return $this;
153 153
 	}
154 154
 
155
-	public function addDefaultButton($icon,$class=null,$visibleHover=true,$callback=null,$key=null){
156
-		$this->addField($this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback),$key);
155
+	public function addDefaultButton($icon, $class=null, $visibleHover=true, $callback=null, $key=null) {
156
+		$this->addField($this->getCallable("getDefaultButton", [$icon, $class, $visibleHover], $callback), $key);
157 157
 		return $this;
158 158
 	}
159 159
 
160
-	public function insertDefaultButtonIn($index,$icon,$class=null,$visibleHover=true,$callback=null,$key=null){
161
-		$this->insertInField($index,$this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback),$key);
160
+	public function insertDefaultButtonIn($index, $icon, $class=null, $visibleHover=true, $callback=null, $key=null) {
161
+		$this->insertInField($index, $this->getCallable("getDefaultButton", [$icon, $class, $visibleHover], $callback), $key);
162 162
 		return $this;
163 163
 	}
164 164
 
165
-	private function getDefaultButton($icon,$class=null,$visibleHover=true){
166
-		$bt=$this->getFieldButton("",$visibleHover,$icon);
165
+	private function getDefaultButton($icon, $class=null, $visibleHover=true) {
166
+		$bt=$this->getFieldButton("", $visibleHover, $icon);
167 167
 		$bt->asIcon($icon);
168
-		if(isset($class))
168
+		if (isset($class))
169 169
 			$bt->addClass($class);
170 170
 		return $bt;
171 171
 	}
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
 	 * @param callable $callback this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object
178 178
 	 * @return DataTable
179 179
 	 */
180
-	public function addDeleteButton($visibleHover=true,$deleteBehavior=[],$callback=null){
180
+	public function addDeleteButton($visibleHover=true, $deleteBehavior=[], $callback=null) {
181 181
 		$this->_deleteBehavior=$deleteBehavior;
182
-		return $this->addDefaultButton("remove","_delete red basic",$visibleHover,$callback,"delete");
182
+		return $this->addDefaultButton("remove", "_delete red basic", $visibleHover, $callback, "delete");
183 183
 	}
184 184
 
185 185
 	/**
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
 	 * @param callable $callback this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object
190 190
 	 * @return DataTable
191 191
 	 */
192
-	public function addEditButton($visibleHover=true,$editBehavior=[],$callback=null){
192
+	public function addEditButton($visibleHover=true, $editBehavior=[], $callback=null) {
193 193
 		$this->_editBehavior=$editBehavior;
194
-		return $this->addDefaultButton("edit","_edit basic",$visibleHover,$callback,"edit");
194
+		return $this->addDefaultButton("edit", "_edit basic", $visibleHover, $callback, "edit");
195 195
 	}
196 196
 	
197 197
 	/**
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
 	 * @param callable $callback this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object
202 202
 	 * @return DataTable
203 203
 	 */
204
-	public function addDisplayButton($visibleHover=true,$displayBehavior=[],$callback=null){
204
+	public function addDisplayButton($visibleHover=true, $displayBehavior=[], $callback=null) {
205 205
 		$this->_displayBehavior=$displayBehavior;
206
-		return $this->addDefaultButton("eye","_display basic",$visibleHover,$callback,"display");
206
+		return $this->addDefaultButton("eye", "_display basic", $visibleHover, $callback, "display");
207 207
 	}
208 208
 
209 209
 	/**
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 	 * @param callable $callbackDelete this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object
215 215
 	 * @return DataTable
216 216
 	 */
217
-	public function addEditDeleteButtons($visibleHover=true,$behavior=[],$callbackEdit=null,$callbackDelete=null){
218
-		$this->addEditButton($visibleHover,$behavior,$callbackEdit);
217
+	public function addEditDeleteButtons($visibleHover=true, $behavior=[], $callbackEdit=null, $callbackDelete=null) {
218
+		$this->addEditButton($visibleHover, $behavior, $callbackEdit);
219 219
 		$index=$this->_instanceViewer->visiblePropertiesCount()-1;
220
-		$this->insertDeleteButtonIn($index,$visibleHover,$behavior,$callbackDelete);
220
+		$this->insertDeleteButtonIn($index, $visibleHover, $behavior, $callbackDelete);
221 221
 		return $this;
222 222
 	}
223 223
 	
@@ -230,28 +230,28 @@  discard block
 block discarded – undo
230 230
 	 * @param callable $callbackDelete this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object
231 231
 	 * @return DataTable
232 232
 	 */
233
-	public function addAllButtons($visibleHover=true,$behavior=[],$callbackDisplay=null,$callbackEdit=null,$callbackDelete=null){
234
-		$this->addDisplayButton($visibleHover,$behavior,$callbackDisplay);
233
+	public function addAllButtons($visibleHover=true, $behavior=[], $callbackDisplay=null, $callbackEdit=null, $callbackDelete=null) {
234
+		$this->addDisplayButton($visibleHover, $behavior, $callbackDisplay);
235 235
 		$index=$this->_instanceViewer->visiblePropertiesCount()-1;
236 236
 		$this->_buttonsColumn=$index;
237
-		$this->insertEditButtonIn($index,$visibleHover,$behavior,$callbackEdit);
238
-		$this->insertDeleteButtonIn($index,$visibleHover,$behavior,$callbackDelete);
237
+		$this->insertEditButtonIn($index, $visibleHover, $behavior, $callbackEdit);
238
+		$this->insertDeleteButtonIn($index, $visibleHover, $behavior, $callbackDelete);
239 239
 		return $this;
240 240
 	}
241 241
 
242
-	public function insertDeleteButtonIn($index,$visibleHover=true,$deleteBehavior=[],$callback=null){
242
+	public function insertDeleteButtonIn($index, $visibleHover=true, $deleteBehavior=[], $callback=null) {
243 243
 		$this->_deleteBehavior=$deleteBehavior;
244
-		return $this->insertDefaultButtonIn($index,"remove","_delete red basic",$visibleHover,$callback,"delete");
244
+		return $this->insertDefaultButtonIn($index, "remove", "_delete red basic", $visibleHover, $callback, "delete");
245 245
 	}
246 246
 
247
-	public function insertEditButtonIn($index,$visibleHover=true,$editBehavior=[],$callback=null){
247
+	public function insertEditButtonIn($index, $visibleHover=true, $editBehavior=[], $callback=null) {
248 248
 		$this->_editBehavior=$editBehavior;
249
-		return $this->insertDefaultButtonIn($index,"edit","_edit basic",$visibleHover,$callback,"edit");
249
+		return $this->insertDefaultButtonIn($index, "edit", "_edit basic", $visibleHover, $callback, "edit");
250 250
 	}
251 251
 	
252
-	public function insertDisplayButtonIn($index,$visibleHover=true,$displayBehavior=[],$callback=null){
252
+	public function insertDisplayButtonIn($index, $visibleHover=true, $displayBehavior=[], $callback=null) {
253 253
 		$this->_displayBehavior=$displayBehavior;
254
-		return $this->insertDefaultButtonIn($index,"eye","_display basic",$visibleHover,$callback,"display");
254
+		return $this->insertDefaultButtonIn($index, "eye", "_display basic", $visibleHover, $callback, "display");
255 255
 	}
256 256
 
257 257
 	/**
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	 * @param array  $_buttons
266 266
 	 */
267 267
 	public function setButtons($_buttons) {
268
-		$this->_buttons = $_buttons;
268
+		$this->_buttons=$_buttons;
269 269
 		return $this;
270 270
 	}
271 271
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -68,15 +68,17 @@  discard block
 block discarded – undo
68 68
 	private function getFieldButton($caption,$visibleHover=true,$icon=null){
69 69
 		$id=$this->_instanceViewer->getIdentifier();
70 70
 		$bt= new HtmlButton($this->cleanIdentifier($icon??$caption).'-'.$id,$caption);
71
-		if($visibleHover)
72
-			$this->_visibleOver($bt);
71
+		if($visibleHover) {
72
+					$this->_visibleOver($bt);
73
+		}
73 74
 		return $bt;
74 75
 	}
75 76
 
76 77
 	private function getFieldButtons($buttons,$visibleHover=true){
77 78
 		$bts=new HtmlButtonGroups("",$buttons);
78
-		if($visibleHover)
79
-			$this->_visibleOver($bts);
79
+		if($visibleHover) {
80
+					$this->_visibleOver($bts);
81
+		}
80 82
 		return $bts;
81 83
 	}
82 84
 
@@ -93,8 +95,9 @@  discard block
 block discarded – undo
93 95
 		return $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$attributes){
94 96
 			$button=new HtmlButton($id,$value,$cssStyle);
95 97
 			$button->postOnClick($url,"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes["ajax"]);
96
-			if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"])
97
-				$this->_visibleOver($button);
98
+			if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) {
99
+							$this->_visibleOver($button);
100
+			}
98 101
 				return $button;
99 102
 		}, $index,$attributes);
100 103
 	}
@@ -165,8 +168,9 @@  discard block
 block discarded – undo
165 168
 	private function getDefaultButton($icon,$class=null,$visibleHover=true){
166 169
 		$bt=$this->getFieldButton("",$visibleHover,$icon);
167 170
 		$bt->asIcon($icon);
168
-		if(isset($class))
169
-			$bt->addClass($class);
171
+		if(isset($class)) {
172
+					$bt->addClass($class);
173
+		}
170 174
 		return $bt;
171 175
 	}
172 176
 
Please login to merge, or discard this patch.
Ajax/semantic/widgets/base/InstanceViewer.php 2 patches
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -29,17 +29,17 @@  discard block
 block discarded – undo
29 29
 
30 30
 	protected $groupByFields;
31 31
 
32
-	public static $index = 0;
32
+	public static $index=0;
33 33
 
34
-	public function __construct($identifier, $instance = NULL, $captions = NULL) {
35
-		$this->widgetIdentifier = $identifier;
36
-		$this->values = [];
37
-		$this->afterCompile = [];
34
+	public function __construct($identifier, $instance=NULL, $captions=NULL) {
35
+		$this->widgetIdentifier=$identifier;
36
+		$this->values=[];
37
+		$this->afterCompile=[];
38 38
 		if (isset($instance))
39 39
 			$this->setInstance($instance);
40 40
 		$this->setCaptions($captions);
41
-		$this->captionCallback = NULL;
42
-		$this->defaultValueFunction = function ($name, $value) {
41
+		$this->captionCallback=NULL;
42
+		$this->defaultValueFunction=function($name, $value) {
43 43
 			return $value;
44 44
 		};
45 45
 	}
@@ -66,47 +66,47 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 
68 68
 	public function getValues() {
69
-		$values = [];
70
-		$index = 0;
71
-		$count = $this->count();
72
-		$hasGroupby = is_array($this->groupByFields);
73
-		if (! $hasGroupby) {
74
-			while ($index < $count) {
75
-				$values[] = $this->getValue($index ++);
69
+		$values=[];
70
+		$index=0;
71
+		$count=$this->count();
72
+		$hasGroupby=is_array($this->groupByFields);
73
+		if (!$hasGroupby) {
74
+			while ($index<$count) {
75
+				$values[]=$this->getValue($index++);
76 76
 			}
77 77
 		} else {
78
-			while ($index < $count) {
79
-				if (array_search($index, $this->groupByFields) === false) {
80
-					$values[] = $this->getValue($index);
78
+			while ($index<$count) {
79
+				if (array_search($index, $this->groupByFields)===false) {
80
+					$values[]=$this->getValue($index);
81 81
 				}
82
-				$index ++;
82
+				$index++;
83 83
 			}
84 84
 		}
85 85
 		return $values;
86 86
 	}
87 87
 
88
-	public function getIdentifier($index = NULL) {
89
-		if (! isset($index))
90
-			$index = self::$index;
91
-		$value = $index;
88
+	public function getIdentifier($index=NULL) {
89
+		if (!isset($index))
90
+			$index=self::$index;
91
+		$value=$index;
92 92
 		if (isset($this->values["identifier"])) {
93 93
 			if (\is_string($this->values["identifier"]))
94
-				$value = JReflection::callMethod($this->instance, $this->values["identifier"], []);
94
+				$value=JReflection::callMethod($this->instance, $this->values["identifier"], []);
95 95
 			else
96
-				$value = $this->values["identifier"]($index, $this->instance);
96
+				$value=$this->values["identifier"]($index, $this->instance);
97 97
 		}
98 98
 		return $value;
99 99
 	}
100 100
 
101 101
 	public function getValue($index) {
102
-		$property = $this->properties[$index];
102
+		$property=$this->properties[$index];
103 103
 		return $this->_getValue($property, $index);
104 104
 	}
105 105
 
106 106
 	protected function _beforeAddProperty($index, &$field) {}
107 107
 
108 108
 	protected function _getDefaultValue($name, $value, $index) {
109
-		$func = $this->defaultValueFunction;
109
+		$func=$this->defaultValueFunction;
110 110
 		return $func($name, $value, $index, $this->instance);
111 111
 	}
112 112
 
@@ -116,27 +116,27 @@  discard block
 block discarded – undo
116 116
 	}
117 117
 
118 118
 	protected function _getValue($property, $index) {
119
-		$value = null;
120
-		$propertyName = $property;
119
+		$value=null;
120
+		$propertyName=$property;
121 121
 		if ($property instanceof \ReflectionProperty) {
122
-			$value = $this->_getPropertyValue($property);
123
-			$propertyName = $property->getName();
124
-		} elseif (\is_callable($property) && \array_search($property, ['system','date']) === false){
125
-			try{
126
-				$value = $property($this->instance);
127
-			}catch(\Error $e){}
122
+			$value=$this->_getPropertyValue($property);
123
+			$propertyName=$property->getName();
124
+		} elseif (\is_callable($property) && \array_search($property, ['system', 'date'])===false) {
125
+			try {
126
+				$value=$property($this->instance);
127
+			}catch (\Error $e) {}
128 128
 		}
129 129
 		elseif (\is_array($property)) {
130
-			$values = \array_map(function ($v) use ($index) {
130
+			$values=\array_map(function($v) use ($index) {
131 131
 				return $this->_getValue($v, $index);
132 132
 			}, $property);
133
-			$value = \implode('', $values);
133
+			$value=\implode('', $values);
134 134
 		} elseif (\is_string($property)) {
135
-			$value = '';
135
+			$value='';
136 136
 			if (isset($this->instance->{$property})) {
137
-				$value = $this->instance->{$property};
138
-			} elseif (\method_exists($this->instance, $getter = JReflection::getterName($property))) {
139
-				$value = JReflection::callMethod($this->instance, $getter, []);
137
+				$value=$this->instance->{$property};
138
+			} elseif (\method_exists($this->instance, $getter=JReflection::getterName($property))) {
139
+				$value=JReflection::callMethod($this->instance, $getter, []);
140 140
 			}
141 141
 		}
142 142
 
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
 
146 146
 	protected function _postGetValue($index, $propertyName, $value) {
147 147
 		if (isset($this->values[$index])) {
148
-			$value = $this->values[$index]($value, $this->instance, $index, self::$index);
148
+			$value=$this->values[$index]($value, $this->instance, $index, self::$index);
149 149
 		} else {
150
-			$value = $this->_getDefaultValue($propertyName, $value, $index);
150
+			$value=$this->_getDefaultValue($propertyName, $value, $index);
151 151
 		}
152 152
 		if (isset($this->afterCompile[$index])) {
153 153
 			if (\is_callable($this->afterCompile[$index])) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 		return $value;
158 158
 	}
159 159
 
160
-	public function insertField($index, $field, $key = null) {
160
+	public function insertField($index, $field, $key=null) {
161 161
 		if (isset($key)) {
162 162
 			array_splice($this->visibleProperties, $index, 0, [
163 163
 				$key => $field
@@ -171,29 +171,29 @@  discard block
 block discarded – undo
171 171
 	public function sortColumnContent($index, $array) {
172 172
 		if (isset($this->visibleProperties[$index])) {
173 173
 			if (is_array($this->visibleProperties[$index])) {
174
-				$this->visibleProperties[$index] = JArray::sortAssociative($this->visibleProperties[$index], $array);
174
+				$this->visibleProperties[$index]=JArray::sortAssociative($this->visibleProperties[$index], $array);
175 175
 			}
176 176
 		}
177 177
 		return $this;
178 178
 	}
179 179
 
180
-	public function insertInField($index, $field, $key = null) {
181
-		$vb = $this->visibleProperties;
180
+	public function insertInField($index, $field, $key=null) {
181
+		$vb=$this->visibleProperties;
182 182
 		if (isset($vb[$index])) {
183 183
 			if (isset($key)) {
184 184
 				if (\is_array($vb[$index])) {
185
-					$this->visibleProperties[$index][$key] = $field;
185
+					$this->visibleProperties[$index][$key]=$field;
186 186
 				} else {
187
-					$this->visibleProperties[$index] = [
187
+					$this->visibleProperties[$index]=[
188 188
 						$vb[$index],
189 189
 						$key => $field
190 190
 					];
191 191
 				}
192 192
 			} else {
193 193
 				if (\is_array($vb[$index])) {
194
-					$this->visibleProperties[$index][] = $field;
194
+					$this->visibleProperties[$index][]=$field;
195 195
 				} else {
196
-					$this->visibleProperties[$index] = [
196
+					$this->visibleProperties[$index]=[
197 197
 						$vb[$index],
198 198
 						$field
199 199
 					];
@@ -205,19 +205,19 @@  discard block
 block discarded – undo
205 205
 		return $this;
206 206
 	}
207 207
 
208
-	public function addField($field, $key = null) {
208
+	public function addField($field, $key=null) {
209 209
 		if (isset($key)) {
210
-			$this->visibleProperties[] = [
210
+			$this->visibleProperties[]=[
211 211
 				$key => $field
212 212
 			];
213 213
 		} else {
214
-			$this->visibleProperties[] = $field;
214
+			$this->visibleProperties[]=$field;
215 215
 		}
216 216
 		return $this;
217 217
 	}
218 218
 
219 219
 	public function addFields($fields) {
220
-		$this->visibleProperties = \array_merge($this->visibleProperties, $fields);
220
+		$this->visibleProperties=\array_merge($this->visibleProperties, $fields);
221 221
 		return $this;
222 222
 	}
223 223
 
@@ -234,37 +234,37 @@  discard block
 block discarded – undo
234 234
 	}
235 235
 
236 236
 	public function getFieldName($index) {
237
-		$property = $this->getProperty($index);
237
+		$property=$this->getProperty($index);
238 238
 		if ($property instanceof \ReflectionProperty) {
239
-			$result = $property->getName();
239
+			$result=$property->getName();
240 240
 		} elseif (\is_callable($property)) {
241
-			$result = $this->visibleProperties[$index];
241
+			$result=$this->visibleProperties[$index];
242 242
 		} else {
243
-			$result = $property;
243
+			$result=$property;
244 244
 		}
245 245
 		return $result;
246 246
 	}
247 247
 
248 248
 	protected function showableProperty(\ReflectionProperty $rProperty) {
249
-		return JString::startswith($rProperty->getName(), "_") === false;
249
+		return JString::startswith($rProperty->getName(), "_")===false;
250 250
 	}
251 251
 
252 252
 	public function setInstance($instance) {
253 253
 		if (\is_string($instance) && \class_exists($instance)) {
254
-			$instance = new $instance();
254
+			$instance=new $instance();
255 255
 		}
256
-		$this->instance = $instance;
257
-		$this->properties = [];
258
-		try{
259
-			$this->reflect = new \ReflectionClass($instance);
260
-			if (JArray::count($this->visibleProperties) === 0) {
261
-				$this->properties = $this->getDefaultProperties();
256
+		$this->instance=$instance;
257
+		$this->properties=[];
258
+		try {
259
+			$this->reflect=new \ReflectionClass($instance);
260
+			if (JArray::count($this->visibleProperties)===0) {
261
+				$this->properties=$this->getDefaultProperties();
262 262
 			} else {
263 263
 				foreach ($this->visibleProperties as $property) {
264 264
 					$this->setInstanceProperty($property);
265 265
 				}
266 266
 			}
267
-		}catch (\Throwable $th){
267
+		}catch (\Throwable $th) {
268 268
 			
269 269
 		}
270 270
 		return $this;
@@ -272,56 +272,56 @@  discard block
 block discarded – undo
272 272
 
273 273
 	private function setInstanceProperty($property) {
274 274
 		if (\is_callable($property)) {
275
-			$this->properties[] = $property;
275
+			$this->properties[]=$property;
276 276
 		} elseif (\is_string($property)) {
277 277
 			try {
278 278
 				$this->_beforeAddProperty(\sizeof($this->properties), $property);
279
-				$rProperty = $this->reflect->getProperty($property);
280
-				$this->properties[] = $rProperty;
281
-			} catch (\Exception $e) {
279
+				$rProperty=$this->reflect->getProperty($property);
280
+				$this->properties[]=$rProperty;
281
+			}catch (\Exception $e) {
282 282
 				$this->_beforeAddProperty(\sizeof($this->properties), $property);
283
-				$this->properties[] = $property;
283
+				$this->properties[]=$property;
284 284
 			}
285 285
 		} elseif (\is_int($property)) {
286
-			$props = $this->getDefaultProperties();
286
+			$props=$this->getDefaultProperties();
287 287
 			if (isset($props[$property]))
288
-				$this->properties[] = $props[$property];
288
+				$this->properties[]=$props[$property];
289 289
 			else
290
-				$this->properties[] = $property;
290
+				$this->properties[]=$property;
291 291
 		} else {
292
-			$this->properties[] = $property;
292
+			$this->properties[]=$property;
293 293
 		}
294 294
 	}
295 295
 
296 296
 	protected function getDefaultProperties() {
297
-		$result = [];
298
-		$properties = $this->reflect->getProperties();
297
+		$result=[];
298
+		$properties=$this->reflect->getProperties();
299 299
 		foreach ($properties as $property) {
300
-			$showable = $this->showableProperty($property);
301
-			if ($showable !== false) {
302
-				$result[] = $property;
300
+			$showable=$this->showableProperty($property);
301
+			if ($showable!==false) {
302
+				$result[]=$property;
303 303
 			}
304 304
 		}
305 305
 		return $result;
306 306
 	}
307 307
 
308 308
 	public function setVisibleProperties($visibleProperties) {
309
-		$this->visibleProperties = $visibleProperties;
309
+		$this->visibleProperties=$visibleProperties;
310 310
 		return $this;
311 311
 	}
312 312
 
313 313
 	public function setValueFunction($index, $callback) {
314
-		$this->values[$index] = $callback;
314
+		$this->values[$index]=$callback;
315 315
 		return $this;
316 316
 	}
317 317
 
318 318
 	public function setIdentifierFunction($callback) {
319
-		$this->values["identifier"] = $callback;
319
+		$this->values["identifier"]=$callback;
320 320
 		return $this;
321 321
 	}
322 322
 
323 323
 	public static function setIndex($index) {
324
-		self::$index = $index;
324
+		self::$index=$index;
325 325
 	}
326 326
 
327 327
 	public function getProperties() {
@@ -341,43 +341,43 @@  discard block
 block discarded – undo
341 341
 	}
342 342
 
343 343
 	public function getCaptions() {
344
-		$hasGroupby = is_array($this->groupByFields);
345
-		$count = $this->count();
346
-		$moreAdded = false;
344
+		$hasGroupby=is_array($this->groupByFields);
345
+		$count=$this->count();
346
+		$moreAdded=false;
347 347
 		if (isset($this->captions)) {
348
-			$captions = \array_values($this->captions);
349
-			$gbSize = $hasGroupby ? sizeof($this->groupByFields) : 0;
350
-			$captionsSize = \sizeof($captions);
351
-			for ($i = $captionsSize; $i < $count - $gbSize; $i ++) {
352
-				$captions[] = "";
353
-				$moreAdded = true;
348
+			$captions=\array_values($this->captions);
349
+			$gbSize=$hasGroupby ? sizeof($this->groupByFields) : 0;
350
+			$captionsSize=\sizeof($captions);
351
+			for ($i=$captionsSize; $i<$count-$gbSize; $i++) {
352
+				$captions[]="";
353
+				$moreAdded=true;
354 354
 			}
355 355
 		} else {
356
-			$captions = [];
357
-			$index = 0;
358
-			while ($index < $count) {
359
-				$captions[] = $this->getCaption($index ++);
356
+			$captions=[];
357
+			$index=0;
358
+			while ($index<$count) {
359
+				$captions[]=$this->getCaption($index++);
360 360
 			}
361 361
 		}
362
-		if ($hasGroupby && sizeof($captions) >= $count && ! $moreAdded) {
363
-			$captions = JArray::removeByKeys($captions, $this->groupByFields);
362
+		if ($hasGroupby && sizeof($captions)>=$count && !$moreAdded) {
363
+			$captions=JArray::removeByKeys($captions, $this->groupByFields);
364 364
 		}
365 365
 		if (isset($this->captionCallback) && \is_callable($this->captionCallback)) {
366
-			$callback = $this->captionCallback;
366
+			$callback=$this->captionCallback;
367 367
 			$callback($captions, $this->instance);
368 368
 		}
369 369
 		return $captions;
370 370
 	}
371 371
 
372 372
 	public function setCaption($index, $caption) {
373
-		if (isset($this->captions) === false)
374
-			$this->captions = [];
375
-		$this->captions[$index] = $caption;
373
+		if (isset($this->captions)===false)
374
+			$this->captions=[];
375
+		$this->captions[$index]=$caption;
376 376
 		return $this;
377 377
 	}
378 378
 
379 379
 	public function setCaptions($captions) {
380
-		$this->captions = $captions;
380
+		$this->captions=$captions;
381 381
 		return $this;
382 382
 	}
383 383
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	 * @return InstanceViewer
393 393
 	 */
394 394
 	public function afterCompile($index, $callback) {
395
-		$this->afterCompile[$index] = $callback;
395
+		$this->afterCompile[$index]=$callback;
396 396
 		return $this;
397 397
 	}
398 398
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 	 * @return \Ajax\semantic\widgets\base\InstanceViewer
405 405
 	 */
406 406
 	public function setCaptionCallback($captionCallback) {
407
-		$this->captionCallback = $captionCallback;
407
+		$this->captionCallback=$captionCallback;
408 408
 		return $this;
409 409
 	}
410 410
 
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 	 * @return \Ajax\semantic\widgets\base\InstanceViewer
417 417
 	 */
418 418
 	public function setDefaultValueFunction($defaultValueFunction) {
419
-		$this->defaultValueFunction = $defaultValueFunction;
419
+		$this->defaultValueFunction=$defaultValueFunction;
420 420
 		return $this;
421 421
 	}
422 422
 
@@ -425,8 +425,8 @@  discard block
 block discarded – undo
425 425
 	}
426 426
 
427 427
 	public function getSimpleProperties() {
428
-		return array_filter($this->visibleProperties, function ($item) {
429
-			return ! (is_array($item) || is_object($item));
428
+		return array_filter($this->visibleProperties, function($item) {
429
+			return !(is_array($item) || is_object($item));
430 430
 		});
431 431
 	}
432 432
 
@@ -451,10 +451,10 @@  discard block
 block discarded – undo
451 451
 	 * @param mixed $groupByFields
452 452
 	 */
453 453
 	public function setGroupByFields($groupByFields) {
454
-		$this->groupByFields = $groupByFields;
454
+		$this->groupByFields=$groupByFields;
455 455
 	}
456 456
 	
457
-	public function addGroupBy($groupByField){
457
+	public function addGroupBy($groupByField) {
458 458
 		$this->groupByFields[]=$groupByField;
459 459
 	}
460 460
 
Please login to merge, or discard this patch.
Braces   +29 added lines, -24 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@  discard block
 block discarded – undo
35 35
 		$this->widgetIdentifier = $identifier;
36 36
 		$this->values = [];
37 37
 		$this->afterCompile = [];
38
-		if (isset($instance))
39
-			$this->setInstance($instance);
38
+		if (isset($instance)) {
39
+					$this->setInstance($instance);
40
+		}
40 41
 		$this->setCaptions($captions);
41 42
 		$this->captionCallback = NULL;
42 43
 		$this->defaultValueFunction = function ($name, $value) {
@@ -86,14 +87,16 @@  discard block
 block discarded – undo
86 87
 	}
87 88
 
88 89
 	public function getIdentifier($index = NULL) {
89
-		if (! isset($index))
90
-			$index = self::$index;
90
+		if (! isset($index)) {
91
+					$index = self::$index;
92
+		}
91 93
 		$value = $index;
92 94
 		if (isset($this->values["identifier"])) {
93
-			if (\is_string($this->values["identifier"]))
94
-				$value = JReflection::callMethod($this->instance, $this->values["identifier"], []);
95
-			else
96
-				$value = $this->values["identifier"]($index, $this->instance);
95
+			if (\is_string($this->values["identifier"])) {
96
+							$value = JReflection::callMethod($this->instance, $this->values["identifier"], []);
97
+			} else {
98
+							$value = $this->values["identifier"]($index, $this->instance);
99
+			}
97 100
 		}
98 101
 		return $value;
99 102
 	}
@@ -124,9 +127,8 @@  discard block
 block discarded – undo
124 127
 		} elseif (\is_callable($property) && \array_search($property, ['system','date']) === false){
125 128
 			try{
126 129
 				$value = $property($this->instance);
127
-			}catch(\Error $e){}
128
-		}
129
-		elseif (\is_array($property)) {
130
+			} catch(\Error $e){}
131
+		} elseif (\is_array($property)) {
130 132
 			$values = \array_map(function ($v) use ($index) {
131 133
 				return $this->_getValue($v, $index);
132 134
 			}, $property);
@@ -264,7 +266,7 @@  discard block
 block discarded – undo
264 266
 					$this->setInstanceProperty($property);
265 267
 				}
266 268
 			}
267
-		}catch (\Throwable $th){
269
+		} catch (\Throwable $th){
268 270
 			
269 271
 		}
270 272
 		return $this;
@@ -284,10 +286,11 @@  discard block
 block discarded – undo
284 286
 			}
285 287
 		} elseif (\is_int($property)) {
286 288
 			$props = $this->getDefaultProperties();
287
-			if (isset($props[$property]))
288
-				$this->properties[] = $props[$property];
289
-			else
290
-				$this->properties[] = $property;
289
+			if (isset($props[$property])) {
290
+							$this->properties[] = $props[$property];
291
+			} else {
292
+							$this->properties[] = $property;
293
+			}
291 294
 		} else {
292 295
 			$this->properties[] = $property;
293 296
 		}
@@ -332,12 +335,13 @@  discard block
 block discarded – undo
332 335
 		if (isset($this->captions[$index])) {
333 336
 			return $this->captions[$index];
334 337
 		}
335
-		if ($this->properties[$index] instanceof \ReflectionProperty)
336
-			return $this->properties[$index]->getName();
337
-		elseif (\is_callable($this->properties[$index]))
338
-			return "";
339
-		else
340
-			return $this->properties[$index];
338
+		if ($this->properties[$index] instanceof \ReflectionProperty) {
339
+					return $this->properties[$index]->getName();
340
+		} elseif (\is_callable($this->properties[$index])) {
341
+					return "";
342
+		} else {
343
+					return $this->properties[$index];
344
+		}
341 345
 	}
342 346
 
343 347
 	public function getCaptions() {
@@ -370,8 +374,9 @@  discard block
 block discarded – undo
370 374
 	}
371 375
 
372 376
 	public function setCaption($index, $caption) {
373
-		if (isset($this->captions) === false)
374
-			$this->captions = [];
377
+		if (isset($this->captions) === false) {
378
+					$this->captions = [];
379
+		}
375 380
 		$this->captions[$index] = $caption;
376 381
 		return $this;
377 382
 	}
Please login to merge, or discard this patch.
Ajax/common/BaseEnum.php 2 patches
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@
 block discarded – undo
27 27
 	}
28 28
 
29 29
 	public static function getConstantValues($postFix = "", $prefixBefore = false) {
30
-		if ($postFix == "")
31
-			return \array_values(self::getConstants());
32
-		else {
30
+		if ($postFix == "") {
31
+					return \array_values(self::getConstants());
32
+		} else {
33 33
 			if ($prefixBefore === false) {
34 34
 				return \array_map(function ($elem) use ($postFix) {
35 35
 					return $elem . " " . $postFix;
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -10,65 +10,65 @@
 block discarded – undo
10 10
  */
11 11
 abstract class BaseEnum {
12 12
 
13
-	private static $constCacheArray = NULL;
13
+	private static $constCacheArray=NULL;
14 14
 
15
-	private static $picked = [];
15
+	private static $picked=[];
16 16
 
17 17
 	public static function getConstants() {
18
-		if (self::$constCacheArray == NULL) {
19
-			self::$constCacheArray = [];
18
+		if (self::$constCacheArray==NULL) {
19
+			self::$constCacheArray=[];
20 20
 		}
21
-		$calledClass = get_called_class();
22
-		if (! \array_key_exists($calledClass, self::$constCacheArray)) {
23
-			$reflect = new \ReflectionClass($calledClass);
24
-			self::$constCacheArray[$calledClass] = $reflect->getConstants();
21
+		$calledClass=get_called_class();
22
+		if (!\array_key_exists($calledClass, self::$constCacheArray)) {
23
+			$reflect=new \ReflectionClass($calledClass);
24
+			self::$constCacheArray[$calledClass]=$reflect->getConstants();
25 25
 		}
26 26
 		return self::$constCacheArray[$calledClass];
27 27
 	}
28 28
 
29
-	public static function getConstantValues($postFix = "", $prefixBefore = false) {
30
-		if ($postFix == "")
29
+	public static function getConstantValues($postFix="", $prefixBefore=false) {
30
+		if ($postFix=="")
31 31
 			return \array_values(self::getConstants());
32 32
 		else {
33
-			if ($prefixBefore === false) {
34
-				return \array_map(function ($elem) use ($postFix) {
35
-					return $elem . " " . $postFix;
33
+			if ($prefixBefore===false) {
34
+				return \array_map(function($elem) use ($postFix) {
35
+					return $elem." ".$postFix;
36 36
 				}, \array_values(self::getConstants()));
37 37
 			} else {
38
-				return \array_map(function ($elem) use ($postFix) {
39
-					return $postFix . " " . $elem;
38
+				return \array_map(function($elem) use ($postFix) {
39
+					return $postFix." ".$elem;
40 40
 				}, \array_values(self::getConstants()));
41 41
 			}
42 42
 		}
43 43
 	}
44 44
 
45
-	public static function isValidName($name, $strict = false) {
46
-		$constants = self::getConstants();
45
+	public static function isValidName($name, $strict=false) {
46
+		$constants=self::getConstants();
47 47
 
48 48
 		if ($strict) {
49 49
 			return \array_key_exists($name, $constants);
50 50
 		}
51 51
 
52
-		$keys = \array_map('strtolower', array_keys($constants));
52
+		$keys=\array_map('strtolower', array_keys($constants));
53 53
 		return \in_array(\strtolower($name), $keys);
54 54
 	}
55 55
 
56 56
 	public static function isValidValue($value) {
57
-		$values = \array_values(self::getConstants());
57
+		$values=\array_values(self::getConstants());
58 58
 		return \in_array($value, $values, true);
59 59
 	}
60 60
 
61
-	public static function getRandomValue(bool $unique = false) {
62
-		$values = self::getConstantValues();
63
-		$count = \count($values);
64
-		$calledClass = \get_called_class();
65
-		if ($unique && $count > count(self::$picked[$calledClass] ?? [])) {
61
+	public static function getRandomValue(bool $unique=false) {
62
+		$values=self::getConstantValues();
63
+		$count=\count($values);
64
+		$calledClass=\get_called_class();
65
+		if ($unique && $count>count(self::$picked[$calledClass] ?? [])) {
66 66
 			do {
67
-				$newVal = $values[\rand(0, $count - 1)];
67
+				$newVal=$values[\rand(0, $count-1)];
68 68
 			} while (isset(self::$picked[$calledClass][$newVal]));
69
-			self::$picked[$calledClass][$newVal] = true;
69
+			self::$picked[$calledClass][$newVal]=true;
70 70
 			return $newVal;
71 71
 		}
72
-		return $values[\rand(0, $count - 1)];
72
+		return $values[\rand(0, $count-1)];
73 73
 	}
74 74
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/icons/Animals.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,5 +5,5 @@
 block discarded – undo
5 5
 
6 6
 abstract class Animals extends BaseEnum {
7 7
 
8
-	const CAT = 'cat', CROW = 'crow', DOG = 'dog', DOVE = 'dove', DRAGON = 'dragon', FEATHER = 'feather', FEATHER_ALTERNATE = 'feather alternate', FISH = 'fish', FOG = 'frog', HIPPO = 'hippo', HORSE = 'horse', HORSE_HEAD = 'horse head', KIWI_BIRD = 'kiwi bird', OTTER = 'otter', PAW = 'paw', SPIDER = 'spider';
8
+	const CAT='cat', CROW='crow', DOG='dog', DOVE='dove', DRAGON='dragon', FEATHER='feather', FEATHER_ALTERNATE='feather alternate', FISH='fish', FOG='frog', HIPPO='hippo', HORSE='horse', HORSE_HEAD='horse head', KIWI_BIRD='kiwi bird', OTTER='otter', PAW='paw', SPIDER='spider';
9 9
 }
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/DataTable.php 2 patches
Braces   +33 added lines, -22 removed lines patch added patch discarded remove patch
@@ -89,10 +89,12 @@  discard block
 block discarded – undo
89 89
 					"stopPropagation" => true
90 90
 				]);
91 91
 			}
92
-			if (\is_array($this->_deleteBehavior))
93
-				$this->_generateBehavior("delete", $this->_deleteBehavior, $js);
94
-			if (\is_array($this->_editBehavior))
95
-				$this->_generateBehavior("edit", $this->_editBehavior, $js);
92
+			if (\is_array($this->_deleteBehavior)) {
93
+							$this->_generateBehavior("delete", $this->_deleteBehavior, $js);
94
+			}
95
+			if (\is_array($this->_editBehavior)) {
96
+							$this->_generateBehavior("edit", $this->_editBehavior, $js);
97
+			}
96 98
 			if (\is_array($this->_displayBehavior)) {
97 99
 				$this->_generateBehavior("display", $this->_displayBehavior, $js);
98 100
 			}
@@ -150,8 +152,9 @@  discard block
 block discarded – undo
150 152
 			$table->setRowCount(0, \count($captions));
151 153
 			$this->_generateHeader($table, $captions);
152 154
 
153
-			if (isset($this->_compileParts))
154
-				$table->setCompileParts($this->_compileParts);
155
+			if (isset($this->_compileParts)) {
156
+							$table->setCompileParts($this->_compileParts);
157
+			}
155 158
 
156 159
 			$this->_generateContent($table);
157 160
 
@@ -189,8 +192,9 @@  discard block
 block discarded – undo
189 192
 	}
190 193
 
191 194
 	protected function _applyStyleAttributes($table) {
192
-		if (isset($this->_hiddenColumns))
193
-			$this->_hideColumns();
195
+		if (isset($this->_hiddenColumns)) {
196
+					$this->_hideColumns();
197
+		}
194 198
 		if (isset($this->_colWidths)) {
195 199
 			foreach ($this->_colWidths as $colIndex => $width) {
196 200
 				$table->setColWidth($colIndex, $width);
@@ -303,8 +307,9 @@  discard block
 block discarded – undo
303 307
 			$field = $ck->getField();
304 308
 			$field->setProperty("value", $dataAjax);
305 309
 			$field->setProperty("name", "selection[]");
306
-			if (isset($checkedClass))
307
-				$field->setClass($checkedClass);
310
+			if (isset($checkedClass)) {
311
+							$field->setClass($checkedClass);
312
+			}
308 313
 			\array_unshift($values, $ck);
309 314
 		}
310 315
 		$result = $table->newRow();
@@ -321,8 +326,9 @@  discard block
 block discarded – undo
321 326
 
322 327
 	protected function _generatePagination($table) {
323 328
 		if (isset($this->_toolbar)) {
324
-			if ($this->_toolbarPosition == PositionInTable::FOOTER)
325
-				$this->_toolbar->setFloated("left");
329
+			if ($this->_toolbarPosition == PositionInTable::FOOTER) {
330
+							$this->_toolbar->setFloated("left");
331
+			}
326 332
 		}
327 333
 		$footer = $table->getFooter();
328 334
 		$footer->mergeCol();
@@ -364,8 +370,9 @@  discard block
 block discarded – undo
364 370
 
365 371
 	protected function _getFieldName($index) {
366 372
 		$fieldName = parent::_getFieldName($index);
367
-		if (\is_object($fieldName))
368
-			$fieldName = "field-" . $index;
373
+		if (\is_object($fieldName)) {
374
+					$fieldName = "field-" . $index;
375
+		}
369 376
 		if ($this->_namePrefix != null) {
370 377
 			$fieldName = $this->_namePrefix . '.' . $fieldName;
371 378
 		}
@@ -557,8 +564,9 @@  discard block
 block discarded – undo
557 564
 
558 565
 	protected function getTargetSelector($op) {
559 566
 		$result = $this->_targetSelector;
560
-		if (! isset($result[$op]))
561
-			$result = "#" . $this->identifier;
567
+		if (! isset($result[$op])) {
568
+					$result = "#" . $this->identifier;
569
+		}
562 570
 		return $result[$op];
563 571
 	}
564 572
 
@@ -581,8 +589,9 @@  discard block
 block discarded – undo
581 589
 	}
582 590
 
583 591
 	public function getRefreshSelector() {
584
-		if (isset($this->_refreshSelector))
585
-			return $this->_refreshSelector;
592
+		if (isset($this->_refreshSelector)) {
593
+					return $this->_refreshSelector;
594
+		}
586 595
 		return "#" . $this->identifier . " tbody";
587 596
 	}
588 597
 
@@ -603,8 +612,9 @@  discard block
 block discarded – undo
603 612
 	 */
604 613
 	public function show($modelInstance) {
605 614
 		if (\is_array($modelInstance)) {
606
-			if (isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0]))
607
-				$modelInstance = \json_decode(\json_encode($modelInstance), FALSE);
615
+			if (isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0])) {
616
+							$modelInstance = \json_decode(\json_encode($modelInstance), FALSE);
617
+			}
608 618
 		}
609 619
 		$this->_modelInstance = $modelInstance;
610 620
 	}
@@ -654,8 +664,9 @@  discard block
 block discarded – undo
654 664
 	}
655 665
 
656 666
 	public function hideColumn($colIndex) {
657
-		if (! \is_array($this->_hiddenColumns))
658
-			$this->_hiddenColumns = [];
667
+		if (! \is_array($this->_hiddenColumns)) {
668
+					$this->_hiddenColumns = [];
669
+		}
659 670
 		$this->_hiddenColumns[] = $colIndex;
660 671
 		return $this;
661 672
 	}
Please login to merge, or discard this patch.
Spacing   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  *
26 26
  */
27 27
 class DataTable extends Widget {
28
-	use TableTrait,DataTableFieldAsTrait,HasCheckboxesTrait,BaseTrait;
28
+	use TableTrait, DataTableFieldAsTrait, HasCheckboxesTrait, BaseTrait;
29 29
 
30 30
 	protected $_searchField;
31 31
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 	protected $_displayBehavior;
43 43
 
44
-	protected $_visibleHover = false;
44
+	protected $_visibleHover=false;
45 45
 
46 46
 	protected $_targetSelector;
47 47
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
 	protected $_json;
53 53
 
54
-	protected $_rowClass = "_element";
54
+	protected $_rowClass="_element";
55 55
 
56 56
 	protected $_sortable;
57 57
 
@@ -65,26 +65,26 @@  discard block
 block discarded – undo
65 65
 
66 66
 	protected $_namePrefix;
67 67
 
68
-	public function __construct($identifier, $model, $modelInstance = NULL) {
68
+	public function __construct($identifier, $model, $modelInstance=NULL) {
69 69
 		parent::__construct($identifier, $model, $modelInstance);
70 70
 		$this->_init(new InstanceViewer($identifier), "table", new HtmlTable($identifier, 0, 0), false);
71
-		$this->_urls = [];
72
-		$this->_emptyMessage = new HtmlMessage("", "nothing to display");
71
+		$this->_urls=[];
72
+		$this->_emptyMessage=new HtmlMessage("", "nothing to display");
73 73
 		$this->_emptyMessage->setIcon("info circle");
74 74
 	}
75 75
 
76 76
 	public function run(JsUtils $js) {
77
-		if ($this->_runned !== true) {
78
-			$offset = $js->scriptCount();
77
+		if ($this->_runned!==true) {
78
+			$offset=$js->scriptCount();
79 79
 			if ($this->_hasCheckboxes && isset($js)) {
80 80
 				$this->_runCheckboxes($js);
81 81
 			}
82 82
 			if ($this->_visibleHover) {
83
-				$js->execOn("mouseover", "#" . $this->identifier . " tr", "$(event.currentTarget).closest('tr').find('.visibleover').css('visibility', 'visible');", [
83
+				$js->execOn("mouseover", "#".$this->identifier." tr", "$(event.currentTarget).closest('tr').find('.visibleover').css('visibility', 'visible');", [
84 84
 					"preventDefault" => false,
85 85
 					"stopPropagation" => true
86 86
 				]);
87
-				$js->execOn("mouseout", "#" . $this->identifier . " tr", "$(event.currentTarget).closest('tr').find('.visibleover').css('visibility', 'hidden');$(event.currentTarget).trigger('visibleoverOut');", [
87
+				$js->execOn("mouseout", "#".$this->identifier." tr", "$(event.currentTarget).closest('tr').find('.visibleover').css('visibility', 'hidden');$(event.currentTarget).trigger('visibleoverOut');", [
88 88
 					"preventDefault" => false,
89 89
 					"stopPropagation" => true
90 90
 				]);
@@ -101,16 +101,16 @@  discard block
 block discarded – undo
101 101
 				$this->_associatePaginationBehavior($js, $offset);
102 102
 			}
103 103
 			$this->_associateSearchFieldBehavior($js, $offset);
104
-			$this->_runned = true;
104
+			$this->_runned=true;
105 105
 		}
106 106
 	}
107 107
 
108 108
 	protected function _generateBehavior($op, $params, JsUtils $js) {
109 109
 		if (isset($this->_urls[$op])) {
110
-			$params = \array_merge($params, [
110
+			$params=\array_merge($params, [
111 111
 				"attr" => "data-ajax"
112 112
 			]);
113
-			$js->ajaxOnClick("#" . $this->identifier . " ._" . $op, $this->_urls[$op], $this->getTargetSelector($op), $params);
113
+			$js->ajaxOnClick("#".$this->identifier." ._".$op, $this->_urls[$op], $this->getTargetSelector($op), $params);
114 114
 		}
115 115
 	}
116 116
 
@@ -129,21 +129,21 @@  discard block
 block discarded – undo
129 129
 	}
130 130
 
131 131
 	public function refreshTD($fieldName, $jquery, $view) {
132
-		$index = $this->_getIndex($fieldName);
132
+		$index=$this->_getIndex($fieldName);
133 133
 		$this->compile($jquery, $view);
134 134
 		return $this->refreshTR()
135 135
 			->getTable()
136 136
 			->getCell(0, $index);
137 137
 	}
138 138
 
139
-	public function compile(JsUtils $js = NULL, &$view = NULL) {
140
-		if (! $this->_generated) {
139
+	public function compile(JsUtils $js=NULL, &$view=NULL) {
140
+		if (!$this->_generated) {
141 141
 			if (isset($this->_buttonsColumn)) {
142 142
 				$this->_instanceViewer->sortColumnContent($this->_buttonsColumn, $this->_buttons);
143 143
 			}
144 144
 			$this->_instanceViewer->setInstance($this->_model);
145
-			$captions = $this->_instanceViewer->getCaptions();
146
-			$table = $this->content["table"];
145
+			$captions=$this->_instanceViewer->getCaptions();
146
+			$table=$this->content["table"];
147 147
 			if ($this->_hasCheckboxes) {
148 148
 				$this->_generateMainCheckbox($captions);
149 149
 			}
@@ -158,17 +158,17 @@  discard block
 block discarded – undo
158 158
 			$this->compileExtraElements($table, $captions);
159 159
 			$this->_compileSearchFieldBehavior($js);
160 160
 
161
-			$this->content = JArray::sortAssociative($this->content, [
161
+			$this->content=JArray::sortAssociative($this->content, [
162 162
 				PositionInTable::BEFORETABLE,
163 163
 				"table",
164 164
 				PositionInTable::AFTERTABLE
165 165
 			]);
166
-			if ($this->_caption != null) {
166
+			if ($this->_caption!=null) {
167 167
 				$this->wrap("<div class='field'><label>{$this->_caption}</label>", "</div>");
168 168
 			}
169 169
 			$this->_compileForm();
170 170
 			$this->_applyStyleAttributes($table);
171
-			$this->_generated = true;
171
+			$this->_generated=true;
172 172
 		}
173 173
 		return parent::compile($js, $view);
174 174
 	}
@@ -206,9 +206,9 @@  discard block
 block discarded – undo
206 206
 	}
207 207
 
208 208
 	protected function _generateHeader(HtmlTable $table, $captions) {
209
-		$gbFields = $this->_instanceViewer->getGroupByFields();
209
+		$gbFields=$this->_instanceViewer->getGroupByFields();
210 210
 		if (\is_array($gbFields)) {
211
-			$captions = \array_values(JArray::removeByKeys($captions, $gbFields));
211
+			$captions=\array_values(JArray::removeByKeys($captions, $gbFields));
212 212
 		}
213 213
 		$table->setHeaderValues($captions);
214 214
 		if (isset($this->_sortable)) {
@@ -217,22 +217,22 @@  discard block
 block discarded – undo
217 217
 	}
218 218
 
219 219
 	protected function _generateContent($table) {
220
-		$objects = $this->_modelInstance;
220
+		$objects=$this->_modelInstance;
221 221
 		if (isset($this->_pagination)) {
222
-			$objects = $this->_pagination->getObjects($this->_modelInstance);
222
+			$objects=$this->_pagination->getObjects($this->_modelInstance);
223 223
 		}
224 224
 		InstanceViewer::setIndex(0);
225
-		$fields = $this->_instanceViewer->getSimpleProperties();
226
-		$groupByFields = $this->_instanceViewer->getGroupByFields();
227
-		if (! \is_array($groupByFields)) {
228
-			$table->fromDatabaseObjects($objects, function ($instance) use ($table, $fields) {
225
+		$fields=$this->_instanceViewer->getSimpleProperties();
226
+		$groupByFields=$this->_instanceViewer->getGroupByFields();
227
+		if (!\is_array($groupByFields)) {
228
+			$table->fromDatabaseObjects($objects, function($instance) use ($table, $fields) {
229 229
 				return $this->_generateRow($instance, $fields, $table);
230 230
 			});
231 231
 		} else {
232
-			$diffFields = \array_values(JArray::removeByKeys($fields, $groupByFields));
233
-			$activeValues = \array_combine($groupByFields, \array_fill(0, \count($groupByFields), null));
234
-			$uuids = [];
235
-			$table->fromDatabaseObjects($objects, function ($instance) use ($table, $fields, &$activeValues, $groupByFields, &$uuids, $diffFields) {
232
+			$diffFields=\array_values(JArray::removeByKeys($fields, $groupByFields));
233
+			$activeValues=\array_combine($groupByFields, \array_fill(0, \count($groupByFields), null));
234
+			$uuids=[];
235
+			$table->fromDatabaseObjects($objects, function($instance) use ($table, $fields, &$activeValues, $groupByFields, &$uuids, $diffFields) {
236 236
 				$this->_instanceViewer->setInstance($instance);
237 237
 				foreach ($groupByFields as $index => $gbField) {
238 238
 					$this->_generateGroupByRow($index, $gbField, $table, $fields, $activeValues, $uuids);
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
 				return $this->_generateRow($instance, $diffFields, $table, null, $uuids);
241 241
 			});
242 242
 		}
243
-		if ($table->getRowCount() == 0) {
244
-			$result = $table->addRow();
243
+		if ($table->getRowCount()==0) {
244
+			$result=$table->addRow();
245 245
 			$result->mergeCol();
246 246
 			$result->setValues([
247 247
 				$this->_emptyMessage
@@ -250,20 +250,20 @@  discard block
 block discarded – undo
250 250
 	}
251 251
 
252 252
 	protected function _generateGroupByRow($index, $gbField, $table, $fields, &$activeValues, &$uuids) {
253
-		$newValue = $this->_instanceViewer->getValue($gbField);
254
-		if ($this->getElementContent($activeValues[$gbField]) !== $this->getElementContent($newValue)) {
255
-			if ($index == 0) {
256
-				$uuids = [];
253
+		$newValue=$this->_instanceViewer->getValue($gbField);
254
+		if ($this->getElementContent($activeValues[$gbField])!==$this->getElementContent($newValue)) {
255
+			if ($index==0) {
256
+				$uuids=[];
257 257
 			}
258
-			$uuid = \uniqid("grp");
259
-			$uuids[$gbField] = $uuid;
260
-			$id = $this->_instanceViewer->getIdentifier();
261
-			$result = $table->addMergeRow(\count($fields) + 1, $newValue);
262
-			$result->setIdentifier($this->identifier . "-tr-gb-" . $id);
258
+			$uuid=\uniqid("grp");
259
+			$uuids[$gbField]=$uuid;
260
+			$id=$this->_instanceViewer->getIdentifier();
261
+			$result=$table->addMergeRow(\count($fields)+1, $newValue);
262
+			$result->setIdentifier($this->identifier."-tr-gb-".$id);
263 263
 			$result->setProperty("data-ajax", $id);
264 264
 			$result->setProperty("data-group", $uuid);
265 265
 			$result->addToProperty("class", $this->_rowClass);
266
-			$activeValues[$gbField] = $newValue;
266
+			$activeValues[$gbField]=$newValue;
267 267
 		}
268 268
 	}
269 269
 
@@ -275,9 +275,9 @@  discard block
 block discarded – undo
275 275
 	}
276 276
 
277 277
 	public function getFieldValue($index) {
278
-		$index = $this->_getIndex($index);
278
+		$index=$this->_getIndex($index);
279 279
 		if (\is_numeric($index)) {
280
-			$values = $this->_instanceViewer->getValues();
280
+			$values=$this->_instanceViewer->getValues();
281 281
 			if (isset($values[$index])) {
282 282
 				return $values[$index];
283 283
 			}
@@ -285,30 +285,30 @@  discard block
 block discarded – undo
285 285
 		return null;
286 286
 	}
287 287
 
288
-	protected function _generateRow($instance, $fields, &$table, $checkedClass = null, $uuids = null) {
288
+	protected function _generateRow($instance, $fields, &$table, $checkedClass=null, $uuids=null) {
289 289
 		$this->_instanceViewer->setInstance($instance);
290
-		InstanceViewer::$index ++;
291
-		$values = $this->_instanceViewer->getValues();
292
-		$id = $this->_instanceViewer->getIdentifier();
293
-		$dataAjax = $id;
294
-		$id = $this->cleanIdentifier($id);
290
+		InstanceViewer::$index++;
291
+		$values=$this->_instanceViewer->getValues();
292
+		$id=$this->_instanceViewer->getIdentifier();
293
+		$dataAjax=$id;
294
+		$id=$this->cleanIdentifier($id);
295 295
 		if ($this->_hasCheckboxes) {
296
-			$ck = new HtmlCheckbox("ck-" . $this->identifier . "-" . $id, "");
297
-			$checked = false;
296
+			$ck=new HtmlCheckbox("ck-".$this->identifier."-".$id, "");
297
+			$checked=false;
298 298
 			if (isset($this->_checkedCallback)) {
299
-				$func = $this->_checkedCallback;
300
-				$checked = $func($instance);
299
+				$func=$this->_checkedCallback;
300
+				$checked=$func($instance);
301 301
 			}
302 302
 			$ck->setChecked($checked);
303
-			$field = $ck->getField();
303
+			$field=$ck->getField();
304 304
 			$field->setProperty("value", $dataAjax);
305 305
 			$field->setProperty("name", "selection[]");
306 306
 			if (isset($checkedClass))
307 307
 				$field->setClass($checkedClass);
308 308
 			\array_unshift($values, $ck);
309 309
 		}
310
-		$result = $table->newRow();
311
-		$result->setIdentifier($this->identifier . "-tr-" . $id);
310
+		$result=$table->newRow();
311
+		$result->setIdentifier($this->identifier."-tr-".$id);
312 312
 		$result->setProperty("data-ajax", $dataAjax);
313 313
 		$result->setValues($values);
314 314
 		$result->addToProperty("class", $this->_rowClass);
@@ -321,67 +321,67 @@  discard block
 block discarded – undo
321 321
 
322 322
 	protected function _generatePagination($table) {
323 323
 		if (isset($this->_toolbar)) {
324
-			if ($this->_toolbarPosition == PositionInTable::FOOTER)
324
+			if ($this->_toolbarPosition==PositionInTable::FOOTER)
325 325
 				$this->_toolbar->setFloated("left");
326 326
 		}
327
-		$footer = $table->getFooter();
327
+		$footer=$table->getFooter();
328 328
 		$footer->mergeCol();
329
-		$this->_paginationToolbar = $this->_pagination->generateMenu($this->identifier);
329
+		$this->_paginationToolbar=$this->_pagination->generateMenu($this->identifier);
330 330
 		$footer->addValues($this->_paginationToolbar);
331 331
 	}
332 332
 
333
-	protected function _associatePaginationBehavior(JsUtils $js = NULL, $offset = null) {
333
+	protected function _associatePaginationBehavior(JsUtils $js=NULL, $offset=null) {
334 334
 		if (isset($this->_urls["refresh"])) {
335
-			$menu = $this->_pagination->getMenu();
335
+			$menu=$this->_pagination->getMenu();
336 336
 			if (isset($menu) && isset($js)) {
337
-				$js->postOnClick("#" . $menu->getIdentifier() . " .item", $this->_urls["refresh"], "{'p':$(this).attr('data-page'),'_model':'" . JString::doubleBackSlashes($this->_model) . "'}", $this->getRefreshSelector(), [
337
+				$js->postOnClick("#".$menu->getIdentifier()." .item", $this->_urls["refresh"], "{'p':$(this).attr('data-page'),'_model':'".JString::doubleBackSlashes($this->_model)."'}", $this->getRefreshSelector(), [
338 338
 					"preventDefault" => false,
339 339
 					"jqueryDone" => "replaceWith",
340 340
 					"hasLoader" => false,
341
-					"jsCallback" => '$("#' . $this->identifier . '").trigger("pageChange");$("#' . $this->identifier . '").trigger("activeRowChange");'
341
+					"jsCallback" => '$("#'.$this->identifier.'").trigger("pageChange");$("#'.$this->identifier.'").trigger("activeRowChange");'
342 342
 				]);
343
-				$page = $_POST["p"] ?? null;
343
+				$page=$_POST["p"] ?? null;
344 344
 				if (isset($page)) {
345
-					$activeClass = $this->getActiveRowClass();
346
-					$js->execAtLast('$("#' . $this->getIdentifier() . ' .pagination").children("a.item").removeClass("' . $activeClass . '");$("#' . $this->getIdentifier() . ' .pagination").children("a.item[data-page=' . $page . ']:not(.no-active)").addClass("' . $activeClass . '");');
345
+					$activeClass=$this->getActiveRowClass();
346
+					$js->execAtLast('$("#'.$this->getIdentifier().' .pagination").children("a.item").removeClass("'.$activeClass.'");$("#'.$this->getIdentifier().' .pagination").children("a.item[data-page='.$page.']:not(.no-active)").addClass("'.$activeClass.'");');
347 347
 				}
348 348
 			}
349 349
 		}
350 350
 	}
351 351
 
352
-	protected function _compileSearchFieldBehavior(JsUtils $js = NULL) {
352
+	protected function _compileSearchFieldBehavior(JsUtils $js=NULL) {
353 353
 		if (isset($this->_searchField) && isset($js) && isset($this->_urls["refresh"])) {
354
-			$this->_searchField->postOn("change", $this->_urls["refresh"], "{'s':$(self).val(),'_model':'" . JString::doubleBackSlashes($this->_model) . "'}", "#" . $this->identifier . " tbody", [
354
+			$this->_searchField->postOn("change", $this->_urls["refresh"], "{'s':$(self).val(),'_model':'".JString::doubleBackSlashes($this->_model)."'}", "#".$this->identifier." tbody", [
355 355
 				"preventDefault" => false,
356 356
 				"jqueryDone" => "replaceWith",
357 357
 				"hasLoader" => "internal",
358
-				"jsCallback" => '$("#' . $this->identifier . '").trigger("searchTerminate",[$(self).val()]);'
358
+				"jsCallback" => '$("#'.$this->identifier.'").trigger("searchTerminate",[$(self).val()]);'
359 359
 			]);
360 360
 		}
361 361
 	}
362 362
 
363
-	protected function _associateSearchFieldBehavior(JsUtils $js = NULL, $offset = null) {}
363
+	protected function _associateSearchFieldBehavior(JsUtils $js=NULL, $offset=null) {}
364 364
 
365 365
 	protected function _getFieldName($index) {
366
-		$fieldName = parent::_getFieldName($index);
366
+		$fieldName=parent::_getFieldName($index);
367 367
 		if (\is_object($fieldName))
368
-			$fieldName = "field-" . $index;
369
-		if ($this->_namePrefix != null) {
370
-			$fieldName = $this->_namePrefix . '.' . $fieldName;
368
+			$fieldName="field-".$index;
369
+		if ($this->_namePrefix!=null) {
370
+			$fieldName=$this->_namePrefix.'.'.$fieldName;
371 371
 		}
372
-		return $fieldName . "[]";
372
+		return $fieldName."[]";
373 373
 	}
374 374
 
375 375
 	protected function _getFieldCaption($index) {
376 376
 		return null;
377 377
 	}
378 378
 
379
-	protected function applyToolbarPosition(string $position, $table, $captions = NULL) {
379
+	protected function applyToolbarPosition(string $position, $table, $captions=NULL) {
380 380
 		switch ($position) {
381 381
 			case PositionInTable::BEFORETABLE:
382 382
 			case PositionInTable::AFTERTABLE:
383
-				if (isset($this->_compileParts) === false) {
384
-					$this->content[$position] = $this->_toolbar;
383
+				if (isset($this->_compileParts)===false) {
384
+					$this->content[$position]=$this->_toolbar;
385 385
 				}
386 386
 				break;
387 387
 			case PositionInTable::HEADER:
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 		}
393 393
 	}
394 394
 
395
-	protected function _setToolbarPosition($table, $captions = NULL) {
395
+	protected function _setToolbarPosition($table, $captions=NULL) {
396 396
 		if (\is_array($this->_toolbarPosition)) {
397 397
 			foreach ($this->_toolbarPosition as $tbp) {
398 398
 				$this->applyToolbarPosition($tbp, $table, $captions);
@@ -418,11 +418,11 @@  discard block
 block discarded – undo
418 418
 	}
419 419
 
420 420
 	private function addToolbarRow($part, $table, $captions) {
421
-		$hasPart = $table->hasPart($part);
421
+		$hasPart=$table->hasPart($part);
422 422
 		if ($hasPart) {
423
-			$row = $table->getPart($part)->addRow(\count($captions));
423
+			$row=$table->getPart($part)->addRow(\count($captions));
424 424
 		} else {
425
-			$row = $table->getPart($part)->getRow(0);
425
+			$row=$table->getPart($part)->getRow(0);
426 426
 		}
427 427
 		$row->mergeCol();
428 428
 		$row->setValues([
@@ -454,12 +454,12 @@  discard block
 block discarded – undo
454 454
 	 */
455 455
 	public function setUrls($urls) {
456 456
 		if (\is_array($urls)) {
457
-			$this->_urls["refresh"] = JArray::getValue($urls, "refresh", 0);
458
-			$this->_urls["edit"] = JArray::getValue($urls, "edit", 1);
459
-			$this->_urls["delete"] = JArray::getValue($urls, "delete", 2);
460
-			$this->_urls["display"] = JArray::getValue($urls, "display", 3);
457
+			$this->_urls["refresh"]=JArray::getValue($urls, "refresh", 0);
458
+			$this->_urls["edit"]=JArray::getValue($urls, "edit", 1);
459
+			$this->_urls["delete"]=JArray::getValue($urls, "delete", 2);
460
+			$this->_urls["display"]=JArray::getValue($urls, "display", 3);
461 461
 		} else {
462
-			$this->_urls = [
462
+			$this->_urls=[
463 463
 				"refresh" => $urls,
464 464
 				"edit" => $urls,
465 465
 				"delete" => $urls,
@@ -482,8 +482,8 @@  discard block
 block discarded – undo
482 482
 	 *        	The number of visible pages in the Pagination component
483 483
 	 * @return DataTable
484 484
 	 */
485
-	public function paginate($page, $total_rowcount, $items_per_page = 10, $pages_visibles = null) {
486
-		$this->_pagination = new Pagination($items_per_page, $pages_visibles, $page, $total_rowcount);
485
+	public function paginate($page, $total_rowcount, $items_per_page=10, $pages_visibles=null) {
486
+		$this->_pagination=new Pagination($items_per_page, $pages_visibles, $page, $total_rowcount);
487 487
 		return $this;
488 488
 	}
489 489
 
@@ -498,8 +498,8 @@  discard block
 block discarded – undo
498 498
 	 *        	The number of visible pages in the Pagination component
499 499
 	 * @return DataTable
500 500
 	 */
501
-	public function autoPaginate($page = 1, $items_per_page = 10, $pages_visibles = 4) {
502
-		$this->_pagination = new Pagination($items_per_page, $pages_visibles, $page);
501
+	public function autoPaginate($page=1, $items_per_page=10, $pages_visibles=4) {
502
+		$this->_pagination=new Pagination($items_per_page, $pages_visibles, $page);
503 503
 		return $this;
504 504
 	}
505 505
 
@@ -508,10 +508,10 @@  discard block
 block discarded – undo
508 508
 	 * @param array $compileParts
509 509
 	 * @return DataTable
510 510
 	 */
511
-	public function refresh($compileParts = [
511
+	public function refresh($compileParts=[
512 512
 		'tbody'
513 513
 	]) {
514
-		$this->_compileParts = $compileParts;
514
+		$this->_compileParts=$compileParts;
515 515
 		return $this;
516 516
 	}
517 517
 
@@ -521,14 +521,14 @@  discard block
 block discarded – undo
521 521
 	 * @param string $position
522 522
 	 * @return \Ajax\common\html\HtmlDoubleElement
523 523
 	 */
524
-	public function addSearchInToolbar($position = Direction::RIGHT) {
524
+	public function addSearchInToolbar($position=Direction::RIGHT) {
525 525
 		return $this->addInToolbar($this->getSearchField())
526 526
 			->setPosition($position);
527 527
 	}
528 528
 
529 529
 	public function getSearchField() {
530
-		if (isset($this->_searchField) === false) {
531
-			$this->_searchField = new HtmlInput("search-" . $this->identifier, "search", "", "Search...");
530
+		if (isset($this->_searchField)===false) {
531
+			$this->_searchField=new HtmlInput("search-".$this->identifier, "search", "", "Search...");
532 532
 			$this->_searchField->addIcon("search", Direction::RIGHT);
533 533
 		}
534 534
 		return $this->_searchField;
@@ -556,9 +556,9 @@  discard block
 block discarded – undo
556 556
 	}
557 557
 
558 558
 	protected function getTargetSelector($op) {
559
-		$result = $this->_targetSelector;
560
-		if (! isset($result[$op]))
561
-			$result = "#" . $this->identifier;
559
+		$result=$this->_targetSelector;
560
+		if (!isset($result[$op]))
561
+			$result="#".$this->identifier;
562 562
 		return $result[$op];
563 563
 	}
564 564
 
@@ -570,20 +570,20 @@  discard block
 block discarded – undo
570 570
 	 * @return DataTable
571 571
 	 */
572 572
 	public function setTargetSelector($_targetSelector) {
573
-		if (! \is_array($_targetSelector)) {
574
-			$_targetSelector = [
573
+		if (!\is_array($_targetSelector)) {
574
+			$_targetSelector=[
575 575
 				"edit" => $_targetSelector,
576 576
 				"delete" => $_targetSelector
577 577
 			];
578 578
 		}
579
-		$this->_targetSelector = $_targetSelector;
579
+		$this->_targetSelector=$_targetSelector;
580 580
 		return $this;
581 581
 	}
582 582
 
583 583
 	public function getRefreshSelector() {
584 584
 		if (isset($this->_refreshSelector))
585 585
 			return $this->_refreshSelector;
586
-		return "#" . $this->identifier . " tbody";
586
+		return "#".$this->identifier." tbody";
587 587
 	}
588 588
 
589 589
 	/**
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 	 * @return DataTable
593 593
 	 */
594 594
 	public function setRefreshSelector($_refreshSelector) {
595
-		$this->_refreshSelector = $_refreshSelector;
595
+		$this->_refreshSelector=$_refreshSelector;
596 596
 		return $this;
597 597
 	}
598 598
 
@@ -604,9 +604,9 @@  discard block
 block discarded – undo
604 604
 	public function show($modelInstance) {
605 605
 		if (\is_array($modelInstance)) {
606 606
 			if (isset($modelInstance[0]) && \is_array(array_values($modelInstance)[0]))
607
-				$modelInstance = \json_decode(\json_encode($modelInstance), FALSE);
607
+				$modelInstance=\json_decode(\json_encode($modelInstance), FALSE);
608 608
 		}
609
-		$this->_modelInstance = $modelInstance;
609
+		$this->_modelInstance=$modelInstance;
610 610
 	}
611 611
 
612 612
 	public function getRowClass() {
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 	 * @return DataTable
621 621
 	 */
622 622
 	public function setRowClass($_rowClass) {
623
-		$this->_rowClass = $_rowClass;
623
+		$this->_rowClass=$_rowClass;
624 624
 		return $this;
625 625
 	}
626 626
 
@@ -631,16 +631,16 @@  discard block
 block discarded – undo
631 631
 	 * @return DataTable
632 632
 	 */
633 633
 	public function setEmptyMessage($_emptyMessage) {
634
-		$this->_emptyMessage = $_emptyMessage;
634
+		$this->_emptyMessage=$_emptyMessage;
635 635
 		return $this;
636 636
 	}
637 637
 
638
-	public function setSortable($colIndex = NULL) {
639
-		$this->_sortable = $colIndex;
638
+	public function setSortable($colIndex=NULL) {
639
+		$this->_sortable=$colIndex;
640 640
 		return $this;
641 641
 	}
642 642
 
643
-	public function setActiveRowSelector($class = "active", $event = "click", $multiple = false) {
643
+	public function setActiveRowSelector($class="active", $event="click", $multiple=false) {
644 644
 		$this->_self->setActiveRowSelector($class, $event, $multiple);
645 645
 		return $this;
646 646
 	}
@@ -654,19 +654,19 @@  discard block
 block discarded – undo
654 654
 	}
655 655
 
656 656
 	public function hideColumn($colIndex) {
657
-		if (! \is_array($this->_hiddenColumns))
658
-			$this->_hiddenColumns = [];
659
-		$this->_hiddenColumns[] = $colIndex;
657
+		if (!\is_array($this->_hiddenColumns))
658
+			$this->_hiddenColumns=[];
659
+		$this->_hiddenColumns[]=$colIndex;
660 660
 		return $this;
661 661
 	}
662 662
 
663 663
 	public function setColWidth($colIndex, $width) {
664
-		$this->_colWidths[$colIndex] = $width;
664
+		$this->_colWidths[$colIndex]=$width;
665 665
 		return $this;
666 666
 	}
667 667
 
668 668
 	public function setColWidths($_colWidths) {
669
-		$this->_colWidths = $_colWidths;
669
+		$this->_colWidths=$_colWidths;
670 670
 		return $this;
671 671
 	}
672 672
 
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 		return $this;
676 676
 	}
677 677
 
678
-	public function trigger($event, $params = "[]") {
678
+	public function trigger($event, $params="[]") {
679 679
 		return $this->getHtmlComponent()->trigger($event, $params);
680 680
 	}
681 681
 
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 	 * @param mixed $_displayBehavior
714 714
 	 */
715 715
 	public function setDisplayBehavior($_displayBehavior) {
716
-		$this->_displayBehavior = $_displayBehavior;
716
+		$this->_displayBehavior=$_displayBehavior;
717 717
 	}
718 718
 
719 719
 	/**
@@ -733,8 +733,8 @@  discard block
 block discarded – undo
733 733
 	}
734 734
 
735 735
 	public function addGroupBy($index) {
736
-		$index = $this->_getIndex($index);
737
-		if ($index !== false) {
736
+		$index=$this->_getIndex($index);
737
+		if ($index!==false) {
738 738
 			$this->_instanceViewer->addGroupBy($index);
739 739
 		}
740 740
 	}
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 	 * @param boolean $_visibleHover
745 745
 	 */
746 746
 	public function setVisibleHover($_visibleHover) {
747
-		$this->_visibleHover = $_visibleHover;
747
+		$this->_visibleHover=$_visibleHover;
748 748
 	}
749 749
 
750 750
 	/**
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
 		return $this->_paginationToolbar;
756 756
 	}
757 757
 
758
-	public function setInverted($recursive = true) {
758
+	public function setInverted($recursive=true) {
759 759
 		$this->getHtmlComponent()->setInverted($recursive);
760 760
 		if ($this->_emptyMessage instanceof HtmlSemDoubleElement) {
761 761
 			$this->_emptyMessage->setInverted($recursive);
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 	}
768 768
 
769 769
 	public function setFormCaption($caption) {
770
-		$this->_caption = $caption;
770
+		$this->_caption=$caption;
771 771
 	}
772 772
 
773 773
 	/**
@@ -783,6 +783,6 @@  discard block
 block discarded – undo
783 783
 	 * @param mixed $namePrefix
784 784
 	 */
785 785
 	public function setNamePrefix($namePrefix): void {
786
-		$this->_namePrefix = $namePrefix;
786
+		$this->_namePrefix=$namePrefix;
787 787
 	}
788 788
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/table/HtmlTable.php 2 patches
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 	private $_activeRowSelector;
33 33
 
34
-	private $_focusable = false;
34
+	private $_focusable=false;
35 35
 
36 36
 	/**
37 37
 	 *
@@ -45,19 +45,19 @@  discard block
 block discarded – undo
45 45
 
46 46
 	public function __construct($identifier, $rowCount, $colCount) {
47 47
 		parent::__construct($identifier, "table", "ui table");
48
-		$this->content = array();
48
+		$this->content=array();
49 49
 		$this->setRowCount($rowCount, $colCount);
50
-		$this->_variations = [
50
+		$this->_variations=[
51 51
 			Variation::CELLED,
52 52
 			Variation::PADDED,
53 53
 			Variation::COMPACT
54 54
 		];
55
-		$this->_compileParts = [
55
+		$this->_compileParts=[
56 56
 			"thead",
57 57
 			"tbody",
58 58
 			"tfoot"
59 59
 		];
60
-		$this->_afterCompileEvents = [];
60
+		$this->_afterCompileEvents=[];
61 61
 	}
62 62
 
63 63
 	/**
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
 	 * @return HtmlTableContent
68 68
 	 */
69 69
 	public function getPart($key) {
70
-		if (\array_key_exists($key, $this->content) === false) {
71
-			$this->content[$key] = new HtmlTableContent("", $key);
72
-			if ($key !== "tbody") {
70
+		if (\array_key_exists($key, $this->content)===false) {
71
+			$this->content[$key]=new HtmlTableContent("", $key);
72
+			if ($key!=="tbody") {
73 73
 				$this->content[$key]->setRowCount(1, $this->_colCount);
74 74
 			}
75 75
 		}
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 * @return boolean
127 127
 	 */
128 128
 	public function hasPart($key) {
129
-		return \array_key_exists($key, $this->content) === true;
129
+		return \array_key_exists($key, $this->content)===true;
130 130
 	}
131 131
 
132 132
 	/**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 * @return HtmlTableContent
137 137
 	 */
138 138
 	public function setRowCount($rowCount, $colCount) {
139
-		$this->_colCount = $colCount;
139
+		$this->_colCount=$colCount;
140 140
 		return $this->getBody()->setRowCount($rowCount, $colCount);
141 141
 	}
142 142
 
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 	 * @param array $values
168 168
 	 * @return HtmlTR
169 169
 	 */
170
-	public function addRow($values = array()) {
171
-		$row = $this->getBody()->addRow($this->_colCount);
170
+	public function addRow($values=array()) {
171
+		$row=$this->getBody()->addRow($this->_colCount);
172 172
 		$row->setValues(\array_values($values));
173 173
 		return $row;
174 174
 	}
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	 *        	values in an array of array
190 190
 	 * @return HtmlTable
191 191
 	 */
192
-	public function setValues($values = array()) {
192
+	public function setValues($values=array()) {
193 193
 		$this->getBody()->setValues($values);
194 194
 		return $this;
195 195
 	}
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	 * @param array $values
201 201
 	 * @return HtmlTableContent
202 202
 	 */
203
-	public function setHeaderValues($values = array()) {
203
+	public function setHeaderValues($values=array()) {
204 204
 		return $this->getHeader()->setValues($values);
205 205
 	}
206 206
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	 * @param array $values
211 211
 	 * @return HtmlTableContent
212 212
 	 */
213
-	public function setFooterValues($values = array()) {
213
+	public function setFooterValues($values=array()) {
214 214
 		return $this->getFooter()->setValues($values);
215 215
 	}
216 216
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	 * @param array $values
222 222
 	 * @return HtmlTable
223 223
 	 */
224
-	public function setColValues($colIndex, $values = array()) {
224
+	public function setColValues($colIndex, $values=array()) {
225 225
 		$this->getBody()->setColValues($colIndex, $values);
226 226
 		return $this;
227 227
 	}
@@ -233,12 +233,12 @@  discard block
 block discarded – undo
233 233
 	 * @param array $values
234 234
 	 * @return HtmlTable
235 235
 	 */
236
-	public function setRowValues($rowIndex, $values = array()) {
236
+	public function setRowValues($rowIndex, $values=array()) {
237 237
 		$this->getBody()->setRowValues($rowIndex, $values);
238 238
 		return $this;
239 239
 	}
240 240
 
241
-	public function addColVariations($colIndex, $variations = array()) {
241
+	public function addColVariations($colIndex, $variations=array()) {
242 242
 		return $this->getBody()->addColVariations($colIndex, $variations);
243 243
 	}
244 244
 
@@ -305,19 +305,19 @@  discard block
 block discarded – undo
305 305
 	public function setColAlignment($colIndex, $alignment) {
306 306
 		switch ($alignment) {
307 307
 			case TextAlignment::LEFT:
308
-				$function = "colLeft";
308
+				$function="colLeft";
309 309
 				break;
310 310
 
311 311
 			case TextAlignment::RIGHT:
312
-				$function = "colRight";
312
+				$function="colRight";
313 313
 				break;
314 314
 
315 315
 			case TextAlignment::CENTER:
316
-				$function = "colCenter";
316
+				$function="colCenter";
317 317
 				break;
318 318
 
319 319
 			default:
320
-				$function = "colLeft";
320
+				$function="colLeft";
321 321
 		}
322 322
 		$this->colAlign($colIndex, $function);
323 323
 		return $this;
@@ -326,19 +326,19 @@  discard block
 block discarded – undo
326 326
 	public function setColAlignmentFromRight($colIndex, $alignment) {
327 327
 		switch ($alignment) {
328 328
 			case TextAlignment::LEFT:
329
-				$function = "colLeftFromRight";
329
+				$function="colLeftFromRight";
330 330
 				break;
331 331
 
332 332
 			case TextAlignment::RIGHT:
333
-				$function = "colRightFromRight";
333
+				$function="colRightFromRight";
334 334
 				break;
335 335
 
336 336
 			case TextAlignment::CENTER:
337
-				$function = "colCenterFromRight";
337
+				$function="colCenterFromRight";
338 338
 				break;
339 339
 
340 340
 			default:
341
-				$function = "colLeftFromRight";
341
+				$function="colLeftFromRight";
342 342
 		}
343 343
 		$this->colAlign($colIndex, $function);
344 344
 		return $this;
@@ -414,19 +414,19 @@  discard block
 block discarded – undo
414 414
 	 *
415 415
 	 * @see HtmlSemDoubleElement::compile()
416 416
 	 */
417
-	public function compile(JsUtils $js = NULL, &$view = NULL) {
418
-		if (\sizeof($this->_compileParts) < 3) {
419
-			$this->_template = "%content%";
417
+	public function compile(JsUtils $js=NULL, &$view=NULL) {
418
+		if (\sizeof($this->_compileParts)<3) {
419
+			$this->_template="%content%";
420 420
 			$this->refresh($js);
421 421
 		}
422
-		$this->content = JArray::sortAssociative($this->content, $this->_compileParts);
422
+		$this->content=JArray::sortAssociative($this->content, $this->_compileParts);
423 423
 		return parent::compile($js, $view);
424 424
 	}
425 425
 
426
-	protected function compile_once(JsUtils $js = NULL, &$view = NULL) {
426
+	protected function compile_once(JsUtils $js=NULL, &$view=NULL) {
427 427
 		parent::compile_once($js, $view);
428 428
 		if ($this->propertyContains("class", "sortable")) {
429
-			$this->addEvent("execute", "$('#" . $this->identifier . "').tablesort().data('tablesort').sort($('th.default-sort'));");
429
+			$this->addEvent("execute", "$('#".$this->identifier."').tablesort().data('tablesort').sort($('th.default-sort'));");
430 430
 		}
431 431
 	}
432 432
 
@@ -437,11 +437,11 @@  discard block
 block discarded – undo
437 437
 	 * @see BaseHtml::fromDatabaseObject()
438 438
 	 */
439 439
 	public function fromDatabaseObject($object, $function) {
440
-		$result = $function($object);
440
+		$result=$function($object);
441 441
 		if (\is_array($result)) {
442
-			$result = $this->addRow($function($object));
442
+			$result=$this->addRow($function($object));
443 443
 		} else {
444
-			$result = $this->getBody()->_addRow($result);
444
+			$result=$this->getBody()->_addRow($result);
445 445
 		}
446 446
 		if (isset($this->_afterCompileEvents["onNewRow"])) {
447 447
 			if (\is_callable($this->_afterCompileEvents["onNewRow"]))
@@ -457,10 +457,10 @@  discard block
 block discarded – undo
457 457
 	 *        	array of thead,tbody,tfoot
458 458
 	 * @return HtmlTable
459 459
 	 */
460
-	public function setCompileParts($parts = [
460
+	public function setCompileParts($parts=[
461 461
 		"tbody"
462 462
 	]) {
463
-		$this->_compileParts = $parts;
463
+		$this->_compileParts=$parts;
464 464
 		return $this;
465 465
 	}
466 466
 
@@ -470,22 +470,22 @@  discard block
 block discarded – undo
470 470
 	}
471 471
 
472 472
 	public function refresh($js) {
473
-		$this->_footer = $this->getFooter();
473
+		$this->_footer=$this->getFooter();
474 474
 		if (isset($js)) {
475
-			$js->exec('$("#' . $this->identifier . ' tfoot").replaceWith("' . \addslashes($this->_footer) . '");', true);
475
+			$js->exec('$("#'.$this->identifier.' tfoot").replaceWith("'.\addslashes($this->_footer).'");', true);
476 476
 		}
477 477
 	}
478 478
 
479 479
 	public function run(JsUtils $js) {
480
-		if (! $this->_runned) {
480
+		if (!$this->_runned) {
481 481
 			if (isset($this->_activeRowSelector)) {
482 482
 				$this->_activeRowSelector->run();
483 483
 			}
484 484
 		}
485
-		$result = parent::run($js);
485
+		$result=parent::run($js);
486 486
 		if (isset($this->_footer))
487 487
 			$this->_footer->run($js);
488
-		$this->_runned = true;
488
+		$this->_runned=true;
489 489
 		return $result;
490 490
 	}
491 491
 
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 	 * @return HtmlTable
498 498
 	 */
499 499
 	public function onNewRow($callback) {
500
-		$this->_afterCompileEvents["onNewRow"] = $callback;
500
+		$this->_afterCompileEvents["onNewRow"]=$callback;
501 501
 		return $this;
502 502
 	}
503 503
 
@@ -509,8 +509,8 @@  discard block
 block discarded – undo
509 509
 	 * @param boolean $multiple
510 510
 	 * @return HtmlTable
511 511
 	 */
512
-	public function setActiveRowSelector($class = "active", $event = "click", $multiple = false) {
513
-		$this->_activeRowSelector = new ActiveRow($this, $class, $event, $multiple);
512
+	public function setActiveRowSelector($class="active", $event="click", $multiple=false) {
513
+		$this->_activeRowSelector=new ActiveRow($this, $class, $event, $multiple);
514 514
 		return $this;
515 515
 	}
516 516
 
@@ -537,29 +537,29 @@  discard block
 block discarded – undo
537 537
 	}
538 538
 
539 539
 	public function setColWidth($colIndex, $width) {
540
-		$part = $this->_getFirstPart();
541
-		if ($part !== null && $part->count() > 0)
540
+		$part=$this->_getFirstPart();
541
+		if ($part!==null && $part->count()>0)
542 542
 			$part->getCell(0, $colIndex)->setWidth($width);
543 543
 		return $this;
544 544
 	}
545 545
 
546 546
 	public function setColWidths($widths) {
547
-		$part = $this->_getFirstPart();
548
-		if ($part !== null && $part->count() > 0) {
549
-			$count = $part->getColCount();
550
-			if (! \is_array($widths)) {
551
-				$widths = \array_fill(0, $count, $widths);
547
+		$part=$this->_getFirstPart();
548
+		if ($part!==null && $part->count()>0) {
549
+			$count=$part->getColCount();
550
+			if (!\is_array($widths)) {
551
+				$widths=\array_fill(0, $count, $widths);
552 552
 			}
553
-			$max = \min(\sizeof($widths), $count);
554
-			for ($i = 0; $i < $max; $i ++) {
553
+			$max=\min(\sizeof($widths), $count);
554
+			for ($i=0; $i<$max; $i++) {
555 555
 				$part->getCell(0, $i)->setWidth($widths[$i]);
556 556
 			}
557 557
 		}
558 558
 		return $this;
559 559
 	}
560 560
 
561
-	public function mergeIdentiqualValues($colIndex, $function = "strip_tags") {
562
-		$body = $this->getBody();
561
+	public function mergeIdentiqualValues($colIndex, $function="strip_tags") {
562
+		$body=$this->getBody();
563 563
 		$body->mergeIdentiqualValues($colIndex, $function);
564 564
 		return $this;
565 565
 	}
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 	 * @param mixed $_innerScript
578 578
 	 */
579 579
 	public function setInnerScript($_innerScript) {
580
-		$this->_innerScript = $_innerScript;
580
+		$this->_innerScript=$_innerScript;
581 581
 	}
582 582
 
583 583
 	public function onActiveRowChange($jsCode) {
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 		return $this;
586 586
 	}
587 587
 
588
-	public function addMergeRow($colCount, $value = null) {
588
+	public function addMergeRow($colCount, $value=null) {
589 589
 		return $this->getBody()->addMergeRow($colCount, $value);
590 590
 	}
591 591
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -444,8 +444,9 @@  discard block
 block discarded – undo
444 444
 			$result = $this->getBody()->_addRow($result);
445 445
 		}
446 446
 		if (isset($this->_afterCompileEvents["onNewRow"])) {
447
-			if (\is_callable($this->_afterCompileEvents["onNewRow"]))
448
-				$this->_afterCompileEvents["onNewRow"]($result, $object);
447
+			if (\is_callable($this->_afterCompileEvents["onNewRow"])) {
448
+							$this->_afterCompileEvents["onNewRow"]($result, $object);
449
+			}
449 450
 		}
450 451
 		return $result;
451 452
 	}
@@ -483,8 +484,9 @@  discard block
 block discarded – undo
483 484
 			}
484 485
 		}
485 486
 		$result = parent::run($js);
486
-		if (isset($this->_footer))
487
-			$this->_footer->run($js);
487
+		if (isset($this->_footer)) {
488
+					$this->_footer->run($js);
489
+		}
488 490
 		$this->_runned = true;
489 491
 		return $result;
490 492
 	}
@@ -538,8 +540,9 @@  discard block
 block discarded – undo
538 540
 
539 541
 	public function setColWidth($colIndex, $width) {
540 542
 		$part = $this->_getFirstPart();
541
-		if ($part !== null && $part->count() > 0)
542
-			$part->getCell(0, $colIndex)->setWidth($width);
543
+		if ($part !== null && $part->count() > 0) {
544
+					$part->getCell(0, $colIndex)->setWidth($width);
545
+		}
543 546
 		return $this;
544 547
 	}
545 548
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTableContent.php 2 patches
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -15,15 +15,15 @@  discard block
 block discarded – undo
15 15
  */
16 16
 class HtmlTableContent extends HtmlSemCollection {
17 17
 
18
-	protected $_focusable = false;
18
+	protected $_focusable=false;
19 19
 
20
-	protected $_tdTagNames = [
20
+	protected $_tdTagNames=[
21 21
 		"thead" => "th",
22 22
 		"tbody" => "td",
23 23
 		"tfoot" => "th"
24 24
 	];
25 25
 
26
-	protected $_merged = false;
26
+	protected $_merged=false;
27 27
 
28 28
 	/**
29 29
 	 *
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @param int $rowCount
33 33
 	 * @param int $colCount
34 34
 	 */
35
-	public function __construct($identifier, $tagName = "tbody", $rowCount = NULL, $colCount = NULL) {
35
+	public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) {
36 36
 		parent::__construct($identifier, $tagName, "");
37 37
 		if (isset($rowCount) && isset($colCount))
38 38
 			$this->setRowCount($rowCount, $colCount);
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 	 * @return HtmlTableContent
46 46
 	 */
47 47
 	public function setRowCount($rowCount, $colCount) {
48
-		$count = $this->count();
49
-		for ($i = $count; $i < $rowCount; $i ++) {
48
+		$count=$this->count();
49
+		for ($i=$count; $i<$rowCount; $i++) {
50 50
 			$this->addItem($colCount);
51 51
 		}
52 52
 		return $this;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	}
58 58
 
59 59
 	public function refreshTR() {
60
-		$this->_template = "%wrapContentBefore%%content%%wrapContentAfter%";
60
+		$this->_template="%wrapContentBefore%%content%%wrapContentAfter%";
61 61
 	}
62 62
 
63 63
 	/**
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
 	 * @return HtmlTR
69 69
 	 */
70 70
 	protected function createItem($value) {
71
-		$count = $this->count();
72
-		$tr = new HtmlTR("");
71
+		$count=$this->count();
72
+		$tr=new HtmlTR("");
73 73
 		$tr->setContainer($this, $count);
74 74
 		if ($this->_focusable) {
75 75
 			$tr->setProperty('tabindex', $count);
76 76
 		}
77 77
 		$tr->setTdTagName($this->_tdTagNames[$this->tagName]);
78
-		if (isset($value) === true) {
78
+		if (isset($value)===true) {
79 79
 			$tr->setColCount($value);
80 80
 		}
81 81
 		return $tr;
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 		return $this->addItem($row);
104 104
 	}
105 105
 
106
-	public function addMergeRow($colCount, $value = null) {
107
-		$row = $this->addRow($colCount);
106
+	public function addMergeRow($colCount, $value=null) {
107
+		$row=$this->addRow($colCount);
108 108
 		$row->mergeCol();
109 109
 		if (isset($value)) {
110 110
 			$row->setValues([
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
 	 * @return HtmlTD|HtmlDoubleElement
131 131
 	 */
132 132
 	public function getCell($row, $col) {
133
-		$row = $this->getItem($row);
133
+		$row=$this->getItem($row);
134 134
 		if (isset($row) && $row instanceof HtmlCollection) {
135
-			$col = $row->getItem($col);
135
+			$col=$row->getItem($col);
136 136
 		} else {
137
-			$col = $row;
137
+			$col=$row;
138 138
 		}
139 139
 		return $col;
140 140
 	}
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
 	 * @param mixed $value
156 156
 	 * @return HtmlTableContent
157 157
 	 */
158
-	public function setCellValue($row, $col, $value = "") {
159
-		$cell = $this->getCell($row, $col);
160
-		if (isset($cell) === true) {
158
+	public function setCellValue($row, $col, $value="") {
159
+		$cell=$this->getCell($row, $col);
160
+		if (isset($cell)===true) {
161 161
 			$cell->setValue($value);
162 162
 		}
163 163
 		return $this;
@@ -168,8 +168,8 @@  discard block
 block discarded – undo
168 168
 	 *
169 169
 	 * @param mixed $values
170 170
 	 */
171
-	public function setValues($values = array()) {
172
-		return $this->_addOrSetValues($values, function (HtmlTR $row, $_values) {
171
+	public function setValues($values=array()) {
172
+		return $this->_addOrSetValues($values, function(HtmlTR $row, $_values) {
173 173
 			$row->setValues($_values);
174 174
 		});
175 175
 	}
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
 	 *
180 180
 	 * @param mixed $values
181 181
 	 */
182
-	public function addValues($values = array()) {
183
-		return $this->_addOrSetValues($values, function (HtmlTR $row, $_values) {
182
+	public function addValues($values=array()) {
183
+		return $this->_addOrSetValues($values, function(HtmlTR $row, $_values) {
184 184
 			$row->addValues($_values);
185 185
 		});
186 186
 	}
@@ -192,42 +192,42 @@  discard block
 block discarded – undo
192 192
 	 * @param callable $callback
193 193
 	 */
194 194
 	protected function _addOrSetValues($values, $callback) {
195
-		$count = $this->count();
196
-		$isArray = true;
197
-		if (! \is_array($values)) {
198
-			$values = \array_fill(0, $count, $values);
199
-			$isArray = false;
195
+		$count=$this->count();
196
+		$isArray=true;
197
+		if (!\is_array($values)) {
198
+			$values=\array_fill(0, $count, $values);
199
+			$isArray=false;
200 200
 		}
201
-		if (JArray::dimension($values) == 1 && $isArray)
202
-			$values = [
201
+		if (JArray::dimension($values)==1 && $isArray)
202
+			$values=[
203 203
 				$values
204 204
 			];
205 205
 
206
-		$count = \min(\sizeof($values), $count);
206
+		$count=\min(\sizeof($values), $count);
207 207
 
208
-		for ($i = 0; $i < $count; $i ++) {
209
-			$row = $this->content[$i];
208
+		for ($i=0; $i<$count; $i++) {
209
+			$row=$this->content[$i];
210 210
 			$callback($row, $values[$i]);
211 211
 		}
212 212
 		return $this;
213 213
 	}
214 214
 
215
-	public function setColValues($colIndex, $values = array()) {
216
-		$count = $this->count();
217
-		if (! \is_array($values)) {
218
-			$values = \array_fill(0, $count, $values);
215
+	public function setColValues($colIndex, $values=array()) {
216
+		$count=$this->count();
217
+		if (!\is_array($values)) {
218
+			$values=\array_fill(0, $count, $values);
219 219
 		}
220
-		$count = \min(\sizeof($values), $count);
221
-		for ($i = 0; $i < $count; $i ++) {
220
+		$count=\min(\sizeof($values), $count);
221
+		for ($i=0; $i<$count; $i++) {
222 222
 			$this->getCell($i, $colIndex)->setValue($values[$i]);
223 223
 		}
224 224
 		return $this;
225 225
 	}
226 226
 
227
-	public function addColVariations($colIndex, $variations = array()) {
228
-		$count = $this->count();
229
-		for ($i = 0; $i < $count; $i ++) {
230
-			$cell = $this->getCell($i, $colIndex);
227
+	public function addColVariations($colIndex, $variations=array()) {
228
+		$count=$this->count();
229
+		for ($i=0; $i<$count; $i++) {
230
+			$cell=$this->getCell($i, $colIndex);
231 231
 			if ($cell instanceof BaseTrait)
232 232
 				$cell->addVariations($variations);
233 233
 		}
@@ -235,31 +235,31 @@  discard block
 block discarded – undo
235 235
 	}
236 236
 
237 237
 	public function addPropertyCol($colIndex, $name, $value) {
238
-		$count = $this->count();
239
-		for ($i = 0; $i < $count; $i ++) {
240
-			$cell = $this->getCell($i, $colIndex);
238
+		$count=$this->count();
239
+		for ($i=0; $i<$count; $i++) {
240
+			$cell=$this->getCell($i, $colIndex);
241 241
 			if (isset($cell))
242 242
 				$cell->addToProperty($name, $value);
243 243
 		}
244 244
 		return $this;
245 245
 	}
246 246
 
247
-	public function setRowValues($rowIndex, $values = array()) {
248
-		$count = $this->count();
249
-		if (! \is_array($values)) {
250
-			$values = \array_fill(0, $count, $values);
247
+	public function setRowValues($rowIndex, $values=array()) {
248
+		$count=$this->count();
249
+		if (!\is_array($values)) {
250
+			$values=\array_fill(0, $count, $values);
251 251
 		}
252 252
 		$this->getItem($rowIndex)->setValues($values);
253 253
 		return $this;
254 254
 	}
255 255
 
256 256
 	private function colAlign($colIndex, $function) {
257
-		$count = $this->count();
258
-		for ($i = 0; $i < $count; $i ++) {
259
-			$index = $this->content[$i]->getColPosition($colIndex);
260
-			if ($index !== NULL) {
261
-				$cell = $this->getCell($i, $index);
262
-				if ($cell != NULL) {
257
+		$count=$this->count();
258
+		for ($i=0; $i<$count; $i++) {
259
+			$index=$this->content[$i]->getColPosition($colIndex);
260
+			if ($index!==NULL) {
261
+				$cell=$this->getCell($i, $index);
262
+				if ($cell!=NULL) {
263 263
 					$cell->$function();
264 264
 				}
265 265
 			}
@@ -268,12 +268,12 @@  discard block
 block discarded – undo
268 268
 	}
269 269
 
270 270
 	private function colAlignFromRight($colIndex, $function) {
271
-		$count = $this->count();
272
-		for ($i = 0; $i < $count; $i ++) {
273
-			$maxRow = $this->content[$i]->count();
274
-			$index = $maxRow - $colIndex - 1;
275
-			if (($cell = $this->getCell($i, $index)) !== NULL) {
276
-				if ($cell->getColspan() == 1)
271
+		$count=$this->count();
272
+		for ($i=0; $i<$count; $i++) {
273
+			$maxRow=$this->content[$i]->count();
274
+			$index=$maxRow-$colIndex-1;
275
+			if (($cell=$this->getCell($i, $index))!==NULL) {
276
+				if ($cell->getColspan()==1)
277 277
 					$cell->$function();
278 278
 			}
279 279
 		}
@@ -319,9 +319,9 @@  discard block
 block discarded – undo
319 319
 	 * @return int
320 320
 	 */
321 321
 	public function getColCount() {
322
-		$result = 0;
323
-		if ($this->count() > 0)
324
-			$result = $this->getItem(0)->count();
322
+		$result=0;
323
+		if ($this->count()>0)
324
+			$result=$this->getItem(0)->count();
325 325
 		return $result;
326 326
 	}
327 327
 
@@ -332,10 +332,10 @@  discard block
 block discarded – undo
332 332
 	 * @param int $colIndex
333 333
 	 * @return HtmlTableContent
334 334
 	 */
335
-	public function delete($rowIndex, $colIndex = NULL) {
335
+	public function delete($rowIndex, $colIndex=NULL) {
336 336
 		if (isset($colIndex)) {
337
-			$row = $this->getItem($rowIndex);
338
-			if (isset($row) === true) {
337
+			$row=$this->getItem($rowIndex);
338
+			if (isset($row)===true) {
339 339
 				$row->delete($colIndex);
340 340
 			}
341 341
 		} else {
@@ -345,24 +345,24 @@  discard block
 block discarded – undo
345 345
 	}
346 346
 
347 347
 	public function toDelete($rowIndex, $colIndex) {
348
-		$row = $this->getItem($rowIndex);
349
-		if (isset($row) === true)
348
+		$row=$this->getItem($rowIndex);
349
+		if (isset($row)===true)
350 350
 			$row->toDelete($colIndex);
351 351
 		return $this;
352 352
 	}
353 353
 
354 354
 	public function toRowspanned($rowIndex, $colIndex) {
355
-		$row = $this->getItem($rowIndex);
356
-		if (isset($row) === true)
355
+		$row=$this->getItem($rowIndex);
356
+		if (isset($row)===true)
357 357
 			$row->toRowspanned($colIndex);
358 358
 		return $this;
359 359
 	}
360 360
 
361
-	public function mergeCol($rowIndex = 0, $colIndex = 0) {
361
+	public function mergeCol($rowIndex=0, $colIndex=0) {
362 362
 		return $this->getItem($rowIndex)->mergeCol($colIndex);
363 363
 	}
364 364
 
365
-	public function mergeRow($rowIndex = 0, $colIndex = 0) {
365
+	public function mergeRow($rowIndex=0, $colIndex=0) {
366 366
 		return $this->getItem($rowIndex)->mergeRow($colIndex);
367 367
 	}
368 368
 
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 	 * @return HtmlTableContent
383 383
 	 */
384 384
 	public function conditionalCellFormat($callback, $format) {
385
-		$rows = $this->content;
385
+		$rows=$this->content;
386 386
 		foreach ($rows as $row) {
387 387
 			$row->conditionalCellFormat($callback, $format);
388 388
 		}
@@ -390,9 +390,9 @@  discard block
 block discarded – undo
390 390
 	}
391 391
 
392 392
 	public function conditionalColFormat($colIndex, $callback, $format) {
393
-		$rows = $this->content;
393
+		$rows=$this->content;
394 394
 		foreach ($rows as $row) {
395
-			$cell = $row->getItem($colIndex);
395
+			$cell=$row->getItem($colIndex);
396 396
 			$cell->conditionnalCellFormat($callback, $format);
397 397
 		}
398 398
 		return $this;
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 	 * @return HtmlTableContent
406 406
 	 */
407 407
 	public function conditionalRowFormat($callback, $format) {
408
-		$rows = $this->content;
408
+		$rows=$this->content;
409 409
 		foreach ($rows as $row) {
410 410
 			$row->conditionalRowFormat($callback, $format);
411 411
 		}
@@ -413,9 +413,9 @@  discard block
 block discarded – undo
413 413
 	}
414 414
 
415 415
 	public function hideColumn($colIndex) {
416
-		$rows = $this->content;
416
+		$rows=$this->content;
417 417
 		foreach ($rows as $row) {
418
-			$cell = $row->getItem($colIndex);
418
+			$cell=$row->getItem($colIndex);
419 419
 			$cell->addToProperty("style", "display:none;");
420 420
 		}
421 421
 		return $this;
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 	 * @return HtmlTableContent
428 428
 	 */
429 429
 	public function applyCells($callback) {
430
-		$rows = $this->content;
430
+		$rows=$this->content;
431 431
 		foreach ($rows as $row) {
432 432
 			$row->applyCells($callback);
433 433
 		}
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 	 * @return HtmlTableContent
441 441
 	 */
442 442
 	public function applyRows($callback) {
443
-		$rows = $this->content;
443
+		$rows=$this->content;
444 444
 		foreach ($rows as $row) {
445 445
 			$row->apply($callback);
446 446
 		}
@@ -455,28 +455,28 @@  discard block
 block discarded – undo
455 455
 	 * @see https://fomantic-ui.com/collections/table.html#definition needs rowspanned class
456 456
 	 * @since fomantic-ui 2.4.8
457 457
 	 */
458
-	public function mergeIdentiqualValues($colIndex, $function = "strip_tags") {
459
-		$rows = $this->content;
460
-		$identiqual = null;
461
-		$counter = 0;
462
-		$cellToMerge = null;
463
-		$functionExists = \function_exists($function);
458
+	public function mergeIdentiqualValues($colIndex, $function="strip_tags") {
459
+		$rows=$this->content;
460
+		$identiqual=null;
461
+		$counter=0;
462
+		$cellToMerge=null;
463
+		$functionExists=\function_exists($function);
464 464
 		foreach ($rows as $row) {
465
-			$cell = $row->getItem($colIndex);
466
-			$value = $cell->getContent();
465
+			$cell=$row->getItem($colIndex);
466
+			$value=$cell->getContent();
467 467
 			if ($functionExists)
468
-				$value = \call_user_func($function, $value);
469
-			if ($value !== $identiqual) {
470
-				if ($counter > 0 && isset($cellToMerge)) {
468
+				$value=\call_user_func($function, $value);
469
+			if ($value!==$identiqual) {
470
+				if ($counter>0 && isset($cellToMerge)) {
471 471
 					$cellToMerge->setRowspanned($counter);
472 472
 				}
473
-				$counter = 0;
474
-				$cellToMerge = $cell;
475
-				$identiqual = $value;
473
+				$counter=0;
474
+				$cellToMerge=$cell;
475
+				$identiqual=$value;
476 476
 			}
477
-			$counter ++;
477
+			$counter++;
478 478
 		}
479
-		if ($counter > 0 && isset($cellToMerge)) {
479
+		if ($counter>0 && isset($cellToMerge)) {
480 480
 			$cellToMerge->setRowspanned($counter);
481 481
 		}
482 482
 		return $this;
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 	}
488 488
 
489 489
 	public function _setMerged($value) {
490
-		$this->_merged = $value;
490
+		$this->_merged=$value;
491 491
 		return $this;
492 492
 	}
493 493
 
@@ -496,6 +496,6 @@  discard block
 block discarded – undo
496 496
 	 * @param bool $focusable
497 497
 	 */
498 498
 	public function setFocusable(bool $focusable): void {
499
-		$this->_focusable = $focusable;
499
+		$this->_focusable=$focusable;
500 500
 	}
501 501
 }
Please login to merge, or discard this patch.
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	public function __construct($identifier, $tagName = "tbody", $rowCount = NULL, $colCount = NULL) {
36 36
 		parent::__construct($identifier, $tagName, "");
37
-		if (isset($rowCount) && isset($colCount))
38
-			$this->setRowCount($rowCount, $colCount);
37
+		if (isset($rowCount) && isset($colCount)) {
38
+					$this->setRowCount($rowCount, $colCount);
39
+		}
39 40
 	}
40 41
 
41 42
 	/**
@@ -198,10 +199,11 @@  discard block
 block discarded – undo
198 199
 			$values = \array_fill(0, $count, $values);
199 200
 			$isArray = false;
200 201
 		}
201
-		if (JArray::dimension($values) == 1 && $isArray)
202
-			$values = [
202
+		if (JArray::dimension($values) == 1 && $isArray) {
203
+					$values = [
203 204
 				$values
204 205
 			];
206
+		}
205 207
 
206 208
 		$count = \min(\sizeof($values), $count);
207 209
 
@@ -228,8 +230,9 @@  discard block
 block discarded – undo
228 230
 		$count = $this->count();
229 231
 		for ($i = 0; $i < $count; $i ++) {
230 232
 			$cell = $this->getCell($i, $colIndex);
231
-			if ($cell instanceof BaseTrait)
232
-				$cell->addVariations($variations);
233
+			if ($cell instanceof BaseTrait) {
234
+							$cell->addVariations($variations);
235
+			}
233 236
 		}
234 237
 		return $this;
235 238
 	}
@@ -238,8 +241,9 @@  discard block
 block discarded – undo
238 241
 		$count = $this->count();
239 242
 		for ($i = 0; $i < $count; $i ++) {
240 243
 			$cell = $this->getCell($i, $colIndex);
241
-			if (isset($cell))
242
-				$cell->addToProperty($name, $value);
244
+			if (isset($cell)) {
245
+							$cell->addToProperty($name, $value);
246
+			}
243 247
 		}
244 248
 		return $this;
245 249
 	}
@@ -273,8 +277,9 @@  discard block
 block discarded – undo
273 277
 			$maxRow = $this->content[$i]->count();
274 278
 			$index = $maxRow - $colIndex - 1;
275 279
 			if (($cell = $this->getCell($i, $index)) !== NULL) {
276
-				if ($cell->getColspan() == 1)
277
-					$cell->$function();
280
+				if ($cell->getColspan() == 1) {
281
+									$cell->$function();
282
+				}
278 283
 			}
279 284
 		}
280 285
 		return $this;
@@ -320,8 +325,9 @@  discard block
 block discarded – undo
320 325
 	 */
321 326
 	public function getColCount() {
322 327
 		$result = 0;
323
-		if ($this->count() > 0)
324
-			$result = $this->getItem(0)->count();
328
+		if ($this->count() > 0) {
329
+					$result = $this->getItem(0)->count();
330
+		}
325 331
 		return $result;
326 332
 	}
327 333
 
@@ -346,15 +352,17 @@  discard block
 block discarded – undo
346 352
 
347 353
 	public function toDelete($rowIndex, $colIndex) {
348 354
 		$row = $this->getItem($rowIndex);
349
-		if (isset($row) === true)
350
-			$row->toDelete($colIndex);
355
+		if (isset($row) === true) {
356
+					$row->toDelete($colIndex);
357
+		}
351 358
 		return $this;
352 359
 	}
353 360
 
354 361
 	public function toRowspanned($rowIndex, $colIndex) {
355 362
 		$row = $this->getItem($rowIndex);
356
-		if (isset($row) === true)
357
-			$row->toRowspanned($colIndex);
363
+		if (isset($row) === true) {
364
+					$row->toRowspanned($colIndex);
365
+		}
358 366
 		return $this;
359 367
 	}
360 368
 
@@ -464,8 +472,9 @@  discard block
 block discarded – undo
464 472
 		foreach ($rows as $row) {
465 473
 			$cell = $row->getItem($colIndex);
466 474
 			$value = $cell->getContent();
467
-			if ($functionExists)
468
-				$value = \call_user_func($function, $value);
475
+			if ($functionExists) {
476
+							$value = \call_user_func($function, $value);
477
+			}
469 478
 			if ($value !== $identiqual) {
470 479
 				if ($counter > 0 && isset($cellToMerge)) {
471 480
 					$cellToMerge->setRowspanned($counter);
Please login to merge, or discard this patch.
Ajax/common/traits/JsUtilsAjaxTrait.php 2 patches
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -161,10 +161,11 @@  discard block
 block discarded – undo
161 161
 			} elseif (isset($this->ajaxTransition)) {
162 162
 				$call = $this->ajaxTransition;
163 163
 			}
164
-			if (\is_callable($call))
165
-				$retour = "\t" . $call($responseElement, $jqueryDone) . ";\n";
166
-			else
167
-				$retour = "\t{$responseElement}.{$jqueryDone}( data );\n";
164
+			if (\is_callable($call)) {
165
+							$retour = "\t" . $call($responseElement, $jqueryDone) . ";\n";
166
+			} else {
167
+							$retour = "\t{$responseElement}.{$jqueryDone}( data );\n";
168
+			}
168 169
 		}
169 170
 		if (isset($history)) {
170 171
 			if ($this->params["autoActiveLinks"]) {
@@ -198,8 +199,9 @@  discard block
 block discarded – undo
198 199
 	}
199 200
 
200 201
 	protected function _correctAjaxUrl($url) {
201
-		if ($url !== "/" && JString::endsWith($url, "/") === true)
202
-			$url = substr($url, 0, strlen($url) - 1);
202
+		if ($url !== "/" && JString::endsWith($url, "/") === true) {
203
+					$url = substr($url, 0, strlen($url) - 1);
204
+		}
203 205
 		if (strncmp($url, 'http://', 7) != 0 && strncmp($url, 'https://', 8) != 0) {
204 206
 			$url = $this->getUrl($url);
205 207
 		}
@@ -223,8 +225,9 @@  discard block
 block discarded – undo
223 225
 	public static function _implodeParams($parameters) {
224 226
 		$allParameters = [];
225 227
 		foreach ($parameters as $params) {
226
-			if (isset($params))
227
-				$allParameters[] = self::_correctParams($params);
228
+			if (isset($params)) {
229
+							$allParameters[] = self::_correctParams($params);
230
+			}
228 231
 		}
229 232
 		return \implode("+'&'+", $allParameters);
230 233
 	}
@@ -258,8 +261,9 @@  discard block
 block discarded – undo
258 261
 
259 262
 	protected function setDefaultParameters(&$parameters, $default) {
260 263
 		foreach ($default as $k => $v) {
261
-			if (! isset($parameters[$k]))
262
-				$parameters[$k] = $v;
264
+			if (! isset($parameters[$k])) {
265
+							$parameters[$k] = $v;
266
+			}
263 267
 		}
264 268
 	}
265 269
 
@@ -833,8 +837,9 @@  discard block
 block discarded – undo
833 837
 			$retour .= "$('#'+" . $form . ").submit();\n";
834 838
 		}
835 839
 		$retour = $this->_addJsCondition($jsCondition, $retour);
836
-		if ($immediatly)
837
-			$this->jquery_code_for_compile[] = $retour;
840
+		if ($immediatly) {
841
+					$this->jquery_code_for_compile[] = $retour;
842
+		}
838 843
 		return $retour;
839 844
 	}
840 845
 
Please login to merge, or discard this patch.
Spacing   +228 added lines, -228 removed lines patch added patch discarded remove patch
@@ -15,79 +15,79 @@  discard block
 block discarded – undo
15 15
 
16 16
 	protected $ajaxTransition;
17 17
 
18
-	protected $ajaxLoader = "<div class=\"ui active centered inline text loader\">Loading</div>";
18
+	protected $ajaxLoader="<div class=\"ui active centered inline text loader\">Loading</div>";
19 19
 
20 20
 	abstract public function getUrl($url);
21 21
 
22
-	abstract public function _add_event($element, $js, $event, $preventDefault = false, $stopPropagation = false, $immediatly = true, $listenerOn = false);
22
+	abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true, $listenerOn=false);
23 23
 
24
-	abstract public function interval($jsCode, $time, $globalName = null, $immediatly = true);
24
+	abstract public function interval($jsCode, $time, $globalName=null, $immediatly=true);
25 25
 
26
-	protected function _ajax($method, $url, $responseElement = '', $parameters = []) {
26
+	protected function _ajax($method, $url, $responseElement='', $parameters=[]) {
27 27
 		if (isset($this->params['ajax'])) {
28 28
 			extract($this->params['ajax']);
29 29
 		}
30 30
 		extract($parameters);
31 31
 
32
-		$jsCallback = isset($jsCallback) ? $jsCallback : '';
33
-		$retour = $this->_getAjaxUrl($url, $attr);
34
-		$originalSelector = $responseElement;
35
-		$responseElement = $this->_getResponseElement($responseElement);
36
-		$retour .= "var self=this;\n";
37
-		$before = isset($before) ? $before : "";
38
-		$retour .= $before;
39
-		if ($hasLoader === true && JString::isNotNull($responseElement)) {
32
+		$jsCallback=isset($jsCallback) ? $jsCallback : '';
33
+		$retour=$this->_getAjaxUrl($url, $attr);
34
+		$originalSelector=$responseElement;
35
+		$responseElement=$this->_getResponseElement($responseElement);
36
+		$retour.="var self=this;\n";
37
+		$before=isset($before) ? $before : "";
38
+		$retour.=$before;
39
+		if ($hasLoader===true && JString::isNotNull($responseElement)) {
40 40
 			$this->addLoading($retour, $responseElement, $ajaxLoader);
41
-		} elseif ($hasLoader === 'response') {
41
+		} elseif ($hasLoader==='response') {
42 42
 			$this->addResponseLoading($retour, $responseElement, $ajaxLoader);
43
-		} elseif ($hasLoader === 'internal-x') {
43
+		} elseif ($hasLoader==='internal-x') {
44 44
 			$this->addLoading($retour, '$(this).closest(".item, .step")', $ajaxLoader);
45
-		} elseif ($hasLoader === 'internal') {
46
-			$retour .= "\n$(this).addClass('loading');";
45
+		} elseif ($hasLoader==='internal') {
46
+			$retour.="\n$(this).addClass('loading');";
47 47
 		} elseif (\is_string($hasLoader)) {
48 48
 			$this->addLoading($retour, $hasLoader, $ajaxLoader);
49 49
 		}
50
-		$ajaxParameters = [
50
+		$ajaxParameters=[
51 51
 			"url" => "url",
52
-			"method" => "'" . \strtoupper($method) . "'"
52
+			"method" => "'".\strtoupper($method)."'"
53 53
 		];
54 54
 
55
-		$ajaxParameters["async"] = ($async ? "true" : "false");
55
+		$ajaxParameters["async"]=($async ? "true" : "false");
56 56
 
57 57
 		if (isset($params)) {
58
-			$ajaxParameters["data"] = self::_correctParams($params, $parameters);
58
+			$ajaxParameters["data"]=self::_correctParams($params, $parameters);
59 59
 		}
60 60
 		if (isset($headers)) {
61
-			$ajaxParameters["headers"] = $headers;
61
+			$ajaxParameters["headers"]=$headers;
62 62
 		}
63 63
 		if ($csrf) {
64
-			$csrf = (is_string($csrf)) ? $csrf : 'csrf-token';
65
-			$parameters["beforeSend"] = "jqXHR.setRequestHeader('{$csrf}', $('meta[name=\"{$csrf}\"]').attr('content'));";
64
+			$csrf=(is_string($csrf)) ? $csrf : 'csrf-token';
65
+			$parameters["beforeSend"]="jqXHR.setRequestHeader('{$csrf}', $('meta[name=\"{$csrf}\"]').attr('content'));";
66 66
 		}
67 67
 		if (isset($partial)) {
68
-			$ajaxParameters["xhr"] = "xhrProvider";
69
-			$retour .= "var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.onreadystatechange = function (e) { if (3==e.target.readyState){let response=e.target.responseText;" . $partial . ";}; };";
68
+			$ajaxParameters["xhr"]="xhrProvider";
69
+			$retour.="var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.onreadystatechange = function (e) { if (3==e.target.readyState){let response=e.target.responseText;".$partial.";}; };";
70 70
 		} elseif (isset($upload)) {
71
-			$ajaxParameters["xhr"] = "xhrProvider";
72
-			$retour .= 'var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.upload.addEventListener("progress", function(event) {if (event.lengthComputable) {' . $upload . '}}, false);';
71
+			$ajaxParameters["xhr"]="xhrProvider";
72
+			$retour.='var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.upload.addEventListener("progress", function(event) {if (event.lengthComputable) {'.$upload.'}}, false);';
73 73
 		}
74 74
 		$this->createAjaxParameters($ajaxParameters, $parameters);
75
-		$retour .= "$.ajax({" . $this->implodeAjaxParameters($ajaxParameters) . "}).done(function( data, textStatus, jqXHR ) {\n";
76
-		$retour .= $this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, ($historize ? $originalSelector : null)) . "})";
75
+		$retour.="$.ajax({".$this->implodeAjaxParameters($ajaxParameters)."}).done(function( data, textStatus, jqXHR ) {\n";
76
+		$retour.=$this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, ($historize ? $originalSelector : null))."})";
77 77
 		if (isset($error)) {
78
-			$retour .= '.fail(function( jqXHR, textStatus, errorThrown ){' . $error . '})';
78
+			$retour.='.fail(function( jqXHR, textStatus, errorThrown ){'.$error.'})';
79 79
 		}
80
-		$retour .= '.always(function( dataOrjqXHR, textStatus, jqXHROrerrorThrown ) {' . ($always ?? '') . $this->removeLoader($hasLoader) . '})';
81
-		$retour .= ";\n";
82
-		$retour = $this->_addJsCondition($jsCondition, $retour);
80
+		$retour.='.always(function( dataOrjqXHR, textStatus, jqXHROrerrorThrown ) {'.($always ?? '').$this->removeLoader($hasLoader).'})';
81
+		$retour.=";\n";
82
+		$retour=$this->_addJsCondition($jsCondition, $retour);
83 83
 		if ($immediatly) {
84
-			$this->jquery_code_for_compile[] = $retour;
84
+			$this->jquery_code_for_compile[]=$retour;
85 85
 		}
86 86
 		return $retour;
87 87
 	}
88 88
 
89 89
 	protected function createAjaxParameters(&$original, $parameters) {
90
-		$validParameters = [
90
+		$validParameters=[
91 91
 			"contentType" => "%value%",
92 92
 			"dataType" => "'%value%'",
93 93
 			"beforeSend" => "function(jqXHR,settings){%value%}",
@@ -96,21 +96,21 @@  discard block
 block discarded – undo
96 96
 		];
97 97
 		foreach ($validParameters as $param => $mask) {
98 98
 			if (isset($parameters[$param])) {
99
-				$original[$param] = \str_replace("%value%", $parameters[$param], $mask);
99
+				$original[$param]=\str_replace("%value%", $parameters[$param], $mask);
100 100
 			}
101 101
 		}
102 102
 	}
103 103
 
104 104
 	protected function implodeAjaxParameters($ajaxParameters) {
105
-		$s = '';
105
+		$s='';
106 106
 		foreach ($ajaxParameters as $k => $v) {
107
-			if ($s !== '') {
108
-				$s .= ',';
107
+			if ($s!=='') {
108
+				$s.=',';
109 109
 			}
110 110
 			if (is_array($v)) {
111
-				$s .= "'{$k}':{" . self::implodeAjaxParameters($v) . "}";
111
+				$s.="'{$k}':{".self::implodeAjaxParameters($v)."}";
112 112
 			} else {
113
-				$s .= "'{$k}':{$v}";
113
+				$s.="'{$k}':{$v}";
114 114
 			}
115 115
 		}
116 116
 		return $s;
@@ -118,29 +118,29 @@  discard block
 block discarded – undo
118 118
 
119 119
 	protected function _addJsCondition($jsCondition, $jsSource) {
120 120
 		if (isset($jsCondition)) {
121
-			return "if(" . $jsCondition . "){\n" . $jsSource . "\n}";
121
+			return "if(".$jsCondition."){\n".$jsSource."\n}";
122 122
 		}
123 123
 		return $jsSource;
124 124
 	}
125 125
 
126 126
 	protected function _getAjaxUrl($url, $attr) {
127
-		$url = $this->_correctAjaxUrl($url);
128
-		$retour = "url='" . $url . "';";
129
-		$slash = "/";
130
-		if (JString::endswith($url, "/") === true) {
131
-			$slash = "";
127
+		$url=$this->_correctAjaxUrl($url);
128
+		$retour="url='".$url."';";
129
+		$slash="/";
130
+		if (JString::endswith($url, "/")===true) {
131
+			$slash="";
132 132
 		}
133 133
 
134 134
 		if (JString::isNotNull($attr)) {
135
-			if ($attr === "value") {
136
-				$retour .= "url=url+'" . $slash . "'+$(this).val();\n";
137
-			} elseif ($attr === "html") {
138
-				$retour .= "url=url+'" . $slash . "'+$(this).html();\n";
139
-			} elseif (\substr($attr, 0, 3) === "js:") {
140
-				$retour .= "url=url+'" . $slash . "'+" . \substr($attr, 3) . ";\n";
141
-			} elseif ($attr !== null && $attr !== "") {
142
-				$retour .= "let elmUrl=$(this).attr('" . $attr . "')||'';";
143
-				$retour .= "url=(!/^((http|https|ftp):\/\/)/.test(elmUrl))?url+'" . $slash . "'+elmUrl:elmUrl;\n";
135
+			if ($attr==="value") {
136
+				$retour.="url=url+'".$slash."'+$(this).val();\n";
137
+			} elseif ($attr==="html") {
138
+				$retour.="url=url+'".$slash."'+$(this).html();\n";
139
+			} elseif (\substr($attr, 0, 3)==="js:") {
140
+				$retour.="url=url+'".$slash."'+".\substr($attr, 3).";\n";
141
+			} elseif ($attr!==null && $attr!=="") {
142
+				$retour.="let elmUrl=$(this).attr('".$attr."')||'';";
143
+				$retour.="url=(!/^((http|https|ftp):\/\/)/.test(elmUrl))?url+'".$slash."'+elmUrl:elmUrl;\n";
144 144
 			}
145 145
 		}
146 146
 		return $retour;
@@ -150,44 +150,44 @@  discard block
 block discarded – undo
150 150
 		return "window.onpopstate = function(e){if(e.state){var target=e.state.jqueryDone;$(e.state.selector)[target](e.state.html);}};";
151 151
 	}
152 152
 
153
-	protected function autoActiveLinks($previousURL = "window.location.href") {
154
-		$result = "\nfunction getHref(url) { return \$('a').filter(function(){return \$(this).prop('href') == url; });}";
155
-		$result .= "\nvar myurl={$previousURL};if(window._previousURL) getHref(window._previousURL).removeClass('active');getHref(myurl).addClass('active');window._previousURL=myurl;";
153
+	protected function autoActiveLinks($previousURL="window.location.href") {
154
+		$result="\nfunction getHref(url) { return \$('a').filter(function(){return \$(this).prop('href') == url; });}";
155
+		$result.="\nvar myurl={$previousURL};if(window._previousURL) getHref(window._previousURL).removeClass('active');getHref(myurl).addClass('active');window._previousURL=myurl;";
156 156
 		return $result;
157 157
 	}
158 158
 
159
-	protected function _getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $history = null) {
160
-		$retour = "";
161
-		$call = null;
159
+	protected function _getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $history=null) {
160
+		$retour="";
161
+		$call=null;
162 162
 		if (JString::isNotNull($responseElement)) {
163 163
 			if (isset($ajaxTransition)) {
164
-				$call = $this->setAjaxDataCall($ajaxTransition);
164
+				$call=$this->setAjaxDataCall($ajaxTransition);
165 165
 			} elseif (isset($this->ajaxTransition)) {
166
-				$call = $this->ajaxTransition;
166
+				$call=$this->ajaxTransition;
167 167
 			}
168 168
 			if (\is_callable($call))
169
-				$retour = "\t" . $call($responseElement, $jqueryDone) . ";\n";
169
+				$retour="\t".$call($responseElement, $jqueryDone).";\n";
170 170
 			else
171
-				$retour = "\t{$responseElement}.{$jqueryDone}( data );\n";
171
+				$retour="\t{$responseElement}.{$jqueryDone}( data );\n";
172 172
 		}
173 173
 		if (isset($history)) {
174 174
 			if ($this->params["autoActiveLinks"]) {
175
-				$retour .= $this->autoActiveLinks("url");
175
+				$retour.=$this->autoActiveLinks("url");
176 176
 			}
177
-			$retour .= "\nwindow.history.pushState({'html':data,'selector':" . Javascript::prep_value($history) . ",'jqueryDone':'{$jqueryDone}'},'', url);";
177
+			$retour.="\nwindow.history.pushState({'html':data,'selector':".Javascript::prep_value($history).",'jqueryDone':'{$jqueryDone}'},'', url);";
178 178
 		}
179
-		$retour .= "\t" . $jsCallback . "\n";
179
+		$retour.="\t".$jsCallback."\n";
180 180
 		return $retour;
181 181
 	}
182 182
 
183 183
 	protected function removeLoader($hasLoader) {
184
-		if ($hasLoader === true) {
184
+		if ($hasLoader===true) {
185 185
 			return "\n$('body').find('.ajax-loader').remove();";
186 186
 		}
187
-		if ($hasLoader === 'internal') {
187
+		if ($hasLoader==='internal') {
188 188
 			return "\n$(self).removeClass('loading');";
189 189
 		}
190
-		if ($hasLoader === 'internal-x') {
190
+		if ($hasLoader==='internal-x') {
191 191
 			return "\n$(self).children('.ajax-loader').remove();";
192 192
 		}
193 193
 		return "\n$('body').find('.loading').removeClass('loading');";
@@ -195,71 +195,71 @@  discard block
 block discarded – undo
195 195
 
196 196
 	protected function _getResponseElement($responseElement) {
197 197
 		if (JString::isNotNull($responseElement)) {
198
-			$responseElement = Javascript::prep_jquery_selector($responseElement);
198
+			$responseElement=Javascript::prep_jquery_selector($responseElement);
199 199
 		}
200 200
 		return $responseElement;
201 201
 	}
202 202
 
203 203
 	protected function _getFormElement($formElement) {
204 204
 		if (JString::isNotNull($formElement)) {
205
-			$formElement = Javascript::prep_value($formElement);
205
+			$formElement=Javascript::prep_value($formElement);
206 206
 		}
207 207
 		return $formElement;
208 208
 	}
209 209
 
210 210
 	protected function _correctAjaxUrl($url) {
211
-		if ($url !== "/" && JString::endsWith($url, "/") === true)
212
-			$url = substr($url, 0, strlen($url) - 1);
213
-		if (strncmp($url, 'http://', 7) != 0 && strncmp($url, 'https://', 8) != 0) {
214
-			$url = $this->getUrl($url);
211
+		if ($url!=="/" && JString::endsWith($url, "/")===true)
212
+			$url=substr($url, 0, strlen($url)-1);
213
+		if (strncmp($url, 'http://', 7)!=0 && strncmp($url, 'https://', 8)!=0) {
214
+			$url=$this->getUrl($url);
215 215
 		}
216 216
 		return $url;
217 217
 	}
218 218
 
219
-	public static function _correctParams($params, $ajaxParameters = []) {
219
+	public static function _correctParams($params, $ajaxParameters=[]) {
220 220
 		if (JString::isNull($params)) {
221 221
 			return "";
222 222
 		}
223 223
 		if (\preg_match("@^\{.*?\}$@", $params)) {
224
-			if (! isset($ajaxParameters['contentType']) || ! JString::contains($ajaxParameters['contentType'], 'json')) {
225
-				return '$.param(' . $params . ')';
224
+			if (!isset($ajaxParameters['contentType']) || !JString::contains($ajaxParameters['contentType'], 'json')) {
225
+				return '$.param('.$params.')';
226 226
 			} else {
227
-				return 'JSON.stringify(' . $params . ')';
227
+				return 'JSON.stringify('.$params.')';
228 228
 			}
229 229
 		}
230 230
 		return $params;
231 231
 	}
232 232
 
233 233
 	public static function _implodeParams($parameters) {
234
-		$allParameters = [];
234
+		$allParameters=[];
235 235
 		foreach ($parameters as $params) {
236 236
 			if (isset($params))
237
-				$allParameters[] = self::_correctParams($params);
237
+				$allParameters[]=self::_correctParams($params);
238 238
 		}
239 239
 		return \implode("+'&'+", $allParameters);
240 240
 	}
241 241
 
242
-	protected function addLoading(&$retour, $responseElement, $ajaxLoader = null) {
243
-		if (! isset($ajaxLoader)) {
244
-			$ajaxLoader = $this->ajaxLoader;
242
+	protected function addLoading(&$retour, $responseElement, $ajaxLoader=null) {
243
+		if (!isset($ajaxLoader)) {
244
+			$ajaxLoader=$this->ajaxLoader;
245 245
 		}
246
-		$loading_notifier = '<div class="ajax-loader ui active inverted dimmer">' . $ajaxLoader . '</div>';
247
-		$retour .= "\t\t{$responseElement}.append('{$loading_notifier}');\n";
246
+		$loading_notifier='<div class="ajax-loader ui active inverted dimmer">'.$ajaxLoader.'</div>';
247
+		$retour.="\t\t{$responseElement}.append('{$loading_notifier}');\n";
248 248
 	}
249 249
 
250
-	protected function addResponseLoading(&$retour, $responseElement, $ajaxLoader = null) {
251
-		if (! isset($ajaxLoader)) {
252
-			$ajaxLoader = $this->ajaxLoader;
250
+	protected function addResponseLoading(&$retour, $responseElement, $ajaxLoader=null) {
251
+		if (!isset($ajaxLoader)) {
252
+			$ajaxLoader=$this->ajaxLoader;
253 253
 		}
254
-		$loading_notifier = '<div class="ajax-loader">' . $ajaxLoader . '</div>';
255
-		$retour .= "{$responseElement}.empty();\n";
256
-		$retour .= "\t\t{$responseElement}.prepend('{$loading_notifier}');\n";
254
+		$loading_notifier='<div class="ajax-loader">'.$ajaxLoader.'</div>';
255
+		$retour.="{$responseElement}.empty();\n";
256
+		$retour.="\t\t{$responseElement}.prepend('{$loading_notifier}');\n";
257 257
 	}
258 258
 
259 259
 	protected function setAjaxDataCall($params) {
260
-		$result = null;
261
-		if (! \is_callable($params)) {
262
-			$result = function ($responseElement, $jqueryDone = 'html') use ($params) {
260
+		$result=null;
261
+		if (!\is_callable($params)) {
262
+			$result=function($responseElement, $jqueryDone='html') use ($params) {
263 263
 				return AjaxTransition::{$params}($responseElement, $jqueryDone);
264 264
 			};
265 265
 		}
@@ -268,13 +268,13 @@  discard block
 block discarded – undo
268 268
 
269 269
 	protected function setDefaultParameters(&$parameters, $default) {
270 270
 		foreach ($default as $k => $v) {
271
-			if (! isset($parameters[$k]))
272
-				$parameters[$k] = $v;
271
+			if (!isset($parameters[$k]))
272
+				$parameters[$k]=$v;
273 273
 		}
274 274
 	}
275 275
 
276 276
 	public function setAjaxLoader($loader) {
277
-		$this->ajaxLoader = $loader;
277
+		$this->ajaxLoader=$loader;
278 278
 	}
279 279
 
280 280
 	/**
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 	 * @param string $responseElement
286 286
 	 *        	selector of the HTML element displaying the answer
287 287
 	 */
288
-	private function _get($url, $responseElement = '', $parameters = []) {
288
+	private function _get($url, $responseElement='', $parameters=[]) {
289 289
 		return $this->_ajax('get', $url, $responseElement, $parameters);
290 290
 	}
291 291
 
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
 	 * @param array $parameters
300 300
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
301 301
 	 */
302
-	public function get($url, $responseElement = '', $parameters = []) {
303
-		$parameters['immediatly'] = true;
302
+	public function get($url, $responseElement='', $parameters=[]) {
303
+		$parameters['immediatly']=true;
304 304
 		return $this->_get($url, $responseElement, $parameters);
305 305
 	}
306 306
 
@@ -316,8 +316,8 @@  discard block
 block discarded – undo
316 316
 	 * @param array $parameters
317 317
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
318 318
 	 */
319
-	public function ajax($method, $url, $responseElement = '', $parameters = []) {
320
-		$parameters['immediatly'] = true;
319
+	public function ajax($method, $url, $responseElement='', $parameters=[]) {
320
+		$parameters['immediatly']=true;
321 321
 		return $this->_ajax($method, $url, $responseElement, $parameters);
322 322
 	}
323 323
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 	 *        	$immediatly
340 340
 	 * @return string
341 341
 	 */
342
-	public function ajaxInterval($method, $url, $interval, $globalName = null, $responseElement = '', $parameters = [], $immediatly = true) {
342
+	public function ajaxInterval($method, $url, $interval, $globalName=null, $responseElement='', $parameters=[], $immediatly=true) {
343 343
 		return $this->interval($this->ajaxDeferred($method, $url, $responseElement, $parameters), $interval, $globalName, $immediatly);
344 344
 	}
345 345
 
@@ -355,8 +355,8 @@  discard block
 block discarded – undo
355 355
 	 * @param array $parameters
356 356
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
357 357
 	 */
358
-	public function ajaxDeferred($method, $url, $responseElement = '', $parameters = []) {
359
-		$parameters['immediatly'] = false;
358
+	public function ajaxDeferred($method, $url, $responseElement='', $parameters=[]) {
359
+		$parameters['immediatly']=false;
360 360
 		return $this->_ajax($method, $url, $responseElement, $parameters);
361 361
 	}
362 362
 
@@ -370,15 +370,15 @@  discard block
 block discarded – undo
370 370
 	 * @param array $parameters
371 371
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)
372 372
 	 */
373
-	private function _json($url, $method = "get", $parameters = []) {
374
-		$parameters = \array_merge($parameters, [
373
+	private function _json($url, $method="get", $parameters=[]) {
374
+		$parameters=\array_merge($parameters, [
375 375
 			"hasLoader" => false
376 376
 		]);
377
-		$jsCallback = isset($parameters['jsCallback']) ? $parameters['jsCallback'] : "";
378
-		$context = isset($parameters['context']) ? $parameters['context'] : "document";
379
-		$retour = "\tdata=($.isPlainObject(data))?data:JSON.parse(data);\t" . $jsCallback . ";" . "\n\tfor(var key in data){" . "if($('#'+key," . $context . ").length){ if($('#'+key," . $context . ").is('[value]')) { $('#'+key," . $context . ").val(data[key]);} else { $('#'+key," . $context . ").html(data[key]); }}};\n";
380
-		$retour .= "\t$(document).trigger('jsonReady',[data]);\n";
381
-		$parameters["jsCallback"] = $retour;
377
+		$jsCallback=isset($parameters['jsCallback']) ? $parameters['jsCallback'] : "";
378
+		$context=isset($parameters['context']) ? $parameters['context'] : "document";
379
+		$retour="\tdata=($.isPlainObject(data))?data:JSON.parse(data);\t".$jsCallback.";"."\n\tfor(var key in data){"."if($('#'+key,".$context.").length){ if($('#'+key,".$context.").is('[value]')) { $('#'+key,".$context.").val(data[key]);} else { $('#'+key,".$context.").html(data[key]); }}};\n";
380
+		$retour.="\t$(document).trigger('jsonReady',[data]);\n";
381
+		$parameters["jsCallback"]=$retour;
382 382
 		return $this->_ajax($method, $url, null, $parameters);
383 383
 	}
384 384
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	 * @param array $parameters
393 393
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)
394 394
 	 */
395
-	public function json($url, $method = "get", $parameters = []) {
395
+	public function json($url, $method="get", $parameters=[]) {
396 396
 		return $this->_json($url, $method, $parameters);
397 397
 	}
398 398
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 	 * @param array $parameters
409 409
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","immediatly"=>true,"before"=>null,"listenerOn"=>false)
410 410
 	 */
411
-	public function jsonOn($event, $element, $url, $method = 'get', $parameters = array()) {
411
+	public function jsonOn($event, $element, $url, $method='get', $parameters=array()) {
412 412
 		$this->setDefaultParameters($parameters, [
413 413
 			'preventDefault' => true,
414 414
 			'stopPropagation' => true,
@@ -428,8 +428,8 @@  discard block
 block discarded – undo
428 428
 	 * @param array $parameters
429 429
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)
430 430
 	 */
431
-	public function jsonDeferred($url, $method = 'get', $parameters = []) {
432
-		$parameters['immediatly'] = false;
431
+	public function jsonDeferred($url, $method='get', $parameters=[]) {
432
+		$parameters['immediatly']=false;
433 433
 		return $this->_json($url, $method, $parameters);
434 434
 	}
435 435
 
@@ -444,29 +444,29 @@  discard block
 block discarded – undo
444 444
 	 * @param array $parameters
445 445
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"rowClass"=>"_json","before"=>null)
446 446
 	 */
447
-	private function _jsonArray($maskSelector, $url, $method = 'get', $parameters = []) {
448
-		$parameters = \array_merge($parameters, [
447
+	private function _jsonArray($maskSelector, $url, $method='get', $parameters=[]) {
448
+		$parameters=\array_merge($parameters, [
449 449
 			"hasLoader" => false
450 450
 		]);
451
-		$rowClass = isset($parameters['rowClass']) ? $parameters['rowClass'] : "_json";
452
-		$jsCallback = isset($parameters['jsCallback']) ? $parameters['jsCallback'] : "";
453
-		$context = isset($parameters['context']) ? $parameters['context'] : null;
454
-		if ($context === null) {
455
-			$parent = "$('" . $maskSelector . "').parent()";
456
-			$newElm = "$('#'+newId)";
451
+		$rowClass=isset($parameters['rowClass']) ? $parameters['rowClass'] : "_json";
452
+		$jsCallback=isset($parameters['jsCallback']) ? $parameters['jsCallback'] : "";
453
+		$context=isset($parameters['context']) ? $parameters['context'] : null;
454
+		if ($context===null) {
455
+			$parent="$('".$maskSelector."').parent()";
456
+			$newElm="$('#'+newId)";
457 457
 		} else {
458
-			$parent = $context;
459
-			$newElm = $context . ".find('#'+newId)";
458
+			$parent=$context;
459
+			$newElm=$context.".find('#'+newId)";
460 460
 		}
461
-		$appendTo = "\t\tnewElm.appendTo(" . $parent . ");\n";
462
-		$retour = $parent . ".find('.{$rowClass}').remove();";
463
-		$retour .= "\tdata=($.isPlainObject(data)||$.isArray(data))?data:JSON.parse(data);\n$.each(data, function(index, value) {\n" . "\tvar created=false;var maskElm=$('" . $maskSelector . "').first();maskElm.hide();" . "\tvar newId=(maskElm.attr('id') || 'mask')+'-'+index;" . "\tvar newElm=" . $newElm . ";\n" . "\tif(!newElm.length){\n" . "\t\tnewElm=maskElm.clone();
461
+		$appendTo="\t\tnewElm.appendTo(".$parent.");\n";
462
+		$retour=$parent.".find('.{$rowClass}').remove();";
463
+		$retour.="\tdata=($.isPlainObject(data)||$.isArray(data))?data:JSON.parse(data);\n$.each(data, function(index, value) {\n"."\tvar created=false;var maskElm=$('".$maskSelector."').first();maskElm.hide();"."\tvar newId=(maskElm.attr('id') || 'mask')+'-'+index;"."\tvar newElm=".$newElm.";\n"."\tif(!newElm.length){\n"."\t\tnewElm=maskElm.clone();
464 464
 		newElm.attr('id',newId);\n;newElm.addClass('{$rowClass}').removeClass('_jsonArrayModel');\nnewElm.find('[id]').each(function(){ var newId=$(this).attr('id')+'-'+index;$(this).attr('id',newId).removeClass('_jsonArrayChecked');});\n";
465
-		$retour .= $appendTo;
466
-		$retour .= "\t}\n" . "\tfor(var key in value){\n" . "\t\t\tvar html = $('<div />').append($(newElm).clone()).html();\n" . "\t\t\tif(html.indexOf('__'+key+'__')>-1){\n" . "\t\t\t\tcontent=$(html.split('__'+key+'__').join(value[key]));\n" . "\t\t\t\t$(newElm).replaceWith(content);newElm=content;\n" . "\t\t\t}\n" . "\t\tvar sel='[data-id=\"'+key+'\"]';if($(sel,newElm).length){\n" . "\t\t\tvar selElm=$(sel,newElm);\n" . "\t\t\t if(selElm.is('[value]')) { selElm.attr('value',value[key]);selElm.val(value[key]);} else { selElm.html(value[key]); }\n" . "\t\t}\n" . "}\n" . "\t$(newElm).show(true);" . "\n" . "\t$(newElm).removeClass('hide');" . "});\n";
467
-		$retour .= "\t$(document).trigger('jsonReady',[data]);\n";
468
-		$retour .= "\t" . $jsCallback;
469
-		$parameters["jsCallback"] = $retour;
465
+		$retour.=$appendTo;
466
+		$retour.="\t}\n"."\tfor(var key in value){\n"."\t\t\tvar html = $('<div />').append($(newElm).clone()).html();\n"."\t\t\tif(html.indexOf('__'+key+'__')>-1){\n"."\t\t\t\tcontent=$(html.split('__'+key+'__').join(value[key]));\n"."\t\t\t\t$(newElm).replaceWith(content);newElm=content;\n"."\t\t\t}\n"."\t\tvar sel='[data-id=\"'+key+'\"]';if($(sel,newElm).length){\n"."\t\t\tvar selElm=$(sel,newElm);\n"."\t\t\t if(selElm.is('[value]')) { selElm.attr('value',value[key]);selElm.val(value[key]);} else { selElm.html(value[key]); }\n"."\t\t}\n"."}\n"."\t$(newElm).show(true);"."\n"."\t$(newElm).removeClass('hide');"."});\n";
467
+		$retour.="\t$(document).trigger('jsonReady',[data]);\n";
468
+		$retour.="\t".$jsCallback;
469
+		$parameters["jsCallback"]=$retour;
470 470
 		return $this->_ajax($method, $url, null, $parameters);
471 471
 	}
472 472
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 	 * @param array $parameters
482 482
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"rowClass"=>"_json","before"=>null)
483 483
 	 */
484
-	public function jsonArray($maskSelector, $url, $method = 'get', $parameters = []) {
484
+	public function jsonArray($maskSelector, $url, $method='get', $parameters=[]) {
485 485
 		return $this->_jsonArray($maskSelector, $url, $method, $parameters);
486 486
 	}
487 487
 
@@ -496,8 +496,8 @@  discard block
 block discarded – undo
496 496
 	 * @param array $parameters
497 497
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"rowClass"=>"_json","before"=>null)
498 498
 	 */
499
-	public function jsonArrayDeferred($maskSelector, $url, $method = 'get', $parameters = []) {
500
-		$parameters['immediatly'] = false;
499
+	public function jsonArrayDeferred($maskSelector, $url, $method='get', $parameters=[]) {
500
+		$parameters['immediatly']=false;
501 501
 		return $this->jsonArray($maskSelector, $url, $method, $parameters);
502 502
 	}
503 503
 
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 	 * @param array $parameters
514 514
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","rowClass"=>"_json","immediatly"=>true,"before"=>null,"listenerOn"=>false)
515 515
 	 */
516
-	public function jsonArrayOn($event, $element, $maskSelector, $url, $method = 'get', $parameters = array()) {
516
+	public function jsonArrayOn($event, $element, $maskSelector, $url, $method='get', $parameters=array()) {
517 517
 		$this->setDefaultParameters($parameters, [
518 518
 			'preventDefault' => true,
519 519
 			'stopPropagation' => true,
@@ -534,8 +534,8 @@  discard block
 block discarded – undo
534 534
 	 * @param array $parameters
535 535
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
536 536
 	 */
537
-	public function getDeferred($url, $responseElement = "", $parameters = []) {
538
-		$parameters['immediatly'] = false;
537
+	public function getDeferred($url, $responseElement="", $parameters=[]) {
538
+		$parameters['immediatly']=false;
539 539
 		return $this->_get($url, $responseElement, $parameters);
540 540
 	}
541 541
 
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
 	 * @param array $parameters
555 555
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)
556 556
 	 */
557
-	public function getOn($event, $element, $url, $responseElement = "", $parameters = array()) {
558
-		$parameters['method'] = 'get';
557
+	public function getOn($event, $element, $url, $responseElement="", $parameters=array()) {
558
+		$parameters['method']='get';
559 559
 		return $this->ajaxOn($event, $element, $url, $responseElement, $parameters);
560 560
 	}
561 561
 
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	 * @param array $parameters
575 575
 	 *        	default : array("method"=>"get","preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)
576 576
 	 */
577
-	public function ajaxOn($event, $element, $url, $responseElement = '', $parameters = array()) {
577
+	public function ajaxOn($event, $element, $url, $responseElement='', $parameters=array()) {
578 578
 		$this->setDefaultParameters($parameters, [
579 579
 			'preventDefault' => true,
580 580
 			'stopPropagation' => true,
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 	 * @param array $parameters
599 599
 	 *        	default : array("method"=>"get","preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)
600 600
 	 */
601
-	public function ajaxOnClick($element, $url, $responseElement = '', $parameters = array()) {
601
+	public function ajaxOnClick($element, $url, $responseElement='', $parameters=array()) {
602 602
 		return $this->ajaxOn('click', $element, $url, $responseElement, $parameters);
603 603
 	}
604 604
 
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 	 * @param array $parameters
616 616
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)
617 617
 	 */
618
-	public function getOnClick($element, $url, $responseElement = '', $parameters = array()) {
618
+	public function getOnClick($element, $url, $responseElement='', $parameters=array()) {
619 619
 		return $this->getOn('click', $element, $url, $responseElement, $parameters);
620 620
 	}
621 621
 
@@ -630,18 +630,18 @@  discard block
 block discarded – undo
630 630
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"href","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>true,"before"=>null,"listenerOn"=>false)
631 631
 	 * @return $this
632 632
 	 */
633
-	public function getHref($element, $responseElement = "", $parameters = array()) {
634
-		$parameters['attr'] = 'href';
633
+	public function getHref($element, $responseElement="", $parameters=array()) {
634
+		$parameters['attr']='href';
635 635
 		if (JString::isNull($responseElement)) {
636
-			$responseElement = '%$(self).attr("data-target")%';
636
+			$responseElement='%$(self).attr("data-target")%';
637 637
 		} else {
638
-			$responseElement = '%$(self).attr("data-target") || "' . $responseElement . '"%';
638
+			$responseElement='%$(self).attr("data-target") || "'.$responseElement.'"%';
639 639
 		}
640
-		if (! isset($parameters['historize'])) {
641
-			$parameters['historize'] = true;
640
+		if (!isset($parameters['historize'])) {
641
+			$parameters['historize']=true;
642 642
 		}
643
-		if (! isset($parameters['jsCallback'])) {
644
-			$parameters['jsCallback'] = 'var event = jQuery.Event( "getHref" );event.url = url;$(self).trigger(event);';
643
+		if (!isset($parameters['jsCallback'])) {
644
+			$parameters['jsCallback']='var event = jQuery.Event( "getHref" );event.url = url;$(self).trigger(event);';
645 645
 		}
646 646
 		return $this->getOnClick($element, "", $responseElement, $parameters);
647 647
 	}
@@ -657,15 +657,15 @@  discard block
 block discarded – undo
657 657
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"href","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>true,"before"=>null,"listenerOn"=>false)
658 658
 	 * @return $this
659 659
 	 */
660
-	public function postHref($element, $responseElement = "", $parameters = array()) {
661
-		$parameters['attr'] = 'href';
660
+	public function postHref($element, $responseElement="", $parameters=array()) {
661
+		$parameters['attr']='href';
662 662
 		if (JString::isNull($responseElement)) {
663
-			$responseElement = '%$(this).attr("data-target")%';
663
+			$responseElement='%$(this).attr("data-target")%';
664 664
 		} else {
665
-			$responseElement = '%$(self).attr("data-target") || "' . $responseElement . '"%';
665
+			$responseElement='%$(self).attr("data-target") || "'.$responseElement.'"%';
666 666
 		}
667
-		if (! isset($parameters['historize'])) {
668
-			$parameters['historize'] = true;
667
+		if (!isset($parameters['historize'])) {
668
+			$parameters['historize']=true;
669 669
 		}
670 670
 		return $this->postOnClick($element, '', '{}', $responseElement, $parameters);
671 671
 	}
@@ -681,29 +681,29 @@  discard block
 block discarded – undo
681 681
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"href","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>true,"before"=>null,"listenerOn"=>false)
682 682
 	 * @return $this
683 683
 	 */
684
-	public function postFormAction($element, $responseElement = "", $parameters = array()) {
685
-		$parameters['attr'] = 'action';
684
+	public function postFormAction($element, $responseElement="", $parameters=array()) {
685
+		$parameters['attr']='action';
686 686
 		if (JString::isNull($responseElement)) {
687
-			$responseElement = '%$(self).attr("data-target")%';
687
+			$responseElement='%$(self).attr("data-target")%';
688 688
 		} else {
689
-			$responseElement = '%$(self).attr("data-target") || "' . $responseElement . '"%';
689
+			$responseElement='%$(self).attr("data-target") || "'.$responseElement.'"%';
690 690
 		}
691
-		$formId = '%$(this).attr("id")%';
692
-		if (! isset($parameters['historize'])) {
693
-			$parameters['historize'] = true;
691
+		$formId='%$(this).attr("id")%';
692
+		if (!isset($parameters['historize'])) {
693
+			$parameters['historize']=true;
694 694
 		}
695
-		$parameters['preventDefault'] = true;
696
-		if (! isset($parameters['hasLoader'])) {
697
-			$parameters['hasLoader'] = '$(self).find("button, input[type=submit], input[type=button]")';
695
+		$parameters['preventDefault']=true;
696
+		if (!isset($parameters['hasLoader'])) {
697
+			$parameters['hasLoader']='$(self).find("button, input[type=submit], input[type=button]")';
698 698
 		}
699
-		if (! isset($parameters['jsCallback'])) {
700
-			$parameters['jsCallback'] = 'var event = jQuery.Event( "postFormAction" );event.params = Object.fromEntries(new URLSearchParams(params));$(self).trigger(event);';
699
+		if (!isset($parameters['jsCallback'])) {
700
+			$parameters['jsCallback']='var event = jQuery.Event( "postFormAction" );event.params = Object.fromEntries(new URLSearchParams(params));$(self).trigger(event);';
701 701
 		}
702 702
 		return $this->postFormOn('submit', $element, '', $formId, $responseElement, $parameters);
703 703
 	}
704 704
 
705
-	private function _post($url, $params = '{}', $responseElement = '', $parameters = []) {
706
-		$parameters['params'] = $params;
705
+	private function _post($url, $params='{}', $responseElement='', $parameters=[]) {
706
+		$parameters['params']=$params;
707 707
 		return $this->_ajax('POST', $url, $responseElement, $parameters);
708 708
 	}
709 709
 
@@ -719,8 +719,8 @@  discard block
 block discarded – undo
719 719
 	 * @param array $parameters
720 720
 	 *        	default : array("jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
721 721
 	 */
722
-	public function post($url, $params = "{}", $responseElement = "", $parameters = []) {
723
-		$parameters['immediatly'] = true;
722
+	public function post($url, $params="{}", $responseElement="", $parameters=[]) {
723
+		$parameters['immediatly']=true;
724 724
 		return $this->_post($url, $params, $responseElement, $parameters);
725 725
 	}
726 726
 
@@ -737,8 +737,8 @@  discard block
 block discarded – undo
737 737
 	 * @param array $parameters
738 738
 	 *        	default : array("jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
739 739
 	 */
740
-	public function postDeferred($url, $params = "{}", $responseElement = "", $parameters = []) {
741
-		$parameters['immediatly'] = false;
740
+	public function postDeferred($url, $params="{}", $responseElement="", $parameters=[]) {
741
+		$parameters['immediatly']=false;
742 742
 		return $this->_post($url, $params, $responseElement, $parameters);
743 743
 	}
744 744
 
@@ -757,9 +757,9 @@  discard block
 block discarded – undo
757 757
 	 * @param array $parameters
758 758
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)
759 759
 	 */
760
-	public function postOn($event, $element, $url, $params = "{}", $responseElement = "", $parameters = array()) {
761
-		$parameters['method'] = 'post';
762
-		$parameters['params'] = $params;
760
+	public function postOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) {
761
+		$parameters['method']='post';
762
+		$parameters['params']=$params;
763 763
 		return $this->ajaxOn($event, $element, $url, $responseElement, $parameters);
764 764
 	}
765 765
 
@@ -777,75 +777,75 @@  discard block
 block discarded – undo
777 777
 	 * @param array $parameters
778 778
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"before"=>null,"listenerOn"=>false)
779 779
 	 */
780
-	public function postOnClick($element, $url, $params = '{}', $responseElement = '', $parameters = array()) {
780
+	public function postOnClick($element, $url, $params='{}', $responseElement='', $parameters=array()) {
781 781
 		return $this->postOn('click', $element, $url, $params, $responseElement, $parameters);
782 782
 	}
783 783
 
784
-	private function _postForm($url, $form, $responseElement, $parameters = []) {
784
+	private function _postForm($url, $form, $responseElement, $parameters=[]) {
785 785
 		if (isset($this->params['ajax'])) {
786 786
 			extract($this->params['ajax']);
787 787
 		}
788
-		$params = '{}';
789
-		$validation = false;
788
+		$params='{}';
789
+		$validation=false;
790 790
 		\extract($parameters);
791
-		$async = ($async) ? 'true' : 'false';
792
-		$jsCallback = isset($jsCallback) ? $jsCallback : "";
793
-		$retour = $this->_getAjaxUrl($url, $attr);
794
-		$form = $this->_getFormElement($form);
795
-		$retour .= "\n$('#'+" . $form . ").trigger('ajaxSubmit');";
796
-		if (! isset($contentType) || $contentType != 'false') {
797
-			$retour .= "\nvar params=$('#'+" . $form . ").serialize();\n";
791
+		$async=($async) ? 'true' : 'false';
792
+		$jsCallback=isset($jsCallback) ? $jsCallback : "";
793
+		$retour=$this->_getAjaxUrl($url, $attr);
794
+		$form=$this->_getFormElement($form);
795
+		$retour.="\n$('#'+".$form.").trigger('ajaxSubmit');";
796
+		if (!isset($contentType) || $contentType!='false') {
797
+			$retour.="\nvar params=$('#'+".$form.").serialize();\n";
798 798
 			if (isset($params)) {
799
-				$retour .= "params+='&'+" . self::_correctParams($params) . ";\n";
799
+				$retour.="params+='&'+".self::_correctParams($params).";\n";
800 800
 			}
801 801
 		} else {
802
-			$retour .= "\nvar params=new FormData($('#'+" . $form . ")[0]);\n";
802
+			$retour.="\nvar params=new FormData($('#'+".$form.")[0]);\n";
803 803
 		}
804
-		$responseElement = $this->_getResponseElement($responseElement);
805
-		$retour .= "var self=this;\n";
806
-		$before = isset($before) ? $before : "";
807
-		$retour .= $before;
808
-		if ($hasLoader === true) {
804
+		$responseElement=$this->_getResponseElement($responseElement);
805
+		$retour.="var self=this;\n";
806
+		$before=isset($before) ? $before : "";
807
+		$retour.=$before;
808
+		if ($hasLoader===true) {
809 809
 			$this->addLoading($retour, $responseElement, $ajaxLoader);
810
-		} elseif ($hasLoader === 'response') {
810
+		} elseif ($hasLoader==='response') {
811 811
 			$this->addResponseLoading($retour, $responseElement, $ajaxLoader);
812
-		} elseif ($hasLoader === 'internal-x') {
812
+		} elseif ($hasLoader==='internal-x') {
813 813
 			$this->addLoading($retour, '$(this).closest(".item, .step")', $ajaxLoader);
814
-		} elseif ($hasLoader === 'internal') {
815
-			$retour .= "\n$(this).addClass('loading');";
814
+		} elseif ($hasLoader==='internal') {
815
+			$retour.="\n$(this).addClass('loading');";
816 816
 		} elseif (\is_string($hasLoader)) {
817
-			$retour .= "\n$hasLoader.addClass('loading');";
817
+			$retour.="\n$hasLoader.addClass('loading');";
818 818
 		}
819
-		$ajaxParameters = [
819
+		$ajaxParameters=[
820 820
 			"url" => "url",
821 821
 			"method" => "'POST'",
822 822
 			"data" => "params",
823 823
 			"async" => $async
824 824
 		];
825 825
 		if (isset($headers)) {
826
-			$ajaxParameters["headers"] = $headers;
826
+			$ajaxParameters["headers"]=$headers;
827 827
 		}
828 828
 		if (isset($partial)) {
829
-			$ajaxParameters["xhr"] = "xhrProvider";
830
-			$retour .= "var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.onreadystatechange = function (e) { if (3==e.target.readyState){let response=e.target.responseText;" . $partial . ";}; };";
829
+			$ajaxParameters["xhr"]="xhrProvider";
830
+			$retour.="var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.onreadystatechange = function (e) { if (3==e.target.readyState){let response=e.target.responseText;".$partial.";}; };";
831 831
 		}
832 832
 		$this->createAjaxParameters($ajaxParameters, $parameters);
833
-		$retour .= "$.ajax({" . $this->implodeAjaxParameters($ajaxParameters) . "}).done(function( data ) {\n";
834
-		$retour .= $this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback) . "})";
833
+		$retour.="$.ajax({".$this->implodeAjaxParameters($ajaxParameters)."}).done(function( data ) {\n";
834
+		$retour.=$this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback)."})";
835 835
 		if (isset($error)) {
836
-			$retour .= '.fail(function( jqXHR, textStatus, errorThrown ){' . $error . '})';
836
+			$retour.='.fail(function( jqXHR, textStatus, errorThrown ){'.$error.'})';
837 837
 		}
838
-		$retour .= '.always(function( dataOrjqXHR, textStatus, jqXHROrerrorThrown ) {' . ($always ?? '') . $this->removeLoader($hasLoader) . '})';
839
-		$retour .= ";\n";
838
+		$retour.='.always(function( dataOrjqXHR, textStatus, jqXHROrerrorThrown ) {'.($always ?? '').$this->removeLoader($hasLoader).'})';
839
+		$retour.=";\n";
840 840
 		if ($validation) {
841
-			$retour = "$('#'+" . $form . ").validate({submitHandler: function(form) {
842
-			" . $retour . "
841
+			$retour="$('#'+".$form.").validate({submitHandler: function(form) {
842
+			" . $retour."
843 843
 			}});\n";
844
-			$retour .= "$('#'+" . $form . ").submit();\n";
844
+			$retour.="$('#'+".$form.").submit();\n";
845 845
 		}
846
-		$retour = $this->_addJsCondition($jsCondition, $retour);
846
+		$retour=$this->_addJsCondition($jsCondition, $retour);
847 847
 		if ($immediatly)
848
-			$this->jquery_code_for_compile[] = $retour;
848
+			$this->jquery_code_for_compile[]=$retour;
849 849
 		return $retour;
850 850
 	}
851 851
 
@@ -861,8 +861,8 @@  discard block
 block discarded – undo
861 861
 	 * @param array $parameters
862 862
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
863 863
 	 */
864
-	public function postForm($url, $form, $responseElement, $parameters = []) {
865
-		$parameters['immediatly'] = true;
864
+	public function postForm($url, $form, $responseElement, $parameters=[]) {
865
+		$parameters['immediatly']=true;
866 866
 		return $this->_postForm($url, $form, $responseElement, $parameters);
867 867
 	}
868 868
 
@@ -879,8 +879,8 @@  discard block
 block discarded – undo
879 879
 	 * @param array $parameters
880 880
 	 *        	default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
881 881
 	 */
882
-	public function postFormDeferred($url, $form, $responseElement, $parameters = []) {
883
-		$parameters['immediatly'] = false;
882
+	public function postFormDeferred($url, $form, $responseElement, $parameters=[]) {
883
+		$parameters['immediatly']=false;
884 884
 		return $this->_postForm($url, $form, $responseElement, $parameters);
885 885
 	}
886 886
 
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 	 * @param array $parameters
898 898
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)
899 899
 	 */
900
-	public function postFormOn($event, $element, $url, $form, $responseElement = "", $parameters = array()) {
900
+	public function postFormOn($event, $element, $url, $form, $responseElement="", $parameters=array()) {
901 901
 		$this->setDefaultParameters($parameters, [
902 902
 			'preventDefault' => true,
903 903
 			'stopPropagation' => true,
@@ -919,11 +919,11 @@  discard block
 block discarded – undo
919 919
 	 * @param array $parameters
920 920
 	 *        	default : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)
921 921
 	 */
922
-	public function postFormOnClick($element, $url, $form, $responseElement = "", $parameters = array()) {
922
+	public function postFormOnClick($element, $url, $form, $responseElement="", $parameters=array()) {
923 923
 		return $this->postFormOn("click", $element, $url, $form, $responseElement, $parameters);
924 924
 	}
925 925
 
926
-	public function addCsrf($name = 'csrf-token') {
926
+	public function addCsrf($name='csrf-token') {
927 927
 		return "
928 928
 		$.ajaxSetup({
929 929
 			beforeSend: function(xhr, settings) {
Please login to merge, or discard this patch.