Completed
Push — master ( d27f99...f4e97d )
by Jean-Christophe
03:35
created
Ajax/semantic/widgets/datatable/DataTable.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -62,18 +62,21 @@  discard block
 block discarded – undo
62 62
 
63 63
 		$table->setRowCount(0, \sizeof($captions));
64 64
 		$table->setHeaderValues($captions);
65
-		if(isset($this->_compileParts))
66
-			$table->setCompileParts($this->_compileParts);
65
+		if(isset($this->_compileParts)) {
66
+					$table->setCompileParts($this->_compileParts);
67
+		}
67 68
 		if(isset($this->_searchField)){
68
-			if(isset($js))
69
-				$this->_searchField->postOn("change", $this->_urls,"{'s':$(this).val()}","-#".$this->identifier." tbody",["preventDefault"=>false]);
69
+			if(isset($js)) {
70
+							$this->_searchField->postOn("change", $this->_urls,"{'s':$(this).val()}","-#".$this->identifier." tbody",["preventDefault"=>false]);
71
+			}
70 72
 		}
71 73
 
72 74
 		$this->_generateContent($table);
73 75
 
74 76
 		if($this->_hasCheckboxes){
75
-			if($table->hasPart("thead"))
76
-				$table->getHeader()->getCell(0, 0)->addToProperty("class","no-sort");
77
+			if($table->hasPart("thead")) {
78
+							$table->getHeader()->getCell(0, 0)->addToProperty("class","no-sort");
79
+			}
77 80
 		}
78 81
 
79 82
 		if(isset($this->_pagination) && $this->_pagination->getVisible()){
@@ -307,8 +310,9 @@  discard block
 block discarded – undo
307 310
 	private function getDefaultButton($icon,$class=null){
308 311
 		$bt=$this->getFieldButton("");
309 312
 		$bt->asIcon($icon);
310
-		if(isset($class))
311
-			$bt->addToProperty("class", $class);
313
+		if(isset($class)) {
314
+					$bt->addToProperty("class", $class);
315
+		}
312 316
 		return $bt;
313 317
 	}
314 318
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormFields.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,12 +29,14 @@  discard block
 block discarded – undo
29 29
 				if (\is_string($end)) {
30 30
 					$label=$end;
31 31
 					\array_pop($fields);
32
-				} else
33
-					$label=NULL;
32
+				} else {
33
+									$label=NULL;
34
+				}
34 35
 			}
35 36
 		}
36
-		if (isset($label))
37
-			$this->setLabel($label);
37
+		if (isset($label)) {
38
+					$this->setLabel($label);
39
+		}
38 40
 		foreach ( $fields as $field ) {
39 41
 			$this->addItem($field);
40 42
 		}
@@ -57,8 +59,9 @@  discard block
 block discarded – undo
57 59
 
58 60
 	public function addItem($item) {
59 61
 		$item=parent::addItem($item);
60
-		if($item instanceof HtmlFormField)
61
-			$item->setContainer($this);
62
+		if($item instanceof HtmlFormField) {
63
+					$item->setContainer($this);
64
+		}
62 65
 		return $item;
63 66
 	}
64 67
 
@@ -66,8 +69,9 @@  discard block
 block discarded – undo
66 69
 		if ($this->_equalWidth) {
67 70
 			$count=$this->count();
68 71
 			$this->addToProperty("class", Wide::getConstants()["W".$count]." fields");
69
-		} else
70
-			$this->addToProperty("class", "fields");
72
+		} else {
73
+					$this->addToProperty("class", "fields");
74
+		}
71 75
 		return parent::compile($js, $view);
72 76
 	}
73 77
 
@@ -108,8 +112,9 @@  discard block
 block discarded – undo
108 112
 			$fields[]=$itemO;
109 113
 		}
110 114
 		$radios=new HtmlFormFields("fields-".$name, $fields);
111
-		if (isset($label))
112
-			$radios->setLabel($label)->setProperty("for", $name);
115
+		if (isset($label)) {
116
+					$radios->setLabel($label)->setProperty("for", $name);
117
+		}
113 118
 		return $radios;
114 119
 	}
115 120
 
@@ -124,8 +129,9 @@  discard block
 block discarded – undo
124 129
 			$fields[]=$itemO;
125 130
 		}
126 131
 		$radios=new HtmlFormFields("fields-".$name, $fields);
127
-		if (isset($label))
128
-			$radios->setLabel($label)->setProperty("for", $name);
132
+		if (isset($label)) {
133
+					$radios->setLabel($label)->setProperty("for", $name);
134
+		}
129 135
 		return $radios;
130 136
 	}
131 137
 
Please login to merge, or discard this patch.
Ajax/semantic/widgets/dataform/FormInstanceViewer.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,17 +34,18 @@
 block discarded – undo
34 34
 		$property=$this->getProperty($index);
35 35
 		if($property instanceof \ReflectionProperty){
36 36
 			$result=$property->getName();
37
-		}elseif(\is_callable($property)){
37
+		} elseif(\is_callable($property)){
38 38
 			$result=$this->visibleProperties[$index];
39
-		}else{
39
+		} else{
40 40
 			$result=\strtolower($this->getCaption($index));
41 41
 		}
42 42
 		return $result;
43 43
 	}
44 44
 
45 45
 	public function addSeparatorAfter($fieldNum){
46
-		if(\array_search($fieldNum, $this->separators)===false)
47
-			$this->separators[]=$fieldNum;
46
+		if(\array_search($fieldNum, $this->separators)===false) {
47
+					$this->separators[]=$fieldNum;
48
+		}
48 49
 			return $this;
49 50
 	}
50 51
 
Please login to merge, or discard this patch.
Ajax/semantic/widgets/dataform/DataForm.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,14 +51,15 @@
 block discarded – undo
51 51
 			foreach ($values as $v){
52 52
 				$form->addField($v);
53 53
 			}
54
-		}else{
54
+		} else{
55 55
 			$separators[]=$count;
56 56
 			for($i=0;$i<$size-1;$i++){
57 57
 				$fields=\array_slice($values, $separators[$i]+1,$separators[$i+1]-$separators[$i]);
58 58
 				if(\sizeof($fields)===1){
59 59
 					$form->addField($fields[0]);
60
-				}else
61
-					$form->addFields($fields);
60
+				} else {
61
+									$form->addFields($fields);
62
+				}
62 63
 			}
63 64
 		}
64 65
 	}
Please login to merge, or discard this patch.
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.