Completed
Push — master ( 6adf1e...bda9b8 )
by Jean-Christophe
03:12
created
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.