Completed
Push — master ( 7589a7...b8f75a )
by Jean-Christophe
04:21
created
Ajax/semantic/html/collections/form/HtmlFormInput.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,16 +9,18 @@
 block discarded – undo
9 9
 	use TextFieldsTrait;
10 10
 
11 11
 	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
12
-		if(!isset($placeholder) && $type==="text")
13
-			$placeholder=$label;
12
+		if(!isset($placeholder) && $type==="text") {
13
+					$placeholder=$label;
14
+		}
14 15
 		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
15 16
 	}
16 17
 
17 18
 	public function getDataField(){
18 19
 		$field= $this->getField();
19 20
 		//TODO check getField
20
-		if($field instanceof HtmlInput)
21
-			$field=$field->getDataField();
21
+		if($field instanceof HtmlInput) {
22
+					$field=$field->getDataField();
23
+		}
22 24
 		return $field;
23 25
 	}
24 26
 }
25 27
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/TextFieldsTrait.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
 
19 19
 	public function setInputType($type){
20
-		if($type==="hidden")
21
-			$this->addToProperty("style","display:none;");
20
+		if($type==="hidden") {
21
+					$this->addToProperty("style","display:none;");
22
+		}
22 23
 		$this->getDataField()->setInputType($type);
23 24
 		return $this;
24 25
 	}
Please login to merge, or discard this patch.
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/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.
Ajax/service/JArray.php 1 patch
Braces   +16 added lines, -12 removed lines patch added patch discarded remove patch
@@ -14,21 +14,24 @@  discard block
 block discarded – undo
14 14
 			return $array[$key];
15 15
 		}
16 16
 		$values=array_values($array);
17
-		if ($pos < sizeof($values))
18
-			return $values[$pos];
17
+		if ($pos < sizeof($values)) {
18
+					return $values[$pos];
19
+		}
19 20
 	}
20 21
 
21 22
 	public static function getConditionalValue($array, $key, $condition) {
22 23
 		$result=NULL;
23 24
 		if (array_key_exists($key, $array)) {
24 25
 			$result=$array[$key];
25
-			if ($condition($result) === true)
26
-				return $result;
26
+			if ($condition($result) === true) {
27
+							return $result;
28
+			}
27 29
 		}
28 30
 		$values=array_values($array);
29 31
 		foreach ( $values as $val ) {
30
-			if ($condition($val) === true)
31
-				return $val;
32
+			if ($condition($val) === true) {
33
+							return $val;
34
+			}
32 35
 		}
33 36
 		return $result;
34 37
 	}
@@ -36,8 +39,9 @@  discard block
 block discarded – undo
36 39
 	public static function getDefaultValue($array, $key, $default=NULL) {
37 40
 		if (array_key_exists($key, $array)) {
38 41
 			return $array[$key];
39
-		} else
40
-			return $default;
42
+		} else {
43
+					return $default;
44
+		}
41 45
 	}
42 46
 
43 47
 	public static function implode($glue, $pieces) {
@@ -84,7 +88,7 @@  discard block
 block discarded – undo
84 88
 			foreach ($objects as $object){
85 89
 				$result[]=self::callFunction($object, $modelFunction);
86 90
 			}
87
-		}else{
91
+		} else{
88 92
 			foreach ($objects as $object){
89 93
 				$result[self::callFunction($object, $identifierFunction)]=self::callFunction($object, $modelFunction);
90 94
 			}
@@ -93,9 +97,9 @@  discard block
 block discarded – undo
93 97
 	}
94 98
 
95 99
 	private static function callFunction($object,$callback){
96
-		if(\is_string($callback))
97
-			return \call_user_func(array($object, $callback),[]);
98
-		else if (\is_callable($callback)){
100
+		if(\is_string($callback)) {
101
+					return \call_user_func(array($object, $callback),[]);
102
+		} else if (\is_callable($callback)){
99 103
 			return $callback($object);
100 104
 		}
101 105
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/InternalPopup.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,9 @@
 block discarded – undo
50 50
 						$comp=$item->compile($js);
51 51
 						if(isset($js)){
52 52
 							$bs=$item->run($js);
53
-							if(isset($bs))
54
-								$this->params['onShow']=$bs->getScript();
53
+							if(isset($bs)) {
54
+															$this->params['onShow']=$bs->getScript();
55
+							}
55 56
 						}
56 57
 						$item=$comp;
57 58
 					}
Please login to merge, or discard this patch.