Completed
Push — master ( 5c7ff3...abc246 )
by Jean-Christophe
03:41
created
Ajax/semantic/html/collections/table/traits/TableTrait.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,15 +17,17 @@
 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
 
25 26
 	public function setCompact($very=false) {
26 27
 		$table=$this->getTable();
27
-		if ($very)
28
-			$table->addToPropertyCtrl("class", "very", array ("very" ));
28
+		if ($very) {
29
+					$table->addToPropertyCtrl("class", "very", array ("very" ));
30
+		}
29 31
 		return $table->addToPropertyCtrl("class", "compact", array ("compact" ));
30 32
 	}
31 33
 
Please login to merge, or discard this patch.
Ajax/common/html/traits/BaseHtmlPropertiesTrait.php 1 patch
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	public function getProperty($name) {
36
-		if (array_key_exists($name, $this->properties))
37
-			return $this->properties[$name];
36
+		if (array_key_exists($name, $this->properties)) {
37
+					return $this->properties[$name];
38
+		}
38 39
 	}
39 40
 
40 41
 	public function addToProperty($name, $value, $separator=" ") {
@@ -44,10 +45,11 @@  discard block
 block discarded – undo
44 45
 			}
45 46
 		} else if ($value !== "" && $this->propertyContains($name, $value) === false) {
46 47
 			$v=@$this->properties[$name];
47
-			if (isset($v) && $v !== "")
48
-				$v=$v . $separator . $value;
49
-				else
50
-					$v=$value;
48
+			if (isset($v) && $v !== "") {
49
+							$v=$v . $separator . $value;
50
+			} else {
51
+									$v=$value;
52
+				}
51 53
 
52 54
 					return $this->setProperty($name, $v);
53 55
 		}
@@ -70,8 +72,9 @@  discard block
 block discarded – undo
70 72
 	}
71 73
 
72 74
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
73
-		if (@class_exists($typeCtrl, true))
74
-			$typeCtrl=$typeCtrl::getConstants();
75
+		if (@class_exists($typeCtrl, true)) {
76
+					$typeCtrl=$typeCtrl::getConstants();
77
+		}
75 78
 			if (\is_array($typeCtrl)) {
76 79
 				$this->removeOldValues($this->properties[$name], $typeCtrl);
77 80
 			}
@@ -90,8 +93,9 @@  discard block
 block discarded – undo
90 93
 	}
91 94
 
92 95
 	public function removeProperty($name) {
93
-		if (\array_key_exists($name, $this->properties))
94
-			unset($this->properties[$name]);
96
+		if (\array_key_exists($name, $this->properties)) {
97
+					unset($this->properties[$name]);
98
+		}
95 99
 			return $this;
96 100
 	}
97 101
 
@@ -104,8 +108,9 @@  discard block
 block discarded – undo
104 108
 	}
105 109
 
106 110
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
107
-		if ($this->ctrl($name, $value, $typeCtrl) === true)
108
-			return $this->setProperty($name, $value);
111
+		if ($this->ctrl($name, $value, $typeCtrl) === true) {
112
+					return $this->setProperty($name, $value);
113
+		}
109 114
 			return $this;
110 115
 	}
111 116
 
Please login to merge, or discard this patch.
Ajax/common/html/BaseHtml.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -99,15 +99,18 @@  discard block
 block discarded – undo
99 99
 			$flag=false;
100 100
 			$index=0;
101 101
 			while ( !$flag && $index < sizeof($elements) ) {
102
-				if ($elements[$index] instanceof BaseHtml)
103
-					$flag=($callback($elements[$index]));
102
+				if ($elements[$index] instanceof BaseHtml) {
103
+									$flag=($callback($elements[$index]));
104
+				}
104 105
 					$index++;
105 106
 			}
106
-			if ($flag === true)
107
-				return $elements[$index - 1];
107
+			if ($flag === true) {
108
+							return $elements[$index - 1];
109
+			}
108 110
 		} elseif ($elements instanceof BaseHtml) {
109
-			if ($callback($elements))
110
-				return $elements;
111
+			if ($callback($elements)) {
112
+							return $elements;
113
+			}
111 114
 		}
112 115
 		return null;
113 116
 	}
@@ -140,8 +143,9 @@  discard block
 block discarded – undo
140 143
 
141 144
 	public function fromArray($array) {
142 145
 		foreach ( $this as $key => $value ) {
143
-			if(array_key_exists($key, $array)===true)
144
-				$this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array);
146
+			if(array_key_exists($key, $array)===true) {
147
+							$this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array);
148
+			}
145 149
 		}
146 150
 		foreach ( $array as $key => $value ) {
147 151
 			if($this->_callSetter($key, $key, $value, $array)===false){
Please login to merge, or discard this patch.
Ajax/semantic/widgets/base/InstanceViewer.php 1 patch
Braces   +41 added lines, -35 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@  discard block
 block discarded – undo
21 21
 		$this->widgetIdentifier=$identifier;
22 22
 		$this->values=[];
23 23
 		$this->afterCompile=[];
24
-		if(isset($instance))
25
-			$this->setInstance($instance);
24
+		if(isset($instance)) {
25
+					$this->setInstance($instance);
26
+		}
26 27
 		$this->setCaptions($captions);
27 28
 		$this->captionCallback=NULL;
28 29
 		$this->defaultValueFunction=function($name,$value){return $value;};
@@ -39,11 +40,13 @@  discard block
 block discarded – undo
39 40
 	}
40 41
 
41 42
 	public function getIdentifier($index=NULL){
42
-		if(!isset($index))
43
-			$index=self::$index;
43
+		if(!isset($index)) {
44
+					$index=self::$index;
45
+		}
44 46
 		$value=$index;
45
-		if(isset($this->values["identifier"]))
46
-			$value=$this->values["identifier"]($index,$this->instance);
47
+		if(isset($this->values["identifier"])) {
48
+					$value=$this->values["identifier"]($index,$this->instance);
49
+		}
47 50
 		return $value;
48 51
 	}
49 52
 
@@ -66,7 +69,7 @@  discard block
 block discarded – undo
66 69
 		$value=$property->getValue($this->instance);
67 70
 		if(isset($this->values[$index])){
68 71
 			$value= $this->values[$index]($value,$this->instance,$index);
69
-		}else{
72
+		} else{
70 73
 			$value=$this->_getDefaultValue($property->getName(),$value, $index);
71 74
 		}
72 75
 		return $value;
@@ -76,16 +79,16 @@  discard block
 block discarded – undo
76 79
 		$value=null;
77 80
 		if($property instanceof \ReflectionProperty){
78 81
 			$value=$this->_getPropertyValue($property, $index);
79
-		}else{
80
-			if(\is_callable($property))
81
-				$value=$property($this->instance);
82
-			elseif(\is_array($property)){
82
+		} else{
83
+			if(\is_callable($property)) {
84
+							$value=$property($this->instance);
85
+			} elseif(\is_array($property)){
83 86
 				$values=\array_map(function($v) use ($index){return $this->_getValue($v, $index);}, $property);
84 87
 				$value=\implode("", $values);
85
-			}else{
88
+			} else{
86 89
 				if(isset($this->values[$index])){
87 90
 					$value= $this->values[$index]($property,$this->instance,$index);
88
-				}elseif(isset($this->instance->{$property})){
91
+				} elseif(isset($this->instance->{$property})){
89 92
 					$value=$this->instance->{$property};
90 93
 				}
91 94
 			}
@@ -108,10 +111,10 @@  discard block
 block discarded – undo
108 111
 		if(isset($vb[$index])){
109 112
 			if(\is_array($vb[$index])){
110 113
 				$this->visibleProperties[$index][]=$field;
111
-			}else{
114
+			} else{
112 115
 				$this->visibleProperties[$index]=[$vb[$index],$field];
113 116
 			}
114
-		}else{
117
+		} else{
115 118
 			return $this->insertField($index, $field);
116 119
 		}
117 120
 		return $this;
@@ -138,9 +141,9 @@  discard block
 block discarded – undo
138 141
 		$property=$this->getProperty($index);
139 142
 		if($property instanceof \ReflectionProperty){
140 143
 			$result=$property->getName();
141
-		}elseif(\is_callable($property)){
144
+		} elseif(\is_callable($property)){
142 145
 			$result=$this->visibleProperties[$index];
143
-		}else{
146
+		} else{
144 147
 			$result=$property;
145 148
 		}
146 149
 		return $result;
@@ -160,7 +163,7 @@  discard block
 block discarded – undo
160 163
 		$this->reflect=new \ReflectionClass($instance);
161 164
 		if(\sizeof($this->visibleProperties)===0){
162 165
 			$this->properties=$this->getDefaultProperties();
163
-		}else{
166
+		} else{
164 167
 			foreach ($this->visibleProperties as $property){
165 168
 				$this->setInstanceProperty($property);
166 169
 			}
@@ -171,22 +174,23 @@  discard block
 block discarded – undo
171 174
 	private function setInstanceProperty($property){
172 175
 		if(\is_callable($property)){
173 176
 			$this->properties[]=$property;
174
-		}elseif(\is_string($property)){
177
+		} elseif(\is_string($property)){
175 178
 			try{
176 179
 				$this->_beforeAddProperty(\sizeof($this->properties), $property);
177 180
 				$rProperty=$this->reflect->getProperty($property);
178 181
 				$this->properties[]=$rProperty;
179
-			}catch(\Exception $e){
182
+			} catch(\Exception $e){
180 183
 				$this->_beforeAddProperty(\sizeof($this->properties), $property);
181 184
 				$this->properties[]=$property;
182 185
 			}
183
-		}elseif(\is_int($property)){
186
+		} elseif(\is_int($property)){
184 187
 			$props=$this->getDefaultProperties();
185
-			if(isset($props[$property]))
186
-				$this->properties[]=$props[$property];
187
-				else
188
-					$this->properties[]=$property;
189
-		}else{
188
+			if(isset($props[$property])) {
189
+							$this->properties[]=$props[$property];
190
+			} else {
191
+									$this->properties[]=$property;
192
+				}
193
+		} else{
190 194
 			$this->properties[]=$property;
191 195
 		}
192 196
 	}
@@ -230,12 +234,13 @@  discard block
 block discarded – undo
230 234
 		if(isset($this->captions[$index])){
231 235
 			return $this->captions[$index];
232 236
 		}
233
-		if($this->properties[$index] instanceof \ReflectionProperty)
234
-			return $this->properties[$index]->getName();
235
-		elseif(\is_callable($this->properties[$index]))
236
-			return "";
237
-		else
238
-			return $this->properties[$index];
237
+		if($this->properties[$index] instanceof \ReflectionProperty) {
238
+					return $this->properties[$index]->getName();
239
+		} elseif(\is_callable($this->properties[$index])) {
240
+					return "";
241
+		} else {
242
+					return $this->properties[$index];
243
+		}
239 244
 	}
240 245
 
241 246
 	public function getCaptions(){
@@ -244,7 +249,7 @@  discard block
 block discarded – undo
244 249
 			for($i=\sizeof($captions);$i<$this->count();$i++){
245 250
 				$captions[]="";
246 251
 			}
247
-		}else{
252
+		} else{
248 253
 			$captions=[];
249 254
 			$index=0;
250 255
 			$count=$this->count();
@@ -260,8 +265,9 @@  discard block
 block discarded – undo
260 265
 	}
261 266
 
262 267
 	public function setCaption($index,$caption){
263
-		if(isset($this->captions)===false)
264
-			$this->captions=[];
268
+		if(isset($this->captions)===false) {
269
+					$this->captions=[];
270
+		}
265 271
 		$this->captions[$index]=$caption;
266 272
 		return $this;
267 273
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlButtongroups.php 1 patch
Braces   +18 added lines, -15 removed lines patch added patch discarded remove patch
@@ -49,8 +49,9 @@  discard block
 block discarded – undo
49 49
 	}
50 50
 
51 51
 	public function setStyle($value) {
52
-		foreach ( $this->elements as $element )
53
-			$element->setStyle($value);
52
+		foreach ( $this->elements as $element ) {
53
+					$element->setStyle($value);
54
+		}
54 55
 	}
55 56
 
56 57
 	private function dropdownAsButton($bt) {
@@ -76,18 +77,19 @@  discard block
 block discarded – undo
76 77
 		} elseif (is_string($element)) {
77 78
 			$result=new HtmlButton($this->identifier."-button-".$iid,$element);
78 79
 		}
79
-		if($result instanceof HtmlButton)
80
-			$this->elements[]=$result;
80
+		if($result instanceof HtmlButton) {
81
+					$this->elements[]=$result;
82
+		}
81 83
 		return $result;
82 84
 	}
83 85
 
84 86
 	private function _addArrayElement(array $element,$iid){
85
-		if (array_key_exists("glyph", $element))
86
-			$bt=new HtmlGlyphButton($this->identifier."-button-".$iid);
87
-		elseif (array_key_exists("btnCaption", $element)) {
88
-			if (array_key_exists("split", $element))
89
-				$bt=new HtmlSplitbutton($this->identifier."-dropdown-".$iid);
90
-			else{
87
+		if (array_key_exists("glyph", $element)) {
88
+					$bt=new HtmlGlyphButton($this->identifier."-button-".$iid);
89
+		} elseif (array_key_exists("btnCaption", $element)) {
90
+			if (array_key_exists("split", $element)) {
91
+							$bt=new HtmlSplitbutton($this->identifier."-dropdown-".$iid);
92
+			} else{
91 93
 				$bt=new HtmlDropdown($this->identifier."-dropdown-".$iid);
92 94
 				$this->dropdownAsButton($bt);
93 95
 			}
@@ -116,8 +118,9 @@  discard block
 block discarded – undo
116 118
 	public function setAlignment($value) {
117 119
 		if (is_int($value)) {
118 120
 			$value=CssRef::alignment("btn-group")[$value];
119
-		} else
120
-			$value="btn-group-".$value;
121
+		} else {
122
+					$value="btn-group-".$value;
123
+		}
121 124
 		if (strstr($value, "justified")) {
122 125
 			foreach ( $this->elements as $element ) {
123 126
 				$element->wrap('<div class="btn-group" role="group">', '</div>');
@@ -132,9 +135,9 @@  discard block
 block discarded – undo
132 135
 	 * @return HtmlButton
133 136
 	 */
134 137
 	public function getElement($index) {
135
-		if (is_int($index))
136
-			return $this->elements[$index];
137
-		else {
138
+		if (is_int($index)) {
139
+					return $this->elements[$index];
140
+		} else {
138 141
 			$elm=$this->getElementById($index, $this->elements);
139 142
 			return $elm;
140 143
 		}
Please login to merge, or discard this patch.
Ajax/semantic/widgets/dataform/FormInstanceViewer.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@
 block discarded – undo
33 33
 
34 34
 
35 35
 	public function addSeparatorAfter($fieldNum){
36
-		if(\array_search($fieldNum, $this->separators)===false)
37
-			$this->separators[]=$fieldNum;
36
+		if(\array_search($fieldNum, $this->separators)===false) {
37
+					$this->separators[]=$fieldNum;
38
+		}
38 39
 		return $this;
39 40
 	}
40 41
 
Please login to merge, or discard this patch.
Ajax/semantic/widgets/dataform/DataForm.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,14 +54,14 @@
 block discarded – undo
54 54
 			foreach ($values as $v){
55 55
 				$form->addField($v);
56 56
 			}
57
-		}else{
57
+		} else{
58 58
 			$separators[]=$count;
59 59
 			for($i=0;$i<$size;$i++){
60 60
 				$fields=\array_slice($values, $separators[$i]+1,$separators[$i+1]-$separators[$i]);
61 61
 				//TODO check why $fields is empty
62 62
 				if(\sizeof($fields)===1){
63 63
 					$form->addField($fields[0]);
64
-				}elseif(\sizeof($fields)>1){
64
+				} elseif(\sizeof($fields)>1){
65 65
 					$form->addFields($fields);
66 66
 				}
67 67
 			}
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/DataTableFieldAsTrait.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -58,8 +58,9 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	private function getFieldButton($caption,$visibleHover=true){
60 60
 		$bt= new HtmlButton("",$caption);
61
-		if($visibleHover)
62
-			$this->_visibleOver($bt);
61
+		if($visibleHover) {
62
+					$this->_visibleOver($bt);
63
+		}
63 64
 			return $bt;
64 65
 	}
65 66
 
@@ -76,8 +77,9 @@  discard block
 block discarded – undo
76 77
 		return $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$index,$attributes){
77 78
 			$button=new HtmlButton($id,$value,$cssStyle);
78 79
 			$button->postOnClick($url,"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes["ajax"]);
79
-			if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"])
80
-				$this->_visibleOver($button);
80
+			if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) {
81
+							$this->_visibleOver($button);
82
+			}
81 83
 				return $button;
82 84
 		}, $index,$attributes);
83 85
 	}
@@ -136,8 +138,9 @@  discard block
 block discarded – undo
136 138
 	private function getDefaultButton($icon,$class=null,$visibleHover=true){
137 139
 		$bt=$this->getFieldButton("",$visibleHover);
138 140
 		$bt->asIcon($icon);
139
-		if(isset($class))
140
-			$bt->addClass($class);
141
+		if(isset($class)) {
142
+					$bt->addClass($class);
143
+		}
141 144
 		return $bt;
142 145
 	}
143 146
 
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
@@ -54,8 +54,9 @@  discard block
 block discarded – undo
54 54
 				$this->params[$key]=$params[$key];
55 55
 		}
56 56
 		$this->jsUtils=$jsUtils;
57
-		if(isset($params["ajaxTransition"]))
58
-			$this->ajaxTransition=$this->setAjaxDataCall($params["ajaxTransition"]);
57
+		if(isset($params["ajaxTransition"])) {
58
+					$this->ajaxTransition=$this->setAjaxDataCall($params["ajaxTransition"]);
59
+		}
59 60
 	}
60 61
 
61 62
 	/**
@@ -138,10 +139,12 @@  discard block
 block discarded – undo
138 139
 		if (isset($param)) {
139 140
 			$param=Javascript::prep_value($param);
140 141
 			$str="$({$element}).{$jQueryCall}({$param});";
141
-		} else
142
-			$str="$({$element}).{$jQueryCall}();";
143
-			if ($immediatly)
144
-				$this->jquery_code_for_compile[]=$str;
142
+		} else {
143
+					$str="$({$element}).{$jQueryCall}();";
144
+		}
145
+			if ($immediatly) {
146
+							$this->jquery_code_for_compile[]=$str;
147
+			}
145 148
 			return $str;
146 149
 	}
147 150
 	/**
@@ -156,8 +159,9 @@  discard block
 block discarded – undo
156 159
 		$to=Javascript::prep_element($to);
157 160
 		$element=Javascript::prep_element($element);
158 161
 		$str="$({$to}).{$jQueryCall}({$element});";
159
-		if ($immediatly)
160
-			$this->jquery_code_for_compile[]=$str;
162
+		if ($immediatly) {
163
+					$this->jquery_code_for_compile[]=$str;
164
+		}
161 165
 			return $str;
162 166
 	}
163 167
 
@@ -213,12 +217,14 @@  discard block
 block discarded – undo
213 217
 		if ($stopPropagation===true) {
214 218
 			$js=Javascript::$stopPropagation.$js;
215 219
 		}
216
-		if (array_search($event, $this->jquery_events)===false)
217
-			$event="\n\t$(".Javascript::prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
218
-		else
219
-			$event="\n\t$(".Javascript::prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
220
-		if($immediatly)
221
-			$this->jquery_code_for_compile[]=$event;
220
+		if (array_search($event, $this->jquery_events)===false) {
221
+					$event="\n\t$(".Javascript::prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
222
+		} else {
223
+					$event="\n\t$(".Javascript::prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
224
+		}
225
+		if($immediatly) {
226
+					$this->jquery_code_for_compile[]=$event;
227
+		}
222 228
 		return $event;
223 229
 	}
224 230
 
@@ -303,7 +309,9 @@  discard block
 block discarded – undo
303 309
 	}
304 310
 
305 311
 	private function minify($input) {
306
-	if(trim($input) === "") return $input;
312
+	if(trim($input) === "") {
313
+		return $input;
314
+	}
307 315
 	return preg_replace(
308 316
 			array(
309 317
 					// Remove comment(s)
Please login to merge, or discard this patch.