Completed
Push — master ( 0ba4b1...2affe6 )
by Jean-Christophe
03:09
created
Ajax/common/html/BaseHtml.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 abstract class BaseHtml extends BaseWidget {
17 17
 	protected $_template;
18 18
 	protected $tagName;
19
-	protected $properties=array ();
20
-	protected $events=array ();
19
+	protected $properties=array();
20
+	protected $events=array();
21 21
 	protected $wrapBefore="";
22 22
 	protected $wrapAfter="";
23 23
 	protected $_bsComponent;
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 	public function addToProperty($name, $value, $separator=" ") {
58 58
 		$v=@$this->properties[$name];
59
-		if (isset($v)&&$v!=="")
59
+		if (isset($v) && $v!=="")
60 60
 			$v=$v.$separator.$value;
61 61
 		else
62 62
 			$v=$value;
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 
72 72
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
73 73
 		$result=$this->getTemplate();
74
-		foreach ( $this as $key => $value ) {
75
-			if (PhalconUtils::startsWith($key, "_")===false&&$key!=="events") {
74
+		foreach ($this as $key => $value) {
75
+			if (PhalconUtils::startsWith($key, "_")===false && $key!=="events") {
76 76
 				if (is_array($value)) {
77 77
 					$v=PropertyWrapper::wrap($value, $js);
78
-				} else {
78
+				}else {
79 79
 					$v=$value;
80 80
 				}
81 81
 				$result=str_ireplace("%".$key."%", $v, $result);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		if (isset($view)===true) {
88 88
 			$controls=$view->getVar("q");
89 89
 			if (isset($controls)===false) {
90
-				$controls=array ();
90
+				$controls=array();
91 91
 			}
92 92
 			$controls [$this->identifier]=$result;
93 93
 			$view->setVar("q", $controls);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 			if (array_search($value, $typeCtrl)===false) {
101 101
 				throw new \Exception("La valeur passée a propriété `".$name."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
102 102
 			}
103
-		} else {
103
+		}else {
104 104
 			if (!$typeCtrl($value)) {
105 105
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$name);
106 106
 			}
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 		return true;
109 109
 	}
110 110
 
111
-	protected function propertyContains($propertyName,$value){
111
+	protected function propertyContains($propertyName, $value) {
112 112
 		$values=$this->getProperty($propertyName);
113
-		if(isset($values)){
113
+		if (isset($values)) {
114 114
 			return JString::contains($values, $value);
115 115
 		}
116 116
 		return false;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		return $this;
138 138
 	}
139 139
 
140
-	protected function removePropertyValue($name,$value){
140
+	protected function removePropertyValue($name, $value) {
141 141
 		$this->properties[$name]=\str_replace($value, "", $this->properties[$name]);
142 142
 	}
143 143
 
@@ -189,28 +189,28 @@  discard block
 block discarded – undo
189 189
 	}
190 190
 
191 191
 	public function fromArray($array) {
192
-		foreach ( $this as $key => $value ) {
192
+		foreach ($this as $key => $value) {
193 193
 			if (array_key_exists($key, $array) && !PhalconUtils::startsWith($key, "_")) {
194 194
 					$setter="set".ucfirst($key);
195 195
 					$this->$setter($array [$key]);
196 196
 				unset($array [$key]);
197 197
 			}
198 198
 		}
199
-		foreach ( $array as $key => $value ) {
199
+		foreach ($array as $key => $value) {
200 200
 			if (method_exists($this, $key)) {
201 201
 				try {
202 202
 					$this->$key($value);
203 203
 					unset($array [$key]);
204
-				} catch ( \Exception $e ) {
204
+				} catch (\Exception $e) {
205 205
 					// Nothing to do
206 206
 				}
207
-			} else {
207
+			}else {
208 208
 				$setter="set".ucfirst($key);
209 209
 				if (method_exists($this, $setter)) {
210 210
 					try {
211 211
 						$this->$setter($value);
212 212
 						unset($array [$key]);
213
-					} catch ( \Exception $e ) {
213
+					} catch (\Exception $e) {
214 214
 						// Nothing to do
215 215
 					}
216 216
 				}
@@ -219,21 +219,21 @@  discard block
 block discarded – undo
219 219
 		return $array;
220 220
 	}
221 221
 
222
-	public function fromDatabaseObjects($objects,$function) {
223
-		if(isset($objects)){
224
-			foreach ($objects as $object){
225
-				$this->fromDatabaseObject($object,$function);
222
+	public function fromDatabaseObjects($objects, $function) {
223
+		if (isset($objects)) {
224
+			foreach ($objects as $object) {
225
+				$this->fromDatabaseObject($object, $function);
226 226
 			}
227 227
 		}
228 228
 		return $this;
229 229
 	}
230 230
 
231
-	public function fromDatabaseObject($object,$function){
231
+	public function fromDatabaseObject($object, $function) {
232 232
 
233 233
 	}
234 234
 
235 235
 	public function wrap($before, $after="") {
236
-		if(isset($before)){
236
+		if (isset($before)) {
237 237
 			$this->wrapBefore.=$before;
238 238
 		}
239 239
 		$this->wrapAfter=$after.$this->wrapAfter;
@@ -255,13 +255,13 @@  discard block
 block discarded – undo
255 255
 		if (array_key_exists($event, $this->events)) {
256 256
 			if (is_array($this->events [$event])) {
257 257
 				$this->events [$event] []=$jsCode;
258
-			} else {
259
-				$this->events [$event]=array (
258
+			}else {
259
+				$this->events [$event]=array(
260 260
 						$this->events [$event],
261 261
 						$jsCode
262 262
 				);
263 263
 			}
264
-		} else {
264
+		}else {
265 265
 			$this->events [$event]=$jsCode;
266 266
 		}
267 267
 	}
@@ -280,14 +280,14 @@  discard block
 block discarded – undo
280 280
 
281 281
 	public function addEventsOnRun(JsUtils $js) {
282 282
 		if (isset($this->_bsComponent)) {
283
-			foreach ( $this->events as $event => $jsCode ) {
283
+			foreach ($this->events as $event => $jsCode) {
284 284
 				$code=$jsCode;
285 285
 				if (is_array($jsCode)) {
286 286
 					$code="";
287
-					foreach ( $jsCode as $jsC ) {
287
+					foreach ($jsCode as $jsC) {
288 288
 						if ($jsC instanceof AjaxCall) {
289 289
 							$code.="\n".$jsC->compile($js);
290
-						} else {
290
+						}else {
291 291
 							$code.="\n".$jsC;
292 292
 						}
293 293
 					}
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	}
302 302
 
303 303
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
304
-		$params=array (
304
+		$params=array(
305 305
 				"url" => $url,
306 306
 				"responseElement" => $responseElement
307 307
 		);
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 		if (is_array($elements)) {
341 341
 			$flag=false;
342 342
 			$index=0;
343
-			while ( !$flag&&$index<sizeof($elements) ) {
343
+			while (!$flag && $index<sizeof($elements)) {
344 344
 				if ($elements [$index] instanceof BaseHtml)
345 345
 					$flag=($elements [$index]->getIdentifier()===$identifier);
346 346
 				$index++;
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 		return null;
355 355
 	}
356 356
 
357
-	public function __toString(){
357
+	public function __toString() {
358 358
 		return $this->compile();
359 359
 	}
360 360
 
@@ -370,25 +370,25 @@  discard block
 block discarded – undo
370 370
 		if (is_array($value)) {
371 371
 			$value=implode(",", $value);
372 372
 		}
373
-		if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false) {
373
+		if (strrpos($value, 'this')===false && strrpos($value, 'event')===false) {
374 374
 			$value='"'.$value.'"';
375 375
 		}
376 376
 		return $value;
377 377
 	}
378 378
 
379
-	public function jsDoJquery($jqueryCall, $param=""){
379
+	public function jsDoJquery($jqueryCall, $param="") {
380 380
 		return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");";
381 381
 	}
382 382
 
383
-	public function jsHtml($content=""){
384
-		return $this->jsDoJquery("html",$content);
383
+	public function jsHtml($content="") {
384
+		return $this->jsDoJquery("html", $content);
385 385
 	}
386 386
 
387
-	public function jsShow(){
387
+	public function jsShow() {
388 388
 		return $this->jsDoJquery("show");
389 389
 	}
390 390
 
391
-	public function jsHide(){
391
+	public function jsHide() {
392 392
 		return $this->jsDoJquery("hide");
393 393
 	}
394 394
 }
395 395
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/HtmlSemCollection.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
  * @author jc
10 10
  * @version 1.001
11 11
  */
12
-abstract class HtmlSemCollection extends HtmlCollection{
12
+abstract class HtmlSemCollection extends HtmlCollection {
13 13
 	use BaseTrait;
14
-	public function __construct( $identifier, $tagName="div",$baseClass="ui"){
15
-		parent::__construct( $identifier, $tagName="div");
14
+	public function __construct($identifier, $tagName="div", $baseClass="ui") {
15
+		parent::__construct($identifier, $tagName="div");
16 16
 		$this->_baseClass=$baseClass;
17 17
 		$this->setClass($baseClass);
18 18
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/base/HtmlSemSingleElement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
 class HtmlSemSingleElement extends HtmlSingleElement {
15 15
 	use BaseTrait;
16
-	public function __construct($identifier, $tagName="br",$baseClass="ui") {
16
+	public function __construct($identifier, $tagName="br", $baseClass="ui") {
17 17
 		parent::__construct($identifier, $tagName);
18 18
 		$this->_baseClass=$baseClass;
19 19
 		$this->setClass($baseClass);
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/TextAlignment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,5 +5,5 @@
 block discarded – undo
5 5
 use Ajax\common\BaseEnum;
6 6
 
7 7
 class TextAlignment extends BaseEnum {
8
-	const LEFT="left aligned",CENTER="center aligned",RIGHT="right aligned",JUSTIFIED="justified";
8
+	const LEFT="left aligned", CENTER="center aligned", RIGHT="right aligned", JUSTIFIED="justified";
9 9
 }
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/Direction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,5 +2,5 @@
 block discarded – undo
2 2
 namespace Ajax\semantic\html\base\constants;
3 3
 	use Ajax\common\BaseEnum;
4 4
 abstract class Direction extends BaseEnum {
5
-	const RIGHT="right", LEFT="left",NONE="";
5
+	const RIGHT="right", LEFT="left", NONE="";
6 6
 }
7 7
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/Style.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,5 +5,5 @@
 block discarded – undo
5 5
 use Ajax\common\BaseEnum;
6 6
 
7 7
 class Style extends BaseEnum {
8
-	const INFO="info",SUCCESS="success",POSITIVE="positive",WARNING="warning",ERROR="error",NEGATIVE="negative";
8
+	const INFO="info", SUCCESS="success", POSITIVE="positive", WARNING="warning", ERROR="error", NEGATIVE="negative";
9 9
 }
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/Sens.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,5 +2,5 @@
 block discarded – undo
2 2
 namespace Ajax\semantic\html\base\constants;
3 3
 	use Ajax\common\BaseEnum;
4 4
 abstract class Sens extends BaseEnum {
5
-	const VERTICAL="vertical", HORIZONTAL="horizontal",NONE="";
5
+	const VERTICAL="vertical", HORIZONTAL="horizontal", NONE="";
6 6
 }
7 7
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/SegmentType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,5 +5,5 @@
 block discarded – undo
5 5
 use Ajax\common\BaseEnum;
6 6
 
7 7
 class SegmentType extends BaseEnum {
8
-	const RAISED="raised",STACKED="stacked",PILED="piled",NORMAL="";
8
+	const RAISED="raised", STACKED="stacked", PILED="piled", NORMAL="";
9 9
 }
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/Wide.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,5 +2,5 @@
 block discarded – undo
2 2
 namespace Ajax\semantic\html\base;
3 3
 	use Ajax\common\BaseEnum;
4 4
 abstract class Wide extends BaseEnum {
5
-	const W1="one", W2="two", W3="three", W4="four",W5="five", W6="six", W7="seven", W8="eight",W9="nine",W10="ten",W11="eleven",W12="twelve",W13="thirteen",W14="fourteen",W15="fifteen",W16="sixteen";
5
+	const W1="one", W2="two", W3="three", W4="four", W5="five", W6="six", W7="seven", W8="eight", W9="nine", W10="ten", W11="eleven", W12="twelve", W13="thirteen", W14="fourteen", W15="fifteen", W16="sixteen";
6 6
 }
7 7
\ No newline at end of file
Please login to merge, or discard this patch.