Completed
Push — master ( da7bd7...a4feba )
by Jean-Christophe
03:22
created
Ajax/semantic/html/collections/table/HtmlTable.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
 
29 29
 	public function __construct($identifier, $rowCount, $colCount) {
30 30
 		parent::__construct($identifier, "table", "ui table");
31
-		$this->content=array ();
31
+		$this->content=array();
32 32
 		$this->setRowCount($rowCount, $colCount);
33
-		$this->_variations=[ Variation::CELLED,Variation::PADDED,Variation::COMPACT ];
34
-		$this->_compileParts=["thead","tbody","tfoot"];
33
+		$this->_variations=[Variation::CELLED, Variation::PADDED, Variation::COMPACT];
34
+		$this->_compileParts=["thead", "tbody", "tfoot"];
35 35
 		$this->_afterCompileEvents=[];
36 36
 	}
37 37
 
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 	 * @return HtmlTableContent
50 50
 	 */
51 51
 	public function getPart($key) {
52
-		if (\array_key_exists($key, $this->content) === false) {
52
+		if (\array_key_exists($key, $this->content)===false) {
53 53
 			$this->content[$key]=new HtmlTableContent("", $key);
54
-			if ($key !== "tbody") {
54
+			if ($key!=="tbody") {
55 55
 				$this->content[$key]->setRowCount(1, $this->_colCount);
56 56
 			}
57 57
 		}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 * @return boolean
97 97
 	 */
98 98
 	public function hasPart($key) {
99
-		return \array_key_exists($key, $this->content) === true;
99
+		return \array_key_exists($key, $this->content)===true;
100 100
 	}
101 101
 
102 102
 	/**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
 	private function colAlign($colIndex, $function) {
203 203
 		if (\is_array($colIndex)) {
204
-			foreach ( $colIndex as $cIndex ) {
204
+			foreach ($colIndex as $cIndex) {
205 205
 				$this->colAlign($cIndex, $function);
206 206
 			}
207 207
 		} else {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
241 241
 	 */
242 242
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
243
-		if(\sizeof($this->_compileParts)<3){
243
+		if (\sizeof($this->_compileParts)<3) {
244 244
 			$this->_template="%content%";
245 245
 			$this->refresh();
246 246
 		}
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
 
251 251
 	protected function compile_once(JsUtils $js=NULL, &$view=NULL) {
252 252
 		if ($this->propertyContains("class", "sortable")) {
253
-			$this->addEvent("execute", "$('#" . $this->identifier . "').tablesort().data('tablesort').sort($('th.default-sort'));");
253
+			$this->addEvent("execute", "$('#".$this->identifier."').tablesort().data('tablesort').sort($('th.default-sort'));");
254 254
 		}
255
-		if(isset($this->_activeClass)){
255
+		if (isset($this->_activeClass)) {
256 256
 			$this->onRow($this->_activeRowEvent, "$(this).toggleClass('".$this->_activeClass."');");
257 257
 		}
258 258
 	}
@@ -266,13 +266,13 @@  discard block
 block discarded – undo
266 266
 	public function fromDatabaseObject($object, $function) {
267 267
 		$result=$function($object);
268 268
 		if (\is_array($result)) {
269
-			$result= $this->addRow($function($object));
269
+			$result=$this->addRow($function($object));
270 270
 		} else {
271
-			$result= $this->getBody()->_addRow($result);
271
+			$result=$this->getBody()->_addRow($result);
272 272
 		}
273
-		if(isset($this->_afterCompileEvents["onNewRow"])){
274
-			if(\is_callable($this->_afterCompileEvents["onNewRow"]))
275
-				$this->_afterCompileEvents["onNewRow"]($result,$object);
273
+		if (isset($this->_afterCompileEvents["onNewRow"])) {
274
+			if (\is_callable($this->_afterCompileEvents["onNewRow"]))
275
+				$this->_afterCompileEvents["onNewRow"]($result, $object);
276 276
 		}
277 277
 		return $result;
278 278
 	}
@@ -286,14 +286,14 @@  discard block
 block discarded – undo
286 286
 		return $this;
287 287
 	}
288 288
 
289
-	public function refresh(){
289
+	public function refresh() {
290 290
 		$this->_footer=$this->getFooter();
291 291
 		$this->addEvent("execute", '$("#'.$this->identifier.' tfoot").replaceWith("'.\addslashes($this->_footer).'");');
292 292
 	}
293 293
 
294
-	public function run(JsUtils $js){
295
-		$result= parent::run($js);
296
-		if(isset($this->_footer))
294
+	public function run(JsUtils $js) {
295
+		$result=parent::run($js);
296
+		if (isset($this->_footer))
297 297
 			$this->_footer->run($js);
298 298
 		return $result;
299 299
 	}
Please login to merge, or discard this patch.