Completed
Push — master ( 030ef0...22ba15 )
by Jean-Christophe
03:09
created
Ajax/lib/CDN.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2
-return array (
3
-		"JQuery" => array (
4
-				"MaxCDN" => array (
2
+return array(
3
+		"JQuery" => array(
4
+				"MaxCDN" => array(
5 5
 						"url" => "http://code.jquery.com/jquery-%version%.min.js",
6
-						"versions" => array (
6
+						"versions" => array(
7 7
 								"2.2.3",
8 8
 								"2.2.1",
9 9
 								"2.1.4",
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
 								"1.11.2"
12 12
 						)
13 13
 				),
14
-				"Google" => array (
14
+				"Google" => array(
15 15
 						"url" => "https://ajax.googleapis.com/ajax/libs/jquery/%version%/jquery.min.js",
16
-						"versions" => array (
16
+						"versions" => array(
17 17
 								"2.2.2",
18 18
 								"2.2.1",
19 19
 								"2.2.0",
@@ -25,17 +25,17 @@  discard block
 block discarded – undo
25 25
 						)
26 26
 				)
27 27
 		),
28
-		"JQueryUI" => array (
29
-				"MaxCDN" => array (
28
+		"JQueryUI" => array(
29
+				"MaxCDN" => array(
30 30
 						"core" => "http://code.jquery.com/ui/%version%/jquery-ui.min.js",
31 31
 						"css" => "http://code.jquery.com/ui/%version%/themes/%theme%/jquery-ui.css",
32
-						"versions" => array (
32
+						"versions" => array(
33 33
 								"1.11.4",
34 34
 								"1.11.3",
35 35
 								"1.11.2",
36 36
 								"1.10.4"
37 37
 						),
38
-						"themes" => array (
38
+						"themes" => array(
39 39
 								"black-tie",
40 40
 								"blitzer",
41 41
 								"cupertino",
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
 								"vader"
63 63
 						)
64 64
 				),
65
-				"Google" => array (
65
+				"Google" => array(
66 66
 						"core" => "https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/jquery-ui.min.js",
67 67
 						"css" => "https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/themes/%theme%/jquery-ui.css",
68
-						"versions" => array (
68
+						"versions" => array(
69 69
 								"1.11.4",
70 70
 								"1.11.3",
71 71
 								"1.11.2",
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 								"1.10.4",
75 75
 								"1.10.0"
76 76
 						),
77
-						"themes" => array (
77
+						"themes" => array(
78 78
 								"black-tie",
79 79
 								"blitzer",
80 80
 								"cupertino",
@@ -102,25 +102,25 @@  discard block
 block discarded – undo
102 102
 						)
103 103
 				)
104 104
 		),
105
-		"Bootstrap" => array (
106
-				"MaxCDN" => array (
105
+		"Bootstrap" => array(
106
+				"MaxCDN" => array(
107 107
 						"core" => "http://maxcdn.bootstrapcdn.com/bootstrap/%version%/js/bootstrap.min.js",
108 108
 						"css" => "http://maxcdn.bootstrapcdn.com/bootstrap/%version%/css/bootstrap.min.css",
109
-						"versions" => array (
109
+						"versions" => array(
110 110
 								"3.3.6",
111 111
 								"3.3.5"
112 112
 						),
113
-						"themes" => array ()
113
+						"themes" => array()
114 114
 				)
115 115
 		),
116
-		"Semantic" => array (
117
-				"cdnjs" => array (
116
+		"Semantic" => array(
117
+				"cdnjs" => array(
118 118
 						"core" => "https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/%version%/semantic.min.js",
119 119
 						"css" => "https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/%version%/semantic.min.css",
120
-						"versions" => array (
120
+						"versions" => array(
121 121
 								"2.1.8"
122 122
 						),
123
-						"themes" => array ()
123
+						"themes" => array()
124 124
 				)
125 125
 		)
126 126
 );
127 127
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/lib/CDNCoreCss.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 	protected $localCss;
10 10
 	protected $framework;
11 11
 
12
-	public function __construct($framework,$version, $provider="MaxCDN") {
12
+	public function __construct($framework, $version, $provider="MaxCDN") {
13 13
 		parent::__construct($version, $provider);
14 14
 		$this->framework=$framework;
15 15
 		$this->data=$this->data [$framework];
Please login to merge, or discard this patch.
Ajax/lib/CDNBase.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,10 +60,10 @@
 block discarded – undo
60 60
 
61 61
 	protected function replaceVersionAndTheme($url, $version, $theme) {
62 62
 		if (isset($theme))
63
-			return str_ireplace(array (
63
+			return str_ireplace(array(
64 64
 					"%theme%",
65 65
 					"%version%" 
66
-			), array (
66
+			), array(
67 67
 					$theme,
68 68
 					$version 
69 69
 			), $url);
Please login to merge, or discard this patch.
Braces   +16 added lines, -12 removed lines patch added patch discarded remove patch
@@ -33,11 +33,13 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	protected function getUrlOrCss($element, $key) {
36
-		if (isset($element))
37
-			return $element;
36
+		if (isset($element)) {
37
+					return $element;
38
+		}
38 39
 		$version=$this->version;
39
-		if (array_search($version, $this->getVersions())===false)
40
-			$version=$this->getLastVersion();
40
+		if (array_search($version, $this->getVersions())===false) {
41
+					$version=$this->getLastVersion();
42
+		}
41 43
 		return $this->replaceVersion($this->data [$this->provider] [$key], $version);
42 44
 	}
43 45
 
@@ -59,16 +61,17 @@  discard block
 block discarded – undo
59 61
 	}
60 62
 
61 63
 	protected function replaceVersionAndTheme($url, $version, $theme) {
62
-		if (isset($theme))
63
-			return str_ireplace(array (
64
+		if (isset($theme)) {
65
+					return str_ireplace(array (
64 66
 					"%theme%",
65 67
 					"%version%" 
66 68
 			), array (
67 69
 					$theme,
68 70
 					$version 
69 71
 			), $url);
70
-		else
71
-			return $this->replaceVersion($url, $version);
72
+		} else {
73
+					return $this->replaceVersion($url, $version);
74
+		}
72 75
 	}
73 76
 
74 77
 	public function getProviders() {
@@ -76,10 +79,11 @@  discard block
 block discarded – undo
76 79
 	}
77 80
 
78 81
 	public function getVersions($provider=NULL) {
79
-		if (isset($provider))
80
-			return $this->data [$provider] ["versions"];
81
-		else
82
-			return $this->data [$this->provider] ["versions"];
82
+		if (isset($provider)) {
83
+					return $this->data [$provider] ["versions"];
84
+		} else {
85
+					return $this->data [$this->provider] ["versions"];
86
+		}
83 87
 	}
84 88
 
85 89
 	public function getLastVersion($provider=NULL) {
Please login to merge, or discard this patch.
Ajax/lib/CDNGuiGen.php 1 patch
Braces   +22 added lines, -16 removed lines patch added patch discarded remove patch
@@ -14,10 +14,11 @@  discard block
 block discarded – undo
14 14
 		$this->data=$this->data ["JQueryUI"];
15 15
 		if (is_int($theme)) {
16 16
 			$themes=$this->getThemes();
17
-			if (sizeof($themes)>$theme-1)
18
-				$this->theme=$themes [$theme-1];
19
-			else
20
-				throw new \Exception("CDNGuiGen : Le numéro de thème demandé n'existe pas");
17
+			if (sizeof($themes)>$theme-1) {
18
+							$this->theme=$themes [$theme-1];
19
+			} else {
20
+							throw new \Exception("CDNGuiGen : Le numéro de thème demandé n'existe pas");
21
+			}
21 22
 		}
22 23
 		$this->theme=$theme;
23 24
 		$this->cssUrl=null;
@@ -28,16 +29,18 @@  discard block
 block discarded – undo
28 29
 	}
29 30
 
30 31
 	public function getThemes($provider=NULL) {
31
-		if (isset($provider))
32
-			return $this->data [$provider] ["themes"];
33
-		else
34
-			return $this->data [$this->provider] ["themes"];
32
+		if (isset($provider)) {
33
+					return $this->data [$provider] ["themes"];
34
+		} else {
35
+					return $this->data [$this->provider] ["themes"];
36
+		}
35 37
 	}
36 38
 
37 39
 	public function getFirstTheme($provider=NULL) {
38 40
 		$themes=$this->getThemes($provider);
39
-		if (sizeof($themes)>0)
40
-			return $themes [0];
41
+		if (sizeof($themes)>0) {
42
+					return $themes [0];
43
+		}
41 44
 		return "";
42 45
 	}
43 46
 
@@ -46,14 +49,17 @@  discard block
 block discarded – undo
46 49
 	}
47 50
 
48 51
 	public function getCss() {
49
-		if (isset($this->cssUrl))
50
-			return $this->cssUrl;
52
+		if (isset($this->cssUrl)) {
53
+					return $this->cssUrl;
54
+		}
51 55
 		$version=$this->version;
52
-		if (array_search($version, $this->getVersions())===false)
53
-			$version=$this->getLastVersion();
56
+		if (array_search($version, $this->getVersions())===false) {
57
+					$version=$this->getLastVersion();
58
+		}
54 59
 		$theme=$this->theme;
55
-		if (array_search($theme, $this->getThemes())===false)
56
-			$theme=$this->getFirstTheme();
60
+		if (array_search($theme, $this->getThemes())===false) {
61
+					$theme=$this->getFirstTheme();
62
+		}
57 63
 		return $this->replaceVersionAndTheme($this->data [$this->provider] ["css"], $version, $theme);
58 64
 	}
59 65
 
Please login to merge, or discard this patch.
Ajax/Jquery.php 2 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -17,21 +17,21 @@  discard block
 block discarded – undo
17 17
  * jQuery Class
18 18
  */
19 19
 class Jquery {
20
-	use JqueryEventsTrait,JqueryAjaxTrait,JqueryActionsTrait;
20
+	use JqueryEventsTrait, JqueryAjaxTrait, JqueryActionsTrait;
21 21
 	protected $_ui;
22 22
 	protected $_bootstrap;
23 23
 	protected $_semantic;
24 24
 	protected $libraryFile;
25 25
 	protected $_javascript_folder='js';
26
-	protected $jquery_code_for_load=array ();
27
-	protected $jquery_code_for_compile=array ();
26
+	protected $jquery_code_for_load=array();
27
+	protected $jquery_code_for_compile=array();
28 28
 	protected $jquery_corner_active=FALSE;
29 29
 	protected $jquery_table_sorter_active=FALSE;
30 30
 	protected $jquery_table_sorter_pager_active=FALSE;
31 31
 	protected $jsUtils;
32 32
 
33
-	protected $jquery_events=array (
34
-			"bind","blur","change","click","dblclick","delegate","die","error","focus","focusin","focusout","hover","keydown","keypress","keyup","live","load","mousedown","mousseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","off","on","one","ready","resize","scroll","select","submit","toggle","trigger","triggerHandler","undind","undelegate","unload"
33
+	protected $jquery_events=array(
34
+			"bind", "blur", "change", "click", "dblclick", "delegate", "die", "error", "focus", "focusin", "focusout", "hover", "keydown", "keypress", "keyup", "live", "load", "mousedown", "mousseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "off", "on", "one", "ready", "resize", "scroll", "select", "submit", "toggle", "trigger", "triggerHandler", "undind", "undelegate", "unload"
35 35
 	);
36 36
 
37 37
 	public function ui($ui=NULL) {
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 		return $this->_semantic;
56 56
 	}
57 57
 
58
-	public function __construct($params,$jsUtils) {
58
+	public function __construct($params, $jsUtils) {
59 59
 		$this->params=array();
60
-		foreach ( $params as $key => $val ) {
60
+		foreach ($params as $key => $val) {
61 61
 				$this->params[$key]=$params[$key];
62 62
 		}
63 63
 		$this->jsUtils=$jsUtils;
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 	 */
126 126
 	public function _output($array_js='') {
127 127
 		if (!is_array($array_js)) {
128
-			$array_js=array (
128
+			$array_js=array(
129 129
 					$array_js
130 130
 			);
131 131
 		}
132 132
 
133
-		foreach ( $array_js as $js ) {
133
+		foreach ($array_js as $js) {
134 134
 			$this->jquery_code_for_compile[]="\t$js\n";
135 135
 		}
136 136
 	}
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 * @param string $param
143 143
 	 * @param boolean $immediatly delayed if false
144 144
 	 */
145
-	public function _genericCallValue($jQueryCall,$element='this', $param="", $immediatly=false) {
145
+	public function _genericCallValue($jQueryCall, $element='this', $param="", $immediatly=false) {
146 146
 		$element=$this->_prep_element($element);
147 147
 		if (isset($param)) {
148 148
 			$param=$this->_prep_value($param);
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 * @param boolean $immediatly delayed if false
162 162
 	 * @return string
163 163
 	 */
164
-	public function _genericCallElement($jQueryCall,$to='this', $element, $immediatly=false) {
164
+	public function _genericCallElement($jQueryCall, $to='this', $element, $immediatly=false) {
165 165
 		$to=$this->_prep_element($to);
166 166
 		$element=$this->_prep_element($element);
167 167
 		$str="$({$to}).{$jQueryCall}({$element});";
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
 	 */
180 180
 	public function sortable($element, $options=array()) {
181 181
 		if (count($options)>0) {
182
-			$sort_options=array ();
183
-			foreach ( $options as $k => $v ) {
182
+			$sort_options=array();
183
+			foreach ($options as $k => $v) {
184 184
 				$sort_options[]="\n\t\t".$k.': '.$v."";
185 185
 			}
186 186
 			$sort_options=implode(",", $sort_options);
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	 * @param boolean $stopPropagation Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
213 213
 	 * @return string
214 214
 	 */
215
-	public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true) {
215
+	public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true) {
216 216
 		if (is_array($js)) {
217 217
 			$js=implode("\n\t\t", $js);
218 218
 		}
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			$event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
227 227
 		else
228 228
 			$event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
229
-		if($immediatly)
229
+		if ($immediatly)
230 230
 			$this->jquery_code_for_compile[]=$event;
231 231
 		return $event;
232 232
 	}
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 
267 267
 		// External references
268 268
 		$external_scripts=implode('', $this->jquery_code_for_load);
269
-		extract(array (
269
+		extract(array(
270 270
 				'library_src' => $external_scripts
271 271
 		));
272 272
 
@@ -281,13 +281,13 @@  discard block
 block discarded – undo
281 281
 		$script.='});';
282 282
 
283 283
 		$this->jquery_code_for_compile=array();
284
-		if($this->params["debug"]==false){
284
+		if ($this->params["debug"]==false) {
285 285
 			$script=$this->minify($script);
286 286
 		}
287 287
 		$output=($script_tags===FALSE) ? $script : $this->inline($script);
288 288
 
289
-		if ($view!==NULL){
290
-			$this->jsUtils->createScriptVariable($view,$view_var, $output);
289
+		if ($view!==NULL) {
290
+			$this->jsUtils->createScriptVariable($view, $view_var, $output);
291 291
 		}
292 292
 		return $output;
293 293
 	}
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 	 * @return void
303 303
 	 */
304 304
 	public function _clear_compile() {
305
-		$this->jquery_code_for_compile=array ();
305
+		$this->jquery_code_for_compile=array();
306 306
 	}
307 307
 
308 308
 	/**
@@ -311,12 +311,12 @@  discard block
 block discarded – undo
311 311
 	 */
312 312
 	public function _document_ready($js) {
313 313
 		if (!is_array($js)) {
314
-			$js=array (
314
+			$js=array(
315 315
 					$js
316 316
 			);
317 317
 		}
318 318
 
319
-		foreach ( $js as $script ) {
319
+		foreach ($js as $script) {
320 320
 			$this->jquery_code_for_compile[]=$script;
321 321
 		}
322 322
 	}
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	 * @return string
331 331
 	 */
332 332
 	public function _prep_element($element) {
333
-		if (strrpos($element, 'this')===false&&strrpos($element, 'event')===false&&strrpos($element, 'self')===false) {
333
+		if (strrpos($element, 'this')===false && strrpos($element, 'event')===false && strrpos($element, 'self')===false) {
334 334
 			$element='"'.addslashes($element).'"';
335 335
 		}
336 336
 		return $element;
@@ -348,14 +348,14 @@  discard block
 block discarded – undo
348 348
 		if (is_array($value)) {
349 349
 			$value=implode(",", $value);
350 350
 		}
351
-		if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false&&strrpos($value, 'self')===false) {
351
+		if (strrpos($value, 'this')===false && strrpos($value, 'event')===false && strrpos($value, 'self')===false) {
352 352
 			$value='"'.$value.'"';
353 353
 		}
354 354
 		return $value;
355 355
 	}
356 356
 
357 357
 	private function minify($input) {
358
-	if(trim($input) === "") return $input;
358
+	if (trim($input)==="") return $input;
359 359
 	return preg_replace(
360 360
 			array(
361 361
 					// Remove comment(s)
Please login to merge, or discard this patch.
Braces   +20 added lines, -13 removed lines patch added patch discarded remove patch
@@ -147,10 +147,12 @@  discard block
 block discarded – undo
147 147
 		if (isset($param)) {
148 148
 			$param=$this->_prep_value($param);
149 149
 			$str="$({$element}).{$jQueryCall}({$param});";
150
-		} else
151
-			$str="$({$element}).{$jQueryCall}();";
152
-			if ($immediatly)
153
-				$this->jquery_code_for_compile[]=$str;
150
+		} else {
151
+					$str="$({$element}).{$jQueryCall}();";
152
+		}
153
+			if ($immediatly) {
154
+							$this->jquery_code_for_compile[]=$str;
155
+			}
154 156
 			return $str;
155 157
 	}
156 158
 	/**
@@ -165,8 +167,9 @@  discard block
 block discarded – undo
165 167
 		$to=$this->_prep_element($to);
166 168
 		$element=$this->_prep_element($element);
167 169
 		$str="$({$to}).{$jQueryCall}({$element});";
168
-		if ($immediatly)
169
-			$this->jquery_code_for_compile[]=$str;
170
+		if ($immediatly) {
171
+					$this->jquery_code_for_compile[]=$str;
172
+		}
170 173
 			return $str;
171 174
 	}
172 175
 
@@ -222,12 +225,14 @@  discard block
 block discarded – undo
222 225
 		if ($stopPropagation===true) {
223 226
 			$js="event.stopPropagation();\n".$js;
224 227
 		}
225
-		if (array_search($event, $this->jquery_events)===false)
226
-			$event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
227
-		else
228
-			$event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
229
-		if($immediatly)
230
-			$this->jquery_code_for_compile[]=$event;
228
+		if (array_search($event, $this->jquery_events)===false) {
229
+					$event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
230
+		} else {
231
+					$event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
232
+		}
233
+		if($immediatly) {
234
+					$this->jquery_code_for_compile[]=$event;
235
+		}
231 236
 		return $event;
232 237
 	}
233 238
 
@@ -355,7 +360,9 @@  discard block
 block discarded – undo
355 360
 	}
356 361
 
357 362
 	private function minify($input) {
358
-	if(trim($input) === "") return $input;
363
+	if(trim($input) === "") {
364
+		return $input;
365
+	}
359 366
 	return preg_replace(
360 367
 			array(
361 368
 					// Remove comment(s)
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormFields.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -13,6 +13,9 @@
 block discarded – undo
13 13
  */
14 14
 class HtmlIconGroups extends HtmlSemCollection {
15 15
 
16
+	/**
17
+	 * @param string $identifier
18
+	 */
16 19
 	public function __construct($identifier, $icons=array(), $size="") {
17 20
 		parent::__construct($identifier, "i", "icons");
18 21
 		$this->addItems($icons);
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Ajax\semantic\html\base\HtmlSemDoubleElement;
6 6
 use Ajax\JsUtils;
7 7
 use Ajax\service\JArray;
8
-
9 8
 use Ajax\semantic\html\base\constants\State;
10 9
 
11 10
 class HtmlProgress extends HtmlSemDoubleElement {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		}
36 36
 		if (isset($label))
37 37
 			$this->setLabel($label);
38
-		foreach ( $fields as $field ) {
38
+		foreach ($fields as $field) {
39 39
 			$this->addItem($field);
40 40
 		}
41 41
 		return $this;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function addItem($item) {
59 59
 		$item=parent::addItem($item);
60
-		if($item instanceof HtmlFormField)
60
+		if ($item instanceof HtmlFormField)
61 61
 			$item->setContainer($this);
62 62
 		return $item;
63 63
 	}
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
 
100 100
 	public static function radios($name, $items=array(), $label=NULL, $value=null, $type=NULL) {
101
-		$fields=array ();
101
+		$fields=array();
102 102
 		$i=0;
103
-		foreach ( $items as $val => $caption ) {
103
+		foreach ($items as $val => $caption) {
104 104
 			$itemO=new HtmlFormRadio($name."-".$i++, $name, $caption, $val, $type);
105 105
 			if ($val===$value) {
106 106
 				$itemO->getField()->setProperty("checked", "");
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	}
115 115
 
116 116
 	public static function checkeds($name, $items=array(), $label=NULL, $values=array(), $type=NULL) {
117
-		$fields=array ();
117
+		$fields=array();
118 118
 		$i=0;
119
-		foreach ( $items as $val => $caption ) {
119
+		foreach ($items as $val => $caption) {
120 120
 			$itemO=new HtmlFormCheckbox($name."-".$i++, $name, $caption, $val, $type);
121 121
 			if (\array_search($val, $values)!==false) {
122 122
 				$itemO->getField()->getField()->setProperty("checked", "");
Please login to merge, or discard this 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/html/collections/HtmlTable.php 4 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Ajax\semantic\html\base\HtmlSemDoubleElement;
6 6
 use Ajax\JsUtils;
7 7
 use Ajax\service\JArray;
8
-
9 8
 use Ajax\semantic\html\base\constants\State;
10 9
 
11 10
 class HtmlProgress extends HtmlSemDoubleElement {
Please login to merge, or discard this patch.
Doc Comments   +8 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,6 +21,10 @@  discard block
 block discarded – undo
21 21
 	private $_footer;
22 22
 	private $_afterCompileEvents;
23 23
 
24
+	/**
25
+	 * @param integer $rowCount
26
+	 * @param integer $colCount
27
+	 */
24 28
 	public function __construct($identifier, $rowCount, $colCount) {
25 29
 		parent::__construct($identifier, "table", "ui table");
26 30
 		$this->content=array ();
@@ -102,7 +106,7 @@  discard block
 block discarded – undo
102 106
 	/**
103 107
 	 * Retuns the row at $rowIndex
104 108
 	 * @param int $rowIndex
105
-	 * @return \Ajax\semantic\html\content\HtmlTR
109
+	 * @return \Ajax\common\html\HtmlDoubleElement
106 110
 	 */
107 111
 	public function getRow($rowIndex) {
108 112
 		return $this->getBody()->getRow($rowIndex);
@@ -178,6 +182,9 @@  discard block
 block discarded – undo
178 182
 		return $this->colAlign($colIndex, "colLeft");
179 183
 	}
180 184
 
185
+	/**
186
+	 * @param string $function
187
+	 */
181 188
 	private function colAlign($colIndex, $function) {
182 189
 		if (\is_array($colIndex)) {
183 190
 			foreach ( $colIndex as $cIndex ) {
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
 
24 24
 	public function __construct($identifier, $rowCount, $colCount) {
25 25
 		parent::__construct($identifier, "table", "ui table");
26
-		$this->content=array ();
26
+		$this->content=array();
27 27
 		$this->setRowCount($rowCount, $colCount);
28
-		$this->_variations=[ Variation::CELLED,Variation::PADDED,Variation::COMPACT ];
29
-		$this->_compileParts=["thead","tbody","tfoot"];
28
+		$this->_variations=[Variation::CELLED, Variation::PADDED, Variation::COMPACT];
29
+		$this->_compileParts=["thead", "tbody", "tfoot"];
30 30
 		$this->_afterCompileEvents=[];
31 31
 	}
32 32
 
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 	 * @return HtmlTableContent
37 37
 	 */
38 38
 	public function getPart($key) {
39
-		if (\array_key_exists($key, $this->content) === false) {
39
+		if (\array_key_exists($key, $this->content)===false) {
40 40
 			$this->content[$key]=new HtmlTableContent("", $key);
41
-			if ($key !== "tbody") {
41
+			if ($key!=="tbody") {
42 42
 				$this->content[$key]->setRowCount(1, $this->_colCount);
43 43
 			}
44 44
 		}
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 * @return boolean
76 76
 	 */
77 77
 	public function hasPart($key) {
78
-		return \array_key_exists($key, $this->content) === true;
78
+		return \array_key_exists($key, $this->content)===true;
79 79
 	}
80 80
 
81 81
 	/**
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
 	private function colAlign($colIndex, $function) {
182 182
 		if (\is_array($colIndex)) {
183
-			foreach ( $colIndex as $cIndex ) {
183
+			foreach ($colIndex as $cIndex) {
184 184
 				$this->colAlign($cIndex, $function);
185 185
 			}
186 186
 		} else {
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
 
199 199
 	public function setBasic($very=false) {
200 200
 		if ($very)
201
-			$this->addToPropertyCtrl("class", "very", array ("very" ));
202
-		return $this->addToPropertyCtrl("class", "basic", array ("basic" ));
201
+			$this->addToPropertyCtrl("class", "very", array("very"));
202
+		return $this->addToPropertyCtrl("class", "basic", array("basic"));
203 203
 	}
204 204
 
205 205
 	public function setCollapsing() {
@@ -260,12 +260,12 @@  discard block
 block discarded – undo
260 260
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
261 261
 	 */
262 262
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
263
-		if(\sizeof($this->_compileParts)<3){
263
+		if (\sizeof($this->_compileParts)<3) {
264 264
 			$this->_template="%content%";
265 265
 			$this->refresh();
266
-		}else{
266
+		} else {
267 267
 			if ($this->propertyContains("class", "sortable")) {
268
-				$this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();");
268
+				$this->addEvent("execute", "$('#".$this->identifier."').tablesort();");
269 269
 			}
270 270
 		}
271 271
 		$this->content=JArray::sortAssociative($this->content, $this->_compileParts);
@@ -281,13 +281,13 @@  discard block
 block discarded – undo
281 281
 	public function fromDatabaseObject($object, $function) {
282 282
 		$result=$function($object);
283 283
 		if (\is_array($result)) {
284
-			$result= $this->addRow($function($object));
284
+			$result=$this->addRow($function($object));
285 285
 		} else {
286
-			$result= $this->getBody()->_addRow($result);
286
+			$result=$this->getBody()->_addRow($result);
287 287
 		}
288
-		if(isset($this->_afterCompileEvents["onNewRow"])){
289
-			if(\is_callable($this->_afterCompileEvents["onNewRow"]))
290
-				$this->_afterCompileEvents["onNewRow"]($result,$object);
288
+		if (isset($this->_afterCompileEvents["onNewRow"])) {
289
+			if (\is_callable($this->_afterCompileEvents["onNewRow"]))
290
+				$this->_afterCompileEvents["onNewRow"]($result, $object);
291 291
 		}
292 292
 		return $result;
293 293
 	}
@@ -301,14 +301,14 @@  discard block
 block discarded – undo
301 301
 		return $this;
302 302
 	}
303 303
 
304
-	public function refresh(){
304
+	public function refresh() {
305 305
 		$this->_footer=$this->getFooter();
306 306
 		$this->addEvent("execute", '$("#'.$this->identifier.' tfoot").replaceWith("'.\addslashes($this->_footer).'");');
307 307
 	}
308 308
 
309
-	public function run(JsUtils $js){
310
-		$result= parent::run($js);
311
-		if(isset($this->_footer))
309
+	public function run(JsUtils $js) {
310
+		$result=parent::run($js);
311
+		if (isset($this->_footer))
312 312
 			$this->_footer->run($js);
313 313
 		return $result;
314 314
 	}
Please login to merge, or discard this patch.
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -197,8 +197,9 @@  discard block
 block discarded – undo
197 197
 	}
198 198
 
199 199
 	public function setBasic($very=false) {
200
-		if ($very)
201
-			$this->addToPropertyCtrl("class", "very", array ("very" ));
200
+		if ($very) {
201
+					$this->addToPropertyCtrl("class", "very", array ("very" ));
202
+		}
202 203
 		return $this->addToPropertyCtrl("class", "basic", array ("basic" ));
203 204
 	}
204 205
 
@@ -263,7 +264,7 @@  discard block
 block discarded – undo
263 264
 		if(\sizeof($this->_compileParts)<3){
264 265
 			$this->_template="%content%";
265 266
 			$this->refresh();
266
-		}else{
267
+		} else{
267 268
 			if ($this->propertyContains("class", "sortable")) {
268 269
 				$this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();");
269 270
 			}
@@ -286,8 +287,9 @@  discard block
 block discarded – undo
286 287
 			$result= $this->getBody()->_addRow($result);
287 288
 		}
288 289
 		if(isset($this->_afterCompileEvents["onNewRow"])){
289
-			if(\is_callable($this->_afterCompileEvents["onNewRow"]))
290
-				$this->_afterCompileEvents["onNewRow"]($result,$object);
290
+			if(\is_callable($this->_afterCompileEvents["onNewRow"])) {
291
+							$this->_afterCompileEvents["onNewRow"]($result,$object);
292
+			}
291 293
 		}
292 294
 		return $result;
293 295
 	}
@@ -308,8 +310,9 @@  discard block
 block discarded – undo
308 310
 
309 311
 	public function run(JsUtils $js){
310 312
 		$result= parent::run($js);
311
-		if(isset($this->_footer))
312
-			$this->_footer->run($js);
313
+		if(isset($this->_footer)) {
314
+					$this->_footer->run($js);
315
+		}
313 316
 		return $result;
314 317
 	}
315 318
 
Please login to merge, or discard this patch.
Ajax/bootstrap/components/Collapse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 	 * @see \Ajax\common\SimpleComponent::compileEvents()
10 10
 	 */
11 11
 	protected function compileEvents() {
12
-		foreach ( $this->events as $event => $jsCode ) {
12
+		foreach ($this->events as $event => $jsCode) {
13 13
 			if ($event==="buttonClick") {
14 14
 				$this->jquery_code_for_compile []="$( \"#split-".preg_replace('/[^a-zA-Z0-9\-.]/s', '', $this->attachTo)."\" ).on(\"click\" , function( event, data ) {".$jsCode."});";
15 15
 			} else {
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlMenuItem.php 2 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 				$title=@$content[1];
18 18
 				$desc=@$content[2];
19 19
 				$status=@$content[3];
20
-			}else{
20
+			} else{
21 21
 				$icon=@$content["icon"];
22 22
 				$title=@$content["title"];
23 23
 				$desc=@$content["description"];
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			if(isset($title)===true){
33 33
 				$this->setTitle($title,$desc);
34 34
 			}
35
-		}else{
35
+		} else{
36 36
 			$this->setContent($content);
37 37
 		}
38 38
 	}
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,27 +9,27 @@
 block discarded – undo
9 9
 class HtmlMenuItem extends HtmlSemDoubleElement {
10 10
 	use MenuItemTrait;
11 11
 	public function __construct($identifier, $content) {
12
-		parent::__construct($identifier,"div","item",$content);
12
+		parent::__construct($identifier, "div", "item", $content);
13 13
 	}
14 14
 
15
-	protected function initContent($content){
16
-		if(\is_array($content)){
17
-			if(JArray::isAssociative($content)===false){
15
+	protected function initContent($content) {
16
+		if (\is_array($content)) {
17
+			if (JArray::isAssociative($content)===false) {
18 18
 				$icon=@$content[0];
19 19
 				$title=@$content[1];
20 20
 				$desc=@$content[2];
21
-			}else{
21
+			} else {
22 22
 				$icon=@$content["icon"];
23 23
 				$title=@$content["title"];
24 24
 				$desc=@$content["description"];
25 25
 			}
26
-			if(isset($icon)===true){
26
+			if (isset($icon)===true) {
27 27
 				$this->setIcon($icon);
28 28
 			}
29
-			if(isset($title)===true){
30
-				$this->setTitle($title,$desc);
29
+			if (isset($title)===true) {
30
+				$this->setTitle($title, $desc);
31 31
 			}
32
-		}else{
32
+		} else {
33 33
 			$this->setContent($content);
34 34
 		}
35 35
 	}
Please login to merge, or discard this patch.