Completed
Push — master ( 064b6c...19a73f )
by Jean-Christophe
03:22
created
Ajax/semantic/html/collections/HtmlMessage.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,10 +62,11 @@  discard block
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	public function setDismissable($dismiss=true){
65
-		if($dismiss===true)
66
-			$this->close=new HtmlIcon("close-".$this->identifier, "close");
67
-		else
68
-			$this->close=NULL;
65
+		if($dismiss===true) {
66
+					$this->close=new HtmlIcon("close-".$this->identifier, "close");
67
+		} else {
68
+					$this->close=NULL;
69
+		}
69 70
 		return $this;
70 71
 	}
71 72
 
@@ -100,7 +101,8 @@  discard block
 block discarded – undo
100 101
 	public function setMessage($message){
101 102
 		if(\is_array($this->content)){
102 103
 			$this->content[\sizeof($this->content)-1]=$message;
103
-		}else
104
-			$this->setContent($message);
104
+		} else {
105
+					$this->setContent($message);
106
+		}
105 107
 	}
106 108
 }
107 109
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlForm.php 1 patch
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -52,8 +52,9 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function addHeader($title, $niveau=1, $dividing=true) {
54 54
 		$header=new HtmlHeader("", $niveau, $title);
55
-		if ($dividing)
56
-			$header->setDividing();
55
+		if ($dividing) {
56
+					$header->setDividing();
57
+		}
57 58
 		return $this->addItem($header);
58 59
 	}
59 60
 
@@ -74,14 +75,16 @@  discard block
 block discarded – undo
74 75
 					if (\is_string($end)) {
75 76
 						$label=$end;
76 77
 						\array_pop($fields);
77
-					} else
78
-						$label=NULL;
78
+					} else {
79
+											$label=NULL;
80
+					}
79 81
 				}
80 82
 				$this->_fields=\array_merge($this->_fields, $fields);
81 83
 				$fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count(), $fields);
82 84
 			}
83
-			if (isset($label))
84
-				$fields=new HtmlFormField("", $fields, $label);
85
+			if (isset($label)) {
86
+							$fields=new HtmlFormField("", $fields, $label);
87
+			}
85 88
 		} else {
86 89
 			$fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count());
87 90
 		}
@@ -134,12 +137,15 @@  discard block
 block discarded – undo
134 137
 	 */
135 138
 	public function addMessage($identifier, $content, $header=NULL, $icon=NULL, $type=NULL) {
136 139
 		$message=new HtmlMessage($identifier, $content);
137
-		if (isset($header))
138
-			$message->addHeader($header);
139
-		if (isset($icon))
140
-			$message->setIcon($icon);
141
-		if (isset($type))
142
-			$message->setStyle($type);
140
+		if (isset($header)) {
141
+					$message->addHeader($header);
142
+		}
143
+		if (isset($icon)) {
144
+					$message->setIcon($icon);
145
+		}
146
+		if (isset($type)) {
147
+					$message->setStyle($type);
148
+		}
143 149
 		return $this->addItem($message);
144 150
 	}
145 151
 
@@ -156,23 +162,26 @@  discard block
 block discarded – undo
156 162
 	}
157 163
 
158 164
 	public function compile(JsUtils $js=NULL,&$view=NULL){
159
-		if(\sizeof($this->_validationParams)>0)
160
-			$this->setProperty("novalidate", "");
165
+		if(\sizeof($this->_validationParams)>0) {
166
+					$this->setProperty("novalidate", "");
167
+		}
161 168
 		return parent::compile($js,$view);
162 169
 	}
163 170
 
164 171
 	public function run(JsUtils $js) {
165 172
 		$compo=NULL;
166 173
 		foreach ($this->_fields as $field){
167
-			if($field instanceof HtmlFormField)
168
-				$compo=$this->addCompoValidation($js, $compo, $field);
174
+			if($field instanceof HtmlFormField) {
175
+							$compo=$this->addCompoValidation($js, $compo, $field);
176
+			}
169 177
 		}
170 178
 		foreach ($this->content as $field){
171 179
 			if($field instanceof HtmlFormFields){
172 180
 				$items=$field->getItems();
173 181
 				foreach ($items as $_field){
174
-					if($_field instanceof HtmlFormField)
175
-						$compo=$this->addCompoValidation($js, $compo, $_field);
182
+					if($_field instanceof HtmlFormField) {
183
+											$compo=$this->addCompoValidation($js, $compo, $_field);
184
+					}
176 185
 				}
177 186
 			}
178 187
 		}
Please login to merge, or discard this patch.
Ajax/semantic/widgets/dataform/FormFieldAsTrait.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@
 block discarded – undo
47 47
 			$rules=$attributes["rules"];
48 48
 			if(\is_array($rules)){
49 49
 				$element->addRules($rules);
50
+			} else {
51
+							$element->addRule($rules);
50 52
 			}
51
-			else
52
-				$element->addRule($rules);
53 53
 			unset($attributes["rules"]);
54 54
 		}
55 55
 	}
Please login to merge, or discard this patch.
Ajax/semantic/widgets/base/FieldAsTrait.php 1 patch
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@  discard block
 block discarded – undo
35 35
 				$name=$attributes["name"];
36 36
 			}
37 37
 			$element=$elementCallback($this->_getFieldIdentifier($prefix),$name,$value,"");
38
-			if(\is_array($attributes))
39
-				$this->_applyAttributes($element, $attributes,$index);
38
+			if(\is_array($attributes)) {
39
+							$this->_applyAttributes($element, $attributes,$index);
40
+			}
40 41
 			return $element;
41 42
 		});
42 43
 			return $this;
@@ -70,8 +71,9 @@  discard block
 block discarded – undo
70 71
 	public function fieldAsHeader($index,$niveau=1,$icon=NULL,$attributes=NULL){
71 72
 		return $this->_fieldAs(function($id,$name,$value) use($niveau,$icon){
72 73
 			$header=new HtmlHeader($id,$niveau,$value);
73
-			if(isset($icon))
74
-				$header->asIcon($icon, $value);
74
+			if(isset($icon)) {
75
+							$header->asIcon($icon, $value);
76
+			}
75 77
 			return $header;
76 78
 		}, $index,$attributes,"header");
77 79
 	}
@@ -79,7 +81,9 @@  discard block
 block discarded – undo
79 81
 
80 82
 	public function fieldAsImage($index,$size=Size::MINI,$circular=false){
81 83
 		$this->setValueFunction($index,function($img) use($size,$circular){
82
-			$image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular)$image->setCircular();
84
+			$image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular) {
85
+				$image->setCircular();
86
+			}
83 87
 			return $image;
84 88
 		});
85 89
 			return $this;
Please login to merge, or discard this patch.
Ajax/semantic/widgets/base/InstanceViewer.php 1 patch
Braces   +36 added lines, -31 removed lines patch added patch discarded remove patch
@@ -20,8 +20,9 @@  discard block
 block discarded – undo
20 20
 		$this->widgetIdentifier=$identifier;
21 21
 		$this->values=[];
22 22
 		$this->afterCompile=[];
23
-		if(isset($instance))
24
-			$this->setInstance($instance);
23
+		if(isset($instance)) {
24
+					$this->setInstance($instance);
25
+		}
25 26
 		$this->setCaptions($captions);
26 27
 		$this->captionCallback=NULL;
27 28
 	}
@@ -38,8 +39,9 @@  discard block
 block discarded – undo
38 39
 
39 40
 	public function getIdentifier(){
40 41
 		$value=self::$index;
41
-		if(isset($this->values["identifier"]))
42
-			$value=$this->values["identifier"](self::$index,$this->instance);
42
+		if(isset($this->values["identifier"])) {
43
+					$value=$this->values["identifier"](self::$index,$this->instance);
44
+		}
43 45
 		return $value;
44 46
 	}
45 47
 
@@ -62,19 +64,19 @@  discard block
 block discarded – undo
62 64
 			$value=$property->getValue($this->instance);
63 65
 			if(isset($this->values[$index])){
64 66
 				$value= $this->values[$index]($value,$this->instance,$index);
65
-			}else{
67
+			} else{
66 68
 				$value=$this->_getDefaultValue($property->getName(),$value, $index);
67 69
 			}
68
-		}else{
69
-			if(\is_callable($property))
70
-				$value=$property($this->instance);
71
-			elseif(\is_array($property)){
70
+		} else{
71
+			if(\is_callable($property)) {
72
+							$value=$property($this->instance);
73
+			} elseif(\is_array($property)){
72 74
 				$values=\array_map(function($v) use ($index){return $this->_getValue($v, $index);}, $property);
73 75
 				$value=\implode("", $values);
74
-			}else{
76
+			} else{
75 77
 				if(isset($this->values[$index])){
76 78
 					$value= $this->values[$index]($property,$this->instance,$index);
77
-				}else{
79
+				} else{
78 80
 					$value=$property;
79 81
 				}
80 82
 			}
@@ -97,10 +99,10 @@  discard block
 block discarded – undo
97 99
 		if(isset($vb[$index])){
98 100
 			if(\is_array($vb[$index])){
99 101
 				$this->visibleProperties[$index][]=$field;
100
-			}else{
102
+			} else{
101 103
 				$this->visibleProperties[$index]=[$vb[$index],$field];
102 104
 			}
103
-		}else{
105
+		} else{
104 106
 			return $this->insertField($index, $field);
105 107
 		}
106 108
 		return $this;
@@ -136,26 +138,27 @@  discard block
 block discarded – undo
136 138
 		$this->reflect=new \ReflectionClass($instance);
137 139
 		if(\sizeof($this->visibleProperties)===0){
138 140
 			$this->properties=$this->getDefaultProperties();
139
-		}else{
141
+		} else{
140 142
 			foreach ($this->visibleProperties as $property){
141 143
 				if(\is_callable($property)){
142 144
 					$this->properties[]=$property;
143
-				}elseif(\is_string($property)){
145
+				} elseif(\is_string($property)){
144 146
 					try{
145 147
 						$this->_beforeAddProperty(\sizeof($this->properties), $property);
146 148
 						$rProperty=$this->reflect->getProperty($property);
147 149
 						$this->properties[]=$rProperty;
148
-					}catch(\Exception $e){
150
+					} catch(\Exception $e){
149 151
 						$this->_beforeAddProperty(\sizeof($this->properties), $property);
150 152
 						$this->properties[]=$property;
151 153
 					}
152
-				}elseif(\is_int($property)){
154
+				} elseif(\is_int($property)){
153 155
 					$props=$this->getDefaultProperties();
154
-					if(isset($props[$property]))
155
-						$this->properties[]=$props[$property];
156
-					else
157
-						$this->properties[]=$property;
158
-				}else{
156
+					if(isset($props[$property])) {
157
+											$this->properties[]=$props[$property];
158
+					} else {
159
+											$this->properties[]=$property;
160
+					}
161
+				} else{
159 162
 					$this->properties[]=$property;
160 163
 				}
161 164
 			}
@@ -202,12 +205,13 @@  discard block
 block discarded – undo
202 205
 		if(isset($this->captions[$index])){
203 206
 			return $this->captions[$index];
204 207
 		}
205
-		if($this->properties[$index] instanceof \ReflectionProperty)
206
-			return $this->properties[$index]->getName();
207
-		elseif(\is_callable($this->properties[$index]))
208
-			return "";
209
-		else
210
-			return $this->properties[$index];
208
+		if($this->properties[$index] instanceof \ReflectionProperty) {
209
+					return $this->properties[$index]->getName();
210
+		} elseif(\is_callable($this->properties[$index])) {
211
+					return "";
212
+		} else {
213
+					return $this->properties[$index];
214
+		}
211 215
 	}
212 216
 
213 217
 	public function getCaptions(){
@@ -216,7 +220,7 @@  discard block
 block discarded – undo
216 220
 			for($i=\sizeof($captions);$i<$this->count();$i++){
217 221
 				$captions[]="";
218 222
 			}
219
-		}else{
223
+		} else{
220 224
 			$captions=[];
221 225
 			$index=0;
222 226
 			$count=$this->count();
@@ -232,8 +236,9 @@  discard block
 block discarded – undo
232 236
 	}
233 237
 
234 238
 	public function setCaption($index,$caption){
235
-		if(isset($this->captions)===false)
236
-			$this->captions=[];
239
+		if(isset($this->captions)===false) {
240
+					$this->captions=[];
241
+		}
237 242
 		$this->captions[$index]=$caption;
238 243
 		return $this;
239 244
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/table/HtmlTable.php 1 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 1 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.