Completed
Push — master ( aa1d0c...064b6c )
by Jean-Christophe
04:19
created
Ajax/semantic/html/collections/table/HtmlTable.php 4 patches
Doc Comments   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,6 +23,10 @@  discard block
 block discarded – undo
23 23
 	private $_footer;
24 24
 	private $_afterCompileEvents;
25 25
 
26
+	/**
27
+	 * @param integer $rowCount
28
+	 * @param integer $colCount
29
+	 */
26 30
 	public function __construct($identifier, $rowCount, $colCount) {
27 31
 		parent::__construct($identifier, "table", "ui table");
28 32
 		$this->content=array ();
@@ -112,7 +116,7 @@  discard block
 block discarded – undo
112 116
 	/**
113 117
 	 * Retuns the row at $rowIndex
114 118
 	 * @param int $rowIndex
115
-	 * @return \Ajax\semantic\html\content\HtmlTR
119
+	 * @return \Ajax\common\html\HtmlDoubleElement
116 120
 	 */
117 121
 	public function getRow($rowIndex) {
118 122
 		return $this->getBody()->getRow($rowIndex);
@@ -154,7 +158,7 @@  discard block
 block discarded – undo
154 158
 	 * Sets values to the col at index $colIndex
155 159
 	 * @param int $colIndex
156 160
 	 * @param array $values
157
-	 * @return \Ajax\semantic\html\collections\HtmlTable
161
+	 * @return HtmlTable
158 162
 	 */
159 163
 	public function setColValues($colIndex, $values=array()) {
160 164
 		$this->getBody()->setColValues($colIndex, $values);
@@ -165,7 +169,7 @@  discard block
 block discarded – undo
165 169
 	 * Sets values to the row at index $rowIndex
166 170
 	 * @param int $rowIndex
167 171
 	 * @param array $values
168
-	 * @return \Ajax\semantic\html\collections\HtmlTable
172
+	 * @return HtmlTable
169 173
 	 */
170 174
 	public function setRowValues($rowIndex, $values=array()) {
171 175
 		$this->getBody()->setRowValues($rowIndex, $values);
@@ -188,6 +192,9 @@  discard block
 block discarded – undo
188 192
 		return $this->colAlign($colIndex, "colLeft");
189 193
 	}
190 194
 
195
+	/**
196
+	 * @param string $function
197
+	 */
191 198
 	private function colAlign($colIndex, $function) {
192 199
 		if (\is_array($colIndex)) {
193 200
 			foreach ( $colIndex as $cIndex ) {
@@ -263,7 +270,7 @@  discard block
 block discarded – undo
263 270
 
264 271
 	/**
265 272
 	 * @param array $parts
266
-	 * @return \Ajax\semantic\html\collections\HtmlTable
273
+	 * @return HtmlTable
267 274
 	 */
268 275
 	public function setCompileParts($parts=["tbody"]) {
269 276
 		$this->_compileParts=$parts;
@@ -286,7 +293,7 @@  discard block
 block discarded – undo
286 293
 	 * The callback function called after the insertion of each row when fromDatabaseObjects is called
287 294
 	 * callback function takes the parameters $row : the row inserted and $object: the instance of model used
288 295
 	 * @param callable $callback
289
-	 * @return \Ajax\semantic\html\collections\HtmlTable
296
+	 * @return HtmlTable
290 297
 	 */
291 298
 	public function onNewRow($callback) {
292 299
 		$this->_afterCompileEvents["onNewRow"]=$callback;
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Ajax\semantic\html\base\HtmlSemDoubleElement;
6 6
 use Ajax\JsUtils;
7 7
 use Ajax\service\JArray;
8
-
9 8
 use Ajax\semantic\html\base\constants\State;
10 9
 
11 10
 class HtmlProgress extends HtmlSemDoubleElement {
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 
26 26
 	public function __construct($identifier, $rowCount, $colCount) {
27 27
 		parent::__construct($identifier, "table", "ui table");
28
-		$this->content=array ();
28
+		$this->content=array();
29 29
 		$this->setRowCount($rowCount, $colCount);
30
-		$this->_variations=[ Variation::CELLED,Variation::PADDED,Variation::COMPACT ];
31
-		$this->_compileParts=["thead","tbody","tfoot"];
30
+		$this->_variations=[Variation::CELLED, Variation::PADDED, Variation::COMPACT];
31
+		$this->_compileParts=["thead", "tbody", "tfoot"];
32 32
 		$this->_afterCompileEvents=[];
33 33
 	}
34 34
 
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 	 * @return HtmlTableContent
47 47
 	 */
48 48
 	public function getPart($key) {
49
-		if (\array_key_exists($key, $this->content) === false) {
49
+		if (\array_key_exists($key, $this->content)===false) {
50 50
 			$this->content[$key]=new HtmlTableContent("", $key);
51
-			if ($key !== "tbody") {
51
+			if ($key!=="tbody") {
52 52
 				$this->content[$key]->setRowCount(1, $this->_colCount);
53 53
 			}
54 54
 		}
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 * @return boolean
86 86
 	 */
87 87
 	public function hasPart($key) {
88
-		return \array_key_exists($key, $this->content) === true;
88
+		return \array_key_exists($key, $this->content)===true;
89 89
 	}
90 90
 
91 91
 	/**
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
 	private function colAlign($colIndex, $function) {
192 192
 		if (\is_array($colIndex)) {
193
-			foreach ( $colIndex as $cIndex ) {
193
+			foreach ($colIndex as $cIndex) {
194 194
 				$this->colAlign($cIndex, $function);
195 195
 			}
196 196
 		} else {
@@ -229,12 +229,12 @@  discard block
 block discarded – undo
229 229
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
230 230
 	 */
231 231
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
232
-		if(\sizeof($this->_compileParts)<3){
232
+		if (\sizeof($this->_compileParts)<3) {
233 233
 			$this->_template="%content%";
234 234
 			$this->refresh();
235
-		}else{
235
+		} else {
236 236
 			if ($this->propertyContains("class", "sortable")) {
237
-				$this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();");
237
+				$this->addEvent("execute", "$('#".$this->identifier."').tablesort();");
238 238
 			}
239 239
 		}
240 240
 		$this->content=JArray::sortAssociative($this->content, $this->_compileParts);
@@ -250,13 +250,13 @@  discard block
 block discarded – undo
250 250
 	public function fromDatabaseObject($object, $function) {
251 251
 		$result=$function($object);
252 252
 		if (\is_array($result)) {
253
-			$result= $this->addRow($function($object));
253
+			$result=$this->addRow($function($object));
254 254
 		} else {
255
-			$result= $this->getBody()->_addRow($result);
255
+			$result=$this->getBody()->_addRow($result);
256 256
 		}
257
-		if(isset($this->_afterCompileEvents["onNewRow"])){
258
-			if(\is_callable($this->_afterCompileEvents["onNewRow"]))
259
-				$this->_afterCompileEvents["onNewRow"]($result,$object);
257
+		if (isset($this->_afterCompileEvents["onNewRow"])) {
258
+			if (\is_callable($this->_afterCompileEvents["onNewRow"]))
259
+				$this->_afterCompileEvents["onNewRow"]($result, $object);
260 260
 		}
261 261
 		return $result;
262 262
 	}
@@ -270,14 +270,14 @@  discard block
 block discarded – undo
270 270
 		return $this;
271 271
 	}
272 272
 
273
-	public function refresh(){
273
+	public function refresh() {
274 274
 		$this->_footer=$this->getFooter();
275 275
 		$this->addEvent("execute", '$("#'.$this->identifier.' tfoot").replaceWith("'.\addslashes($this->_footer).'");');
276 276
 	}
277 277
 
278
-	public function run(JsUtils $js){
279
-		$result= parent::run($js);
280
-		if(isset($this->_footer))
278
+	public function run(JsUtils $js) {
279
+		$result=parent::run($js);
280
+		if (isset($this->_footer))
281 281
 			$this->_footer->run($js);
282 282
 		return $result;
283 283
 	}
Please login to merge, or discard this patch.
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		if(\sizeof($this->_compileParts)<3){
233 233
 			$this->_template="%content%";
234 234
 			$this->refresh();
235
-		}else{
235
+		} else{
236 236
 			if ($this->propertyContains("class", "sortable")) {
237 237
 				$this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();");
238 238
 			}
@@ -255,8 +255,9 @@  discard block
 block discarded – undo
255 255
 			$result= $this->getBody()->_addRow($result);
256 256
 		}
257 257
 		if(isset($this->_afterCompileEvents["onNewRow"])){
258
-			if(\is_callable($this->_afterCompileEvents["onNewRow"]))
259
-				$this->_afterCompileEvents["onNewRow"]($result,$object);
258
+			if(\is_callable($this->_afterCompileEvents["onNewRow"])) {
259
+							$this->_afterCompileEvents["onNewRow"]($result,$object);
260
+			}
260 261
 		}
261 262
 		return $result;
262 263
 	}
@@ -277,8 +278,9 @@  discard block
 block discarded – undo
277 278
 
278 279
 	public function run(JsUtils $js){
279 280
 		$result= parent::run($js);
280
-		if(isset($this->_footer))
281
-			$this->_footer->run($js);
281
+		if(isset($this->_footer)) {
282
+					$this->_footer->run($js);
283
+		}
282 284
 		return $result;
283 285
 	}
284 286
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/table/traits/TableTrait.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace Ajax\semantic\html\collections\table\traits;
3 3
 
4
-trait TableTrait{
4
+trait TableTrait {
5 5
 	/**
6 6
 	 * @return HtmlTable
7 7
 	 */
8 8
 	abstract protected function getTable();
9 9
 
10
-	protected function addToPropertyTable($property,$value){
10
+	protected function addToPropertyTable($property, $value) {
11 11
 		return $this->getTable()->addToProperty($property, $value);
12 12
 	}
13 13
 
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 	public function setBasic($very=false) {
19 19
 		$table=$this->getTable();
20 20
 		if ($very)
21
-			$table->addToPropertyCtrl("class", "very", array ("very" ));
22
-		return $table->addToPropertyCtrl("class", "basic", array ("basic" ));
21
+			$table->addToPropertyCtrl("class", "very", array("very"));
22
+		return $table->addToPropertyCtrl("class", "basic", array("basic"));
23 23
 	}
24 24
 
25 25
 	public function setCollapsing() {
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,9 @@
 block discarded – undo
17 17
 
18 18
 	public function setBasic($very=false) {
19 19
 		$table=$this->getTable();
20
-		if ($very)
21
-			$table->addToPropertyCtrl("class", "very", array ("very" ));
20
+		if ($very) {
21
+					$table->addToPropertyCtrl("class", "very", array ("very" ));
22
+		}
22 23
 		return $table->addToPropertyCtrl("class", "basic", array ("basic" ));
23 24
 	}
24 25
 
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/DataTable.php 1 patch
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 	protected $_hasCheckboxes;
31 31
 	protected $_compileParts;
32 32
 
33
-	public function run(JsUtils $js){
34
-		if($this->_hasCheckboxes && isset($js)){
33
+	public function run(JsUtils $js) {
34
+		if ($this->_hasCheckboxes && isset($js)) {
35 35
 			$js->execOn("change", "#".$this->identifier." [name='selection[]']", "
36 36
 		var \$parentCheckbox=\$('#ck-main-ck-{$this->identifier}'),\$checkbox=\$('#{$this->identifier} [name=\"selection[]\"]'),allChecked=true,allUnchecked=true;
37 37
 		\$checkbox.each(function() {if($(this).prop('checked')){allUnchecked = false;}else{allChecked = false;}});
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 		parent::run($js);
41 41
 	}
42 42
 
43
-	public function __construct($identifier,$model,$modelInstance=NULL) {
44
-		parent::__construct($identifier, $model,$modelInstance);
43
+	public function __construct($identifier, $model, $modelInstance=NULL) {
44
+		parent::__construct($identifier, $model, $modelInstance);
45 45
 		$this->_instanceViewer=new InstanceViewer($identifier);
46
-		$this->content=["table"=>new HtmlTable($identifier, 0,0)];
46
+		$this->content=["table"=>new HtmlTable($identifier, 0, 0)];
47 47
 		$this->_toolbarPosition=PositionInTable::BEFORETABLE;
48 48
 	}
49 49
 
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 
59
-	public function compile(JsUtils $js=NULL,&$view=NULL){
59
+	public function compile(JsUtils $js=NULL, &$view=NULL) {
60 60
 		$this->_instanceViewer->setInstance($this->_model);
61 61
 		$captions=$this->_instanceViewer->getCaptions();
62 62
 
63 63
 		$table=$this->content["table"];
64 64
 
65
-		if($this->_hasCheckboxes){
66
-			$ck=new HtmlCheckbox("main-ck-".$this->identifier,"");
65
+		if ($this->_hasCheckboxes) {
66
+			$ck=new HtmlCheckbox("main-ck-".$this->identifier, "");
67 67
 			$ck->setOnChecked("$('#".$this->identifier." [name=%quote%selection[]%quote%]').prop('checked',true);");
68 68
 			$ck->setOnUnchecked("$('#".$this->identifier." [name=%quote%selection[]%quote%]').prop('checked',false);");
69 69
 			\array_unshift($captions, $ck);
@@ -71,44 +71,44 @@  discard block
 block discarded – undo
71 71
 
72 72
 		$table->setRowCount(0, \sizeof($captions));
73 73
 		$table->setHeaderValues($captions);
74
-		if(isset($this->_compileParts))
74
+		if (isset($this->_compileParts))
75 75
 			$table->setCompileParts($this->_compileParts);
76
-		if(isset($this->_searchField)){
77
-			if(isset($js))
78
-				$this->_searchField->postOn("change", $this->_urls,"{'s':$(this).val()}","-#".$this->identifier." tbody",["preventDefault"=>false]);
76
+		if (isset($this->_searchField)) {
77
+			if (isset($js))
78
+				$this->_searchField->postOn("change", $this->_urls, "{'s':$(this).val()}", "-#".$this->identifier." tbody", ["preventDefault"=>false]);
79 79
 		}
80 80
 
81 81
 		$this->_generateContent($table);
82 82
 
83
-		if($this->_hasCheckboxes){
84
-			if($table->hasPart("thead"))
85
-				$table->getHeader()->getCell(0, 0)->addToProperty("class","no-sort");
83
+		if ($this->_hasCheckboxes) {
84
+			if ($table->hasPart("thead"))
85
+				$table->getHeader()->getCell(0, 0)->addToProperty("class", "no-sort");
86 86
 		}
87 87
 
88
-		if(isset($this->_pagination) && $this->_pagination->getVisible()){
88
+		if (isset($this->_pagination) && $this->_pagination->getVisible()) {
89 89
 			$this->_generatePagination($table);
90 90
 		}
91
-		if(isset($this->_toolbar)){
91
+		if (isset($this->_toolbar)) {
92 92
 			$this->_setToolbarPosition($table, $captions);
93 93
 		}
94
-		$this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE,"table",PositionInTable::AFTERTABLE]);
95
-		return parent::compile($js,$view);
94
+		$this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE, "table", PositionInTable::AFTERTABLE]);
95
+		return parent::compile($js, $view);
96 96
 	}
97 97
 
98
-	protected function _generateContent($table){
98
+	protected function _generateContent($table) {
99 99
 		$objects=$this->_modelInstance;
100
-		if(isset($this->_pagination)){
100
+		if (isset($this->_pagination)) {
101 101
 			$objects=$this->_pagination->getObjects($this->_modelInstance);
102 102
 		}
103 103
 		InstanceViewer::setIndex(0);
104
-		$table->fromDatabaseObjects($objects, function($instance){
104
+		$table->fromDatabaseObjects($objects, function($instance) {
105 105
 			$this->_instanceViewer->setInstance($instance);
106 106
 			InstanceViewer::$index++;
107
-			$result= $this->_instanceViewer->getValues();
108
-			if($this->_hasCheckboxes){
109
-				$ck=new HtmlCheckbox("ck-".$this->identifier,"");
107
+			$result=$this->_instanceViewer->getValues();
108
+			if ($this->_hasCheckboxes) {
109
+				$ck=new HtmlCheckbox("ck-".$this->identifier, "");
110 110
 				$field=$ck->getField();
111
-				$field->setProperty("value",$this->_instanceViewer->getIdentifier());
111
+				$field->setProperty("value", $this->_instanceViewer->getIdentifier());
112 112
 				$field->setProperty("name", "selection[]");
113 113
 				\array_unshift($result, $ck);
114 114
 			}
@@ -116,25 +116,25 @@  discard block
 block discarded – undo
116 116
 		});
117 117
 	}
118 118
 
119
-	private function _generatePagination($table){
119
+	private function _generatePagination($table) {
120 120
 		$footer=$table->getFooter();
121 121
 		$footer->mergeCol();
122
-		$menu=new HtmlPaginationMenu("pagination-".$this->identifier,$this->_pagination->getPagesNumbers());
122
+		$menu=new HtmlPaginationMenu("pagination-".$this->identifier, $this->_pagination->getPagesNumbers());
123 123
 		$menu->floatRight();
124 124
 		$menu->setActiveItem($this->_pagination->getPage()-1);
125 125
 		$footer->setValues($menu);
126
-		$menu->postOnClick($this->_urls,"{'p':$(this).attr('data-page')}","-#".$this->identifier." tbody",["preventDefault"=>false]);
126
+		$menu->postOnClick($this->_urls, "{'p':$(this).attr('data-page')}", "-#".$this->identifier." tbody", ["preventDefault"=>false]);
127 127
 	}
128 128
 
129
-	protected function _setToolbarPosition($table,$captions=NULL){
130
-		switch ($this->_toolbarPosition){
129
+	protected function _setToolbarPosition($table, $captions=NULL) {
130
+		switch ($this->_toolbarPosition) {
131 131
 			case PositionInTable::BEFORETABLE:case PositionInTable::AFTERTABLE:
132
-				if(isset($this->_compileParts)===false){
132
+				if (isset($this->_compileParts)===false) {
133 133
 					$this->content[$this->_toolbarPosition]=$this->_toolbar;
134 134
 				}
135 135
 				break;
136 136
 			case PositionInTable::HEADER:case PositionInTable::FOOTER: case PositionInTable::BODY:
137
-				$this->addToolbarRow($this->_toolbarPosition,$table, $captions);
137
+				$this->addToolbarRow($this->_toolbarPosition, $table, $captions);
138 138
 				break;
139 139
 		}
140 140
 	}
@@ -146,18 +146,18 @@  discard block
 block discarded – undo
146 146
 	 * @param callable $callback function called after the field compilation
147 147
 	 * @return \Ajax\semantic\widgets\datatable\DataTable
148 148
 	 */
149
-	public function afterCompile($index,$callback){
150
-		$this->_instanceViewer->afterCompile($index,$callback);
149
+	public function afterCompile($index, $callback) {
150
+		$this->_instanceViewer->afterCompile($index, $callback);
151 151
 		return $this;
152 152
 	}
153 153
 
154
-	private function addToolbarRow($part,$table,$captions){
154
+	private function addToolbarRow($part, $table, $captions) {
155 155
 		$row=$table->getPart($part)->addRow(\sizeof($captions));
156 156
 		$row->mergeCol();
157 157
 		$row->setValues([$this->_toolbar]);
158 158
 	}
159 159
 
160
-	public function getHtmlComponent(){
160
+	public function getHtmlComponent() {
161 161
 		return $this->content["table"];
162 162
 	}
163 163
 
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 		return $this;
171 171
 	}
172 172
 
173
-	public function paginate($items_per_page=10,$page=1){
174
-		$this->_pagination=new Pagination($items_per_page,4,$page);
173
+	public function paginate($items_per_page=10, $page=1) {
174
+		$this->_pagination=new Pagination($items_per_page, 4, $page);
175 175
 	}
176 176
 
177 177
 	public function getHasCheckboxes() {
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		return $this;
184 184
 	}
185 185
 
186
-	public function refresh($compileParts=["tbody"]){
186
+	public function refresh($compileParts=["tbody"]) {
187 187
 		$this->_compileParts=$compileParts;
188 188
 		return $this;
189 189
 	}
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
 	 * @param callable $callback
193 193
 	 * @return callable
194 194
 	 */
195
-	private function getFieldButtonCallable($caption,$callback=null){
196
-		return $this->getCallable("getFieldButton",[$caption],$callback);
195
+	private function getFieldButtonCallable($caption, $callback=null) {
196
+		return $this->getCallable("getFieldButton", [$caption], $callback);
197 197
 	}
198 198
 
199 199
 	/**
@@ -201,16 +201,16 @@  discard block
 block discarded – undo
201 201
 	 * @param callable $callback
202 202
 	 * @return callable
203 203
 	 */
204
-	private function getCallable($thisCallback,$parameters,$callback=null){
205
-		$result=function($instance) use($thisCallback,$parameters,$callback){
206
-			$object=call_user_func_array(array($this,$thisCallback), $parameters);
207
-			if(isset($callback)){
208
-				if(\is_callable($callback)){
209
-					$callback($object,$instance);
204
+	private function getCallable($thisCallback, $parameters, $callback=null) {
205
+		$result=function($instance) use($thisCallback, $parameters, $callback){
206
+			$object=call_user_func_array(array($this, $thisCallback), $parameters);
207
+			if (isset($callback)) {
208
+				if (\is_callable($callback)) {
209
+					$callback($object, $instance);
210 210
 				}
211 211
 			}
212
-			if($object instanceof HtmlSemDoubleElement){
213
-				$object->setProperty("data-ajax",$this->_instanceViewer->getIdentifier());
212
+			if ($object instanceof HtmlSemDoubleElement) {
213
+				$object->setProperty("data-ajax", $this->_instanceViewer->getIdentifier());
214 214
 			}
215 215
 			return $object;
216 216
 		};
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 	 * @param string $caption
222 222
 	 * @return HtmlButton
223 223
 	 */
224
-	private function getFieldButton($caption){
225
-		return new HtmlButton("",$caption);
224
+	private function getFieldButton($caption) {
225
+		return new HtmlButton("", $caption);
226 226
 	}
227 227
 
228 228
 	/**
@@ -231,8 +231,8 @@  discard block
 block discarded – undo
231 231
 	 * @param callable $callback
232 232
 	 * @return \Ajax\semantic\widgets\datatable\DataTable
233 233
 	 */
234
-	public function addFieldButton($caption,$callback=null){
235
-		$this->addField($this->getCallable("getFieldButton",[$caption],$callback));
234
+	public function addFieldButton($caption, $callback=null) {
235
+		$this->addField($this->getCallable("getFieldButton", [$caption], $callback));
236 236
 		return $this;
237 237
 	}
238 238
 
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
 	 * @param callable $callback
244 244
 	 * @return \Ajax\semantic\widgets\datatable\DataTable
245 245
 	 */
246
-	public function insertFieldButton($index,$caption,$callback=null){
247
-		$this->insertField($index, $this->getFieldButtonCallable($caption,$callback));
246
+	public function insertFieldButton($index, $caption, $callback=null) {
247
+		$this->insertField($index, $this->getFieldButtonCallable($caption, $callback));
248 248
 		return $this;
249 249
 	}
250 250
 
@@ -255,60 +255,60 @@  discard block
 block discarded – undo
255 255
 	 * @param callable $callback
256 256
 	 * @return \Ajax\semantic\widgets\datatable\DataTable
257 257
 	 */
258
-	public function insertInFieldButton($index,$caption,$callback=null){
259
-		$this->insertInField($index, $this->getFieldButtonCallable($caption,$callback));
258
+	public function insertInFieldButton($index, $caption, $callback=null) {
259
+		$this->insertInField($index, $this->getFieldButtonCallable($caption, $callback));
260 260
 		return $this;
261 261
 	}
262 262
 
263
-	private function addDefaultButton($icon,$class=null,$callback=null){
264
-		$this->addField($this->getCallable("getDefaultButton",[$icon,$class],$callback));
263
+	private function addDefaultButton($icon, $class=null, $callback=null) {
264
+		$this->addField($this->getCallable("getDefaultButton", [$icon, $class], $callback));
265 265
 		return $this;
266 266
 	}
267 267
 
268
-	private function insertDefaultButtonIn($index,$icon,$class=null,$callback=null){
269
-		$this->insertInField($index,$this->getCallable("getDefaultButton",[$icon,$class],$callback));
268
+	private function insertDefaultButtonIn($index, $icon, $class=null, $callback=null) {
269
+		$this->insertInField($index, $this->getCallable("getDefaultButton", [$icon, $class], $callback));
270 270
 		return $this;
271 271
 	}
272 272
 
273
-	private function getDefaultButton($icon,$class=null){
273
+	private function getDefaultButton($icon, $class=null) {
274 274
 		$bt=$this->getFieldButton("");
275 275
 		$bt->asIcon($icon);
276
-		if(isset($class))
276
+		if (isset($class))
277 277
 			$bt->addToProperty("class", $class);
278 278
 		return $bt;
279 279
 	}
280 280
 
281
-	public function addDeleteButton($callback=null){
282
-		return $this->addDefaultButton("remove","delete red basic",$callback);
281
+	public function addDeleteButton($callback=null) {
282
+		return $this->addDefaultButton("remove", "delete red basic", $callback);
283 283
 	}
284 284
 
285
-	public function addEditButton($callback=null){
286
-		return $this->addDefaultButton("edit","edit basic",$callback);
285
+	public function addEditButton($callback=null) {
286
+		return $this->addDefaultButton("edit", "edit basic", $callback);
287 287
 	}
288 288
 
289
-	public function addEditDeleteButtons($callbackEdit=null,$callbackDelete=null){
289
+	public function addEditDeleteButtons($callbackEdit=null, $callbackDelete=null) {
290 290
 		$this->addEditButton($callbackEdit);
291 291
 		$index=$this->_instanceViewer->visiblePropertiesCount()-1;
292
-		$this->insertDeleteButtonIn($index,$callbackDelete);
292
+		$this->insertDeleteButtonIn($index, $callbackDelete);
293 293
 		return $this;
294 294
 	}
295 295
 
296
-	public function insertDeleteButtonIn($index,$callback=null){
297
-		return $this->insertDefaultButtonIn($index,"remove","delete red basic",$callback);
296
+	public function insertDeleteButtonIn($index, $callback=null) {
297
+		return $this->insertDefaultButtonIn($index, "remove", "delete red basic", $callback);
298 298
 	}
299 299
 
300
-	public function insertEditButtonIn($index,$callback=null){
301
-		return $this->insertDefaultButtonIn($index,"edit","edit basic",$callback);
300
+	public function insertEditButtonIn($index, $callback=null) {
301
+		return $this->insertDefaultButtonIn($index, "edit", "edit basic", $callback);
302 302
 	}
303 303
 
304
-	public function addSearchInToolbar($position=Direction::RIGHT){
304
+	public function addSearchInToolbar($position=Direction::RIGHT) {
305 305
 		return $this->addInToolbar($this->getSearchField())->setPosition($position);
306 306
 	}
307 307
 
308
-	public function getSearchField(){
309
-		if(isset($this->_searchField)===false){
310
-			$this->_searchField=new HtmlInput("search-".$this->identifier,"search","","Search...");
311
-			$this->_searchField->addIcon("search",Direction::RIGHT);
308
+	public function getSearchField() {
309
+		if (isset($this->_searchField)===false) {
310
+			$this->_searchField=new HtmlInput("search-".$this->identifier, "search", "", "Search...");
311
+			$this->_searchField->addIcon("search", Direction::RIGHT);
312 312
 		}
313 313
 		return $this->_searchField;
314 314
 	}
Please login to merge, or discard this patch.