Completed
Push — master ( 0c3815...012895 )
by Jean-Christophe
03:40
created
Ajax/semantic/html/collections/form/HtmlFormFields.php 1 patch
Braces   +12 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,11 +29,14 @@  discard block
 block discarded – undo
29 29
 				if(\is_string($end)){
30 30
 					$label=$end;
31 31
 					\array_pop($fields);
32
-				}else $label=NULL;
32
+				} else {
33
+					$label=NULL;
34
+				}
33 35
 			}
34 36
 		}
35
-		if(isset($label))
36
-			$this->setLabel($label);
37
+		if(isset($label)) {
38
+					$this->setLabel($label);
39
+		}
37 40
 		foreach ($fields as $field){
38 41
 			$this->addItem($field);
39 42
 		}
@@ -61,8 +64,9 @@  discard block
 block discarded – undo
61 64
 		if($this->_equalWidth){
62 65
 			$count=$this->count();
63 66
 			$this->addToProperty("class", Wide::getConstants()["W".$count]." fields");
64
-		}else
65
-			$this->addToProperty("class","fields");
67
+		} else {
68
+					$this->addToProperty("class","fields");
69
+		}
66 70
 		return parent::compile($js,$view);
67 71
 	}
68 72
 
@@ -97,8 +101,9 @@  discard block
 block discarded – undo
97 101
 			$fields[]=new HtmlFormRadio($name."-".$i++,$name,$item,$item);
98 102
 		}
99 103
 		$radios=new HtmlFormFields("fields-".$name,$fields);
100
-		if(isset($label))
101
-			$radios->setLabel($label)->setProperty("for", $name);
104
+		if(isset($label)) {
105
+					$radios->setLabel($label)->setProperty("for", $name);
106
+		}
102 107
 		return $radios;
103 108
 	}
104 109
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlForm.php 1 patch
Braces   +20 added lines, -13 removed lines patch added patch discarded remove patch
@@ -29,8 +29,9 @@  discard block
 block discarded – undo
29 29
 
30 30
 	public function addHeader($title,$niveau=1,$dividing=true){
31 31
 		$header=new HtmlHeader("",$niveau,$title);
32
-		if($dividing)
33
-			$header->setDividing();
32
+		if($dividing) {
33
+					$header->setDividing();
34
+		}
34 35
 		return $this->addItem($header);
35 36
 	}
36 37
 
@@ -43,14 +44,17 @@  discard block
 block discarded – undo
43 44
 					if(\is_string($end)){
44 45
 						$label=$end;
45 46
 						\array_pop($fields);
46
-					}else $label=NULL;
47
+					} else {
48
+						$label=NULL;
49
+					}
47 50
 				}
48 51
 				$this->_fields=\array_merge($this->_fields,$fields);
49 52
 				$fields=new HtmlFormFields("fields-".$this->identifier."-".$this->count(),$fields);
50 53
 			}
51
-			if(isset($label))
52
-			 $fields=new HtmlFormField("", $fields,$label);
53
-		}else{
54
+			if(isset($label)) {
55
+						 $fields=new HtmlFormField("", $fields,$label);
56
+			}
57
+		} else{
54 58
 			$fields=new HtmlFormFields("fields-".$this->identifier."-".$this->count());
55 59
 		}
56 60
 		$this->addItem($fields);
@@ -68,7 +72,7 @@  discard block
 block discarded – undo
68 72
 	public function getField($index){
69 73
 		if(\is_string($index)){
70 74
 			$field=$this->getElementById($index, $this->_fields);
71
-		}else{
75
+		} else{
72 76
 			$field=$this->_fields[$index];
73 77
 		}
74 78
 		return $field;
@@ -101,12 +105,15 @@  discard block
 block discarded – undo
101 105
 	 */
102 106
 	public function addMessage($identifier,$content,$header=NULL,$icon=NULL,$type=NULL){
103 107
 		$message=new HtmlMessage($identifier,$content);
104
-		if(isset($header))
105
-			$message->addHeader($header);
106
-		if(isset($icon))
107
-			$message->setIcon($icon);
108
-		if(isset($type))
109
-			$message->setStyle($type);
108
+		if(isset($header)) {
109
+					$message->addHeader($header);
110
+		}
111
+		if(isset($icon)) {
112
+					$message->setIcon($icon);
113
+		}
114
+		if(isset($type)) {
115
+					$message->setStyle($type);
116
+		}
110 117
 		return $this->addItem($message);
111 118
 	}
112 119
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/FieldsTrait.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,9 @@
 block discarded – undo
13 13
 		if(\is_array($value)){
14 14
 			$itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null)));
15 15
 			return $itemO;
16
-		}else
17
-			return new HtmlFormInput($value);
16
+		} else {
17
+					return new HtmlFormInput($value);
18
+		}
18 19
 	}
19 20
 
20 21
 	public function addInputs($inputs,$fieldslabel=null){
Please login to merge, or discard this patch.
Ajax/semantic/traits/SemanticHtmlElementsTrait.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 			foreach ($icons as $icon=>$size){
37 37
 				$group->addIcon($icon,$size);
38 38
 			}
39
-		}else{
39
+		} else{
40 40
 			foreach ($icons as $icon){
41 41
 				$group->addIcon($icon);
42 42
 			}
Please login to merge, or discard this patch.
Ajax/Jquery.php 1 patch
Braces   +23 added lines, -15 removed lines patch added patch discarded remove patch
@@ -173,10 +173,12 @@  discard block
 block discarded – undo
173 173
 		if (isset($param)) {
174 174
 			$param=$this->_prep_value($param);
175 175
 			$str="$({$element}).{$jQueryCall}({$param});";
176
-		} else
177
-			$str="$({$element}).{$jQueryCall}();";
178
-			if ($immediatly)
179
-				$this->jquery_code_for_compile[]=$str;
176
+		} else {
177
+					$str="$({$element}).{$jQueryCall}();";
178
+		}
179
+			if ($immediatly) {
180
+							$this->jquery_code_for_compile[]=$str;
181
+			}
180 182
 			return $str;
181 183
 	}
182 184
 	/**
@@ -191,8 +193,9 @@  discard block
 block discarded – undo
191 193
 		$to=$this->_prep_element($to);
192 194
 		$element=$this->_prep_element($element);
193 195
 		$str="$({$to}).{$jQueryCall}({$element});";
194
-		if ($immediatly)
195
-			$this->jquery_code_for_compile[]=$str;
196
+		if ($immediatly) {
197
+					$this->jquery_code_for_compile[]=$str;
198
+		}
196 199
 			return $str;
197 200
 	}
198 201
 	// --------------------------------------------------------------------
@@ -260,12 +263,14 @@  discard block
 block discarded – undo
260 263
 		if ($stopPropagation===true) {
261 264
 			$js="event.stopPropagation();\n".$js;
262 265
 		}
263
-		if (array_search($event, $this->jquery_events)===false)
264
-			$event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
265
-		else
266
-			$event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
267
-		if($immediatly)
268
-			$this->jquery_code_for_compile[]=$event;
266
+		if (array_search($event, $this->jquery_events)===false) {
267
+					$event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
268
+		} else {
269
+					$event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
270
+		}
271
+		if($immediatly) {
272
+					$this->jquery_code_for_compile[]=$event;
273
+		}
269 274
 		return $event;
270 275
 	}
271 276
 
@@ -326,8 +331,9 @@  discard block
 block discarded – undo
326 331
 		}
327 332
 		$output=($script_tags===FALSE) ? $script : $this->inline($script);
328 333
 
329
-		if ($view!=NULL)
330
-			$view->setVar($view_var, $output);
334
+		if ($view!=NULL) {
335
+					$view->setVar($view_var, $output);
336
+		}
331 337
 		return $output;
332 338
 	}
333 339
 
@@ -421,7 +427,9 @@  discard block
 block discarded – undo
421 427
 	}
422 428
 
423 429
 	private function minify($input) {
424
-	if(trim($input) === "") return $input;
430
+	if(trim($input) === "") {
431
+		return $input;
432
+	}
425 433
 	return preg_replace(
426 434
 			array(
427 435
 					// Remove comment(s)
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/menus/HtmlMenu.php 1 patch
Braces   +11 added lines, -9 removed lines patch added patch discarded remove patch
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
 			$item=$itemO;
58 58
 		}
59 59
 		$item=parent::addItem($item);
60
-		if(!$item instanceof HtmlMenu)
61
-			$item->addToPropertyCtrl("class", "item",array("item"));
62
-		else{
60
+		if(!$item instanceof HtmlMenu) {
61
+					$item->addToPropertyCtrl("class", "item",array("item"));
62
+		} else{
63 63
 			$this->setSecondary();
64 64
 		}
65 65
 		return $item;
@@ -129,8 +129,9 @@  discard block
 block discarded – undo
129 129
 
130 130
 	public function asTab($vertical=false){
131 131
 		$this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");});
132
-		if($vertical===true)
133
-			$this->setVertical();
132
+		if($vertical===true) {
133
+					$this->setVertical();
134
+		}
134 135
 		return $this->addToProperty("class", "tabular");
135 136
 	}
136 137
 
@@ -156,10 +157,11 @@  discard block
 block discarded – undo
156 157
 	 */
157 158
 	public function fromDatabaseObject($object, $function) {
158 159
 		$return=$function($object);
159
-		if(\is_array($return))
160
-			$this->addItems($return);
161
-		else
162
-		$this->addItem($return);
160
+		if(\is_array($return)) {
161
+					$this->addItems($return);
162
+		} else {
163
+				$this->addItem($return);
164
+		}
163 165
 	}
164 166
 
165 167
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlSticky.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,9 @@
 block discarded – undo
10 10
 
11 11
 	public function __construct($identifier,$context=NULL,$content=NULL) {
12 12
 		parent::__construct($identifier, "div", "ui sticky", $content);
13
-		if(isset($content))
14
-			$this->setContext($context);
13
+		if(isset($content)) {
14
+					$this->setContext($context);
15
+		}
15 16
 	}
16 17
 
17 18
 	public function setContext($context){
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlGrid.php 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -49,8 +49,9 @@  discard block
 block discarded – undo
49 49
 	public function addCol($width=NULL){
50 50
 		$colCount=$this->colCount()+1;
51 51
 		$this->setColsCount($colCount,true,$width);
52
-		if($this->hasOnlyCols($this->count()))
53
-			return $this->content[$colCount-1];
52
+		if($this->hasOnlyCols($this->count())) {
53
+					return $this->content[$colCount-1];
54
+		}
54 55
 		return $this;
55 56
 	}
56 57
 
@@ -73,7 +74,7 @@  discard block
 block discarded – undo
73 74
 			for($i=$count;$i<$colsCount;$i++){
74 75
 				$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i));
75 76
 			}
76
-		}else{
77
+		} else{
77 78
 			if($this->hasOnlyCols($count)){
78 79
 				$tmpContent=$this->content;
79 80
 				$item=$this->addItem($colsCount);
@@ -93,15 +94,16 @@  discard block
 block discarded – undo
93 94
 	}
94 95
 
95 96
 	public function setColsCount($numCols,$toCreate=true,$width=NULL){
96
-		if(isset($width)===false)
97
-			$this->setWide($numCols);
97
+		if(isset($width)===false) {
98
+					$this->setWide($numCols);
99
+		}
98 100
 		if($toCreate==true){
99 101
 			$count=$this->count();
100 102
 			if($count==0 || $this->hasOnlyCols($count)){
101 103
 				for($i=$count;$i<$numCols;$i++){
102 104
 					$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i,$width));
103 105
 				}
104
-			}else{
106
+			} else{
105 107
 				for($i=0;$i<$count;$i++){
106 108
 					$this->getItem($i)->setColsCount($numCols);
107 109
 				}
@@ -121,17 +123,20 @@  discard block
 block discarded – undo
121 123
 
122 124
 	public function rowCount(){
123 125
 		$count=$this->count();
124
-		if($this->hasOnlyCols($count))
125
-			return 0;
126
+		if($this->hasOnlyCols($count)) {
127
+					return 0;
128
+		}
126 129
 		return $count;
127 130
 	}
128 131
 
129 132
 	public function colCount(){
130 133
 		$count=$this->count();
131
-		if($this->hasOnlyCols($count))
132
-			return $count;
133
-		if($count>0)
134
-			return $this->getItem(0)->count();
134
+		if($this->hasOnlyCols($count)) {
135
+					return $count;
136
+		}
137
+		if($count>0) {
138
+					return $this->getItem(0)->count();
139
+		}
135 140
 		return 0;
136 141
 	}
137 142
 
@@ -141,8 +146,9 @@  discard block
 block discarded – undo
141 146
 	 * @return \Ajax\semantic\html\collections\HtmlGridCol
142 147
 	 */
143 148
 	public function getCell($row,$col){
144
-		if($row<2 && $this->hasOnlyCols($this->count()))
145
-			return $this->getItem($col);
149
+		if($row<2 && $this->hasOnlyCols($this->count())) {
150
+					return $this->getItem($col);
151
+		}
146 152
 		$row=$this->getItem($row);
147 153
 		if(isset($row)){
148 154
 			$col=$row->getItem($col);
@@ -191,8 +197,9 @@  discard block
 block discarded – undo
191 197
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
192 198
 	 */
193 199
 	public function setPadded($value=NULL){
194
-		if(isset($value))
195
-			$this->addToPropertyCtrl("class", $value,array("vertically","horizontally"));
200
+		if(isset($value)) {
201
+					$this->addToPropertyCtrl("class", $value,array("vertically","horizontally"));
202
+		}
196 203
 		return $this->addToProperty("class", "padded");
197 204
 	}
198 205
 
@@ -214,8 +221,9 @@  discard block
 block discarded – undo
214 221
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
215 222
 	 */
216 223
 	protected function createItem($value){
217
-		if($this->_createCols===false)
218
-			$value=null;
224
+		if($this->_createCols===false) {
225
+					$value=null;
226
+		}
219 227
 		$item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing,$this->_implicitRows);
220 228
 		return $item;
221 229
 	}
Please login to merge, or discard this patch.