Completed
Push — master ( 22ba15...552305 )
by Jean-Christophe
03:10
created
Ajax/semantic/html/content/HtmlAbsractItem.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 abstract class HtmlAbsractItem extends HtmlSemDoubleElement {
13 13
 
14
-	public function __construct($identifier, $baseClass,$content=NULL) {
14
+	public function __construct($identifier, $baseClass, $content=NULL) {
15 15
 		parent::__construct($identifier, "div", $baseClass);
16 16
 		$this->content=array();
17 17
 		$this->initContent($content);
@@ -19,53 +19,53 @@  discard block
 block discarded – undo
19 19
 
20 20
 	protected abstract function initContent($content);
21 21
 
22
-	public function setIcon($icon){
22
+	public function setIcon($icon) {
23 23
 		$this->content["icon"]=new HtmlIcon("icon-".$this->identifier, $icon);
24 24
 	}
25 25
 
26
-	public function setImage($image){
26
+	public function setImage($image) {
27 27
 		$image=new HtmlImg("icon-".$this->identifier, $image);
28 28
 		$image->asAvatar();
29 29
 		$this->content["image"]=$image;
30 30
 	}
31 31
 
32
-	private function createContent(){
33
-		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier,"div","content");
32
+	private function createContent() {
33
+		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
34 34
 		return $this->content["content"];
35 35
 	}
36 36
 
37
-	public function setTitle($title,$description=NULL,$baseClass="title"){
38
-		$title=new HtmlSemDoubleElement("","div",$baseClass,$title);
39
-		if(\array_key_exists("content", $this->content)===false){
37
+	public function setTitle($title, $description=NULL, $baseClass="title") {
38
+		$title=new HtmlSemDoubleElement("", "div", $baseClass, $title);
39
+		if (\array_key_exists("content", $this->content)===false) {
40 40
 			$this->createContent();
41 41
 		}
42 42
 		$this->content["content"]->addContent($title);
43
-		if(isset($description)){
44
-			$description=new HtmlSemDoubleElement("","div","description",$description);
43
+		if (isset($description)) {
44
+			$description=new HtmlSemDoubleElement("", "div", "description", $description);
45 45
 			$this->content["content"]->addContent($description);
46 46
 		}
47 47
 		return $this;
48 48
 	}
49 49
 
50
-	public function getPart($partName="header"){
51
-		$content=\array_merge($this->content["content"]->getContent(),array(@$this->content["icon"],@$this->content["image"]));
50
+	public function getPart($partName="header") {
51
+		$content=\array_merge($this->content["content"]->getContent(), array(@$this->content["icon"], @$this->content["image"]));
52 52
 		return $this->getElementByPropertyValue("class", $partName, $content);
53 53
 	}
54 54
 
55
-	public function setActive($value=true){
56
-		if($value){
55
+	public function setActive($value=true) {
56
+		if ($value) {
57 57
 			$this->setTagName("div");
58 58
 			$this->removeProperty("href");
59 59
 			$this->addToPropertyCtrl("class", "active", array("active"));
60
-		}else{
60
+		} else {
61 61
 			$this->removePropertyValue("class", "active");
62 62
 		}
63 63
 		return $this;
64 64
 	}
65 65
 
66
-	public function asLink($href=NULL,$part=NULL){
66
+	public function asLink($href=NULL, $part=NULL) {
67 67
 		$this->setTagName("a");
68
-		if(isset($href))
68
+		if (isset($href))
69 69
 			$this->setProperty("href", $href);
70 70
 		return $this;
71 71
 	}
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
78 78
 	 */
79 79
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
80
-		if(\is_array($this->content))
81
-			$this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]);
80
+		if (\is_array($this->content))
81
+			$this->content=JArray::sortAssociative($this->content, ["icon", "image", "content"]);
82 82
 		return parent::compile($js, $view);
83 83
 	}
84 84
 }
85 85
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/common/components/BaseComponent.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
  * @version 1.001
11 11
  */
12 12
 abstract class BaseComponent {
13
-	public $jquery_code_for_compile=array ();
14
-	protected $params=array ();
13
+	public $jquery_code_for_compile=array();
14
+	protected $params=array();
15 15
 
16 16
 	/**
17 17
 	 *
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	}
69 69
 
70 70
 	public function setParams($params) {
71
-		foreach ( $params as $k => $v ) {
71
+		foreach ($params as $k => $v) {
72 72
 			$method="set".ucfirst($k);
73 73
 			if (method_exists($this, $method))
74 74
 				$this->$method($v);
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 		return $this;
82 82
 	}
83 83
 
84
-	public function addParams($params){
85
-		foreach ($params as $k=>$v){
84
+	public function addParams($params) {
85
+		foreach ($params as $k=>$v) {
86 86
 				$this->setParam($k, $v);
87 87
 		}
88 88
 		return $this;
Please login to merge, or discard this patch.
Ajax/common/html/BaseHtml.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  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 ();
21
-	protected $_wrapBefore=array ();
22
-	protected $_wrapAfter=array ();
19
+	protected $properties=array();
20
+	protected $_events=array();
21
+	protected $_wrapBefore=array();
22
+	protected $_wrapAfter=array();
23 23
 	protected $_bsComponent;
24 24
 
25 25
 	public function getBsComponent() {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	}
33 33
 
34 34
 	protected function getTemplate(JsUtils $js=NULL) {
35
-		return PropertyWrapper::wrap($this->_wrapBefore, $js) . $this->_template . PropertyWrapper::wrap($this->_wrapAfter, $js);
35
+		return PropertyWrapper::wrap($this->_wrapBefore, $js).$this->_template.PropertyWrapper::wrap($this->_wrapAfter, $js);
36 36
 	}
37 37
 
38 38
 	public function getProperties() {
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
 
57 57
 	public function addToProperty($name, $value, $separator=" ") {
58 58
 		if (\is_array($value)) {
59
-			foreach ( $value as $v ) {
59
+			foreach ($value as $v) {
60 60
 				$this->addToProperty($name, $v, $separator);
61 61
 			}
62
-		} else if ($value !== "" && $this->propertyContains($name, $value) === false) {
62
+		} else if ($value!=="" && $this->propertyContains($name, $value)===false) {
63 63
 			$v=@$this->properties[$name];
64
-			if (isset($v) && $v !== "")
65
-				$v=$v . $separator . $value;
64
+			if (isset($v) && $v!=="")
65
+				$v=$v.$separator.$value;
66 66
 			else
67 67
 				$v=$value;
68 68
 
@@ -78,19 +78,19 @@  discard block
 block discarded – undo
78 78
 
79 79
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
80 80
 		$result=$this->getTemplate($js);
81
-		foreach ( $this as $key => $value ) {
82
-			if (JString::startswith($key, "_") === false && $key !== "events") {
81
+		foreach ($this as $key => $value) {
82
+			if (JString::startswith($key, "_")===false && $key!=="events") {
83 83
 				if (is_array($value)) {
84 84
 					$v=PropertyWrapper::wrap($value, $js);
85 85
 				} else {
86 86
 					$v=$value;
87 87
 				}
88
-				$result=str_ireplace("%" . $key . "%", $v, $result);
88
+				$result=str_ireplace("%".$key."%", $v, $result);
89 89
 			}
90 90
 		}
91 91
 		if (isset($js)===true) {
92 92
 			$this->run($js);
93
-			if (isset($view) === true) {
93
+			if (isset($view)===true) {
94 94
 				$js->addViewElement($this->identifier, $result, $view);
95 95
 			}
96 96
 		}
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
 
100 100
 	protected function ctrl($name, $value, $typeCtrl) {
101 101
 		if (is_array($typeCtrl)) {
102
-			if (array_search($value, $typeCtrl) === false) {
103
-				throw new \Exception("La valeur passée `" . $value . "` à la propriété `" . $name . "` ne fait pas partie des valeurs possibles : {" . implode(",", $typeCtrl) . "}");
102
+			if (array_search($value, $typeCtrl)===false) {
103
+				throw new \Exception("La valeur passée `".$value."` à la propriété `".$name."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
104 104
 			}
105 105
 		} else {
106 106
 			if (!$typeCtrl($value)) {
107
-				throw new \Exception("La fonction " . $typeCtrl . " a retourné faux pour l'affectation de la propriété " . $name);
107
+				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$name);
108 108
 			}
109 109
 		}
110 110
 		return true;
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
 	}
120 120
 
121 121
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
122
-		if ($this->ctrl($name, $value, $typeCtrl) === true)
122
+		if ($this->ctrl($name, $value, $typeCtrl)===true)
123 123
 			return $this->setProperty($name, $value);
124 124
 		return $this;
125 125
 	}
126 126
 
127 127
 	protected function setMemberCtrl(&$name, $value, $typeCtrl) {
128
-		if ($this->ctrl($name, $value, $typeCtrl) === true) {
128
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
129 129
 			return $name=$value;
130 130
 		}
131 131
 		return $this;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	protected function addToMemberUnique(&$name, $value, $typeCtrl, $separator=" ") {
135 135
 		if (is_array($typeCtrl)) {
136 136
 			$this->removeOldValues($name, $typeCtrl);
137
-			$name.=$separator . $value;
137
+			$name.=$separator.$value;
138 138
 		}
139 139
 		return $this;
140 140
 	}
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 	}
157 157
 
158 158
 	protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") {
159
-		if ($this->ctrl($name, $value, $typeCtrl) === true) {
159
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
160 160
 			if (is_array($typeCtrl)) {
161 161
 				$this->removeOldValues($name, $typeCtrl);
162 162
 			}
163
-			$name.=$separator . $value;
163
+			$name.=$separator.$value;
164 164
 		}
165 165
 		return $this;
166 166
 	}
167 167
 
168 168
 	protected function addToMember(&$name, $value, $separator=" ") {
169
-		$name=str_ireplace($value, "", $name) . $separator . $value;
169
+		$name=str_ireplace($value, "", $name).$separator.$value;
170 170
 		return $this;
171 171
 	}
172 172
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	}
185 185
 
186 186
 	public function addToPropertyCtrlCheck($name, $value, $typeCtrl) {
187
-		if ($this->ctrl($name, $value, $typeCtrl) === true) {
187
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
188 188
 			return $this->addToProperty($name, $value);
189 189
 		}
190 190
 		return $this;
@@ -212,28 +212,28 @@  discard block
 block discarded – undo
212 212
 	}
213 213
 
214 214
 	public function fromArray($array) {
215
-		foreach ( $this as $key => $value ) {
215
+		foreach ($this as $key => $value) {
216 216
 			if (array_key_exists($key, $array) && !JString::startswith($key, "_")) {
217
-				$setter="set" . ucfirst($key);
217
+				$setter="set".ucfirst($key);
218 218
 				$this->$setter($array[$key]);
219 219
 				unset($array[$key]);
220 220
 			}
221 221
 		}
222
-		foreach ( $array as $key => $value ) {
222
+		foreach ($array as $key => $value) {
223 223
 			if (method_exists($this, $key)) {
224 224
 				try {
225 225
 					$this->$key($value);
226 226
 					unset($array[$key]);
227
-				} catch ( \Exception $e ) {
227
+				}catch (\Exception $e) {
228 228
 					// Nothing to do
229 229
 				}
230 230
 			} else {
231
-				$setter="set" . ucfirst($key);
231
+				$setter="set".ucfirst($key);
232 232
 				if (method_exists($this, $setter)) {
233 233
 					try {
234 234
 						$this->$setter($value);
235 235
 						unset($array[$key]);
236
-					} catch ( \Exception $e ) {
236
+					}catch (\Exception $e) {
237 237
 						// Nothing to do
238 238
 					}
239 239
 				}
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
 	public function fromDatabaseObjects($objects, $function) {
246 246
 		if (isset($objects)) {
247
-			foreach ( $objects as $object ) {
247
+			foreach ($objects as $object) {
248 248
 				$this->fromDatabaseObject($object, $function);
249 249
 			}
250 250
 		}
@@ -264,11 +264,11 @@  discard block
 block discarded – undo
264 264
 	}
265 265
 
266 266
 	public function addEvent($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
267
-		if ($stopPropagation === true) {
268
-			$jsCode="event.stopPropagation();" . $jsCode;
267
+		if ($stopPropagation===true) {
268
+			$jsCode="event.stopPropagation();".$jsCode;
269 269
 		}
270
-		if ($preventDefault === true) {
271
-			$jsCode="event.preventDefault();" . $jsCode;
270
+		if ($preventDefault===true) {
271
+			$jsCode="event.preventDefault();".$jsCode;
272 272
 		}
273 273
 		return $this->_addEvent($event, $jsCode);
274 274
 	}
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 			if (is_array($this->_events[$event])) {
279 279
 				$this->_events[$event][]=$jsCode;
280 280
 			} else {
281
-				$this->_events[$event]=array ($this->_events[$event],$jsCode );
281
+				$this->_events[$event]=array($this->_events[$event], $jsCode);
282 282
 			}
283 283
 		} else {
284 284
 			$this->_events[$event]=$jsCode;
@@ -298,35 +298,35 @@  discard block
 block discarded – undo
298 298
 		return $this->onClick($jsCode);
299 299
 	}
300 300
 
301
-	public function onCreate($jsCode){
302
-		if(isset($this->_events["_create"])){
301
+	public function onCreate($jsCode) {
302
+		if (isset($this->_events["_create"])) {
303 303
 			$this->_events["_create"][]=$jsCode;
304
-		}else{
304
+		} else {
305 305
 			$this->_events["_create"]=[$jsCode];
306 306
 		}
307 307
 		return $this;
308 308
 	}
309 309
 
310 310
 	public function addEventsOnRun(JsUtils $js) {
311
-		if(isset($this->_events["_create"])){
311
+		if (isset($this->_events["_create"])) {
312 312
 			$create=$this->_events["_create"];
313
-			if(\is_array($create)){
313
+			if (\is_array($create)) {
314 314
 				$create=\implode("", $create);
315 315
 			}
316
-			if($create!=="")
317
-				$js->exec($create,true);
316
+			if ($create!=="")
317
+				$js->exec($create, true);
318 318
 			unset($this->_events["_create"]);
319 319
 		}
320 320
 		if (isset($this->_bsComponent)) {
321
-			foreach ( $this->_events as $event => $jsCode ) {
321
+			foreach ($this->_events as $event => $jsCode) {
322 322
 				$code=$jsCode;
323 323
 				if (is_array($jsCode)) {
324 324
 					$code="";
325
-					foreach ( $jsCode as $jsC ) {
325
+					foreach ($jsCode as $jsC) {
326 326
 						if ($jsC instanceof AjaxCall) {
327
-							$code.="\n" . $jsC->compile($js);
327
+							$code.="\n".$jsC->compile($js);
328 328
 						} else {
329
-							$code.="\n" . $jsC;
329
+							$code.="\n".$jsC;
330 330
 						}
331 331
 					}
332 332
 				} elseif ($jsCode instanceof AjaxCall) {
@@ -334,12 +334,12 @@  discard block
 block discarded – undo
334 334
 				}
335 335
 				$this->_bsComponent->addEvent($event, $code);
336 336
 			}
337
-			$this->_events=array ();
337
+			$this->_events=array();
338 338
 		}
339 339
 	}
340 340
 
341 341
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
342
-		$params=array ("url" => $url,"responseElement" => $responseElement );
342
+		$params=array("url" => $url, "responseElement" => $responseElement);
343 343
 		$params=array_merge($params, $parameters);
344 344
 		$this->_addEvent($event, new AjaxCall($operation, $params));
345 345
 		return $this;
@@ -375,33 +375,33 @@  discard block
 block discarded – undo
375 375
 		if (is_array($elements)) {
376 376
 			$flag=false;
377 377
 			$index=0;
378
-			while ( !$flag && $index < sizeof($elements) ) {
378
+			while (!$flag && $index<sizeof($elements)) {
379 379
 				if ($elements[$index] instanceof BaseHtml)
380
-					$flag=($elements[$index]->getIdentifier() === $identifier);
380
+					$flag=($elements[$index]->getIdentifier()===$identifier);
381 381
 				$index++;
382 382
 			}
383
-			if ($flag === true)
384
-				return $elements[$index - 1];
383
+			if ($flag===true)
384
+				return $elements[$index-1];
385 385
 		} elseif ($elements instanceof BaseHtml) {
386
-			if ($elements->getIdentifier() === $identifier)
386
+			if ($elements->getIdentifier()===$identifier)
387 387
 				return $elements;
388 388
 		}
389 389
 		return null;
390 390
 	}
391 391
 
392
-	protected function getElementByPropertyValue($propertyName,$value, $elements) {
392
+	protected function getElementByPropertyValue($propertyName, $value, $elements) {
393 393
 		if (is_array($elements)) {
394 394
 			$flag=false;
395 395
 			$index=0;
396
-			while ( !$flag && $index < sizeof($elements) ) {
396
+			while (!$flag && $index<sizeof($elements)) {
397 397
 				if ($elements[$index] instanceof BaseHtml)
398
-					$flag=($elements[$index]->propertyContains($propertyName, $value) === true);
398
+					$flag=($elements[$index]->propertyContains($propertyName, $value)===true);
399 399
 					$index++;
400 400
 			}
401
-			if ($flag === true)
402
-				return $elements[$index - 1];
401
+			if ($flag===true)
402
+				return $elements[$index-1];
403 403
 		} elseif ($elements instanceof BaseHtml) {
404
-			if ($elements->propertyContains($propertyName, $value) === true)
404
+			if ($elements->propertyContains($propertyName, $value)===true)
405 405
 				return $elements;
406 406
 		}
407 407
 		return null;
@@ -423,14 +423,14 @@  discard block
 block discarded – undo
423 423
 		if (is_array($value)) {
424 424
 			$value=implode(",", $value);
425 425
 		}
426
-		if (strrpos($value, 'this') === false && strrpos($value, 'event') === false) {
427
-			$value='"' . $value . '"';
426
+		if (strrpos($value, 'this')===false && strrpos($value, 'event')===false) {
427
+			$value='"'.$value.'"';
428 428
 		}
429 429
 		return $value;
430 430
 	}
431 431
 
432 432
 	public function jsDoJquery($jqueryCall, $param="") {
433
-		return "$('#" . $this->identifier . "')." . $jqueryCall . "(" . $this->_prep_value($param) . ");";
433
+		return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");";
434 434
 	}
435 435
 
436 436
 	public function executeOnRun($jsCode) {
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/BaseTrait.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
  * @property string $identifier
13 13
  */
14 14
 trait BaseTrait {
15
-	protected $_variations=[ ];
16
-	protected $_states=[ ];
15
+	protected $_variations=[];
16
+	protected $_states=[];
17 17
 	protected $_baseClass;
18 18
 
19 19
 	protected abstract function setPropertyCtrl($name, $value, $typeCtrl);
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		$this->setProperty("class", $this->_baseClass);
44 44
 		if (\is_string($variations))
45 45
 			$variations=\explode(" ", $variations);
46
-		foreach ( $variations as $variation ) {
46
+		foreach ($variations as $variation) {
47 47
 			$this->addVariation($variation);
48 48
 		}
49 49
 		return $this;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	public function addVariations($variations=array()) {
58 58
 		if (\is_string($variations))
59 59
 			$variations=\explode(" ", $variations);
60
-		foreach ( $variations as $variation ) {
60
+		foreach ($variations as $variation) {
61 61
 			$this->addVariation($variation);
62 62
 		}
63 63
 		return $this;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	public function addStates($states=array()) {
67 67
 		if (\is_string($states))
68 68
 			$states=\explode(" ", $states);
69
-		foreach ( $states as $state ) {
69
+		foreach ($states as $state) {
70 70
 			$this->addState($state);
71 71
 		}
72 72
 		return $this;
@@ -76,17 +76,17 @@  discard block
 block discarded – undo
76 76
 		$this->setProperty("class", $this->_baseClass);
77 77
 		if (\is_string($states))
78 78
 			$states=\explode(" ", $states);
79
-		foreach ( $states as $state ) {
79
+		foreach ($states as $state) {
80 80
 			$this->addState($state);
81 81
 		}
82 82
 		return $this;
83 83
 	}
84 84
 
85 85
 	public function addIcon($icon, $before=true) {
86
-		return $this->addContent(new HtmlIcon("icon-" . $this->identifier, $icon), $before);
86
+		return $this->addContent(new HtmlIcon("icon-".$this->identifier, $icon), $before);
87 87
 	}
88 88
 
89
-	public function addSticky($context="body"){
89
+	public function addSticky($context="body") {
90 90
 		$this->onCreate("$('#".$this->identifier."').sticky({ context: '".$context."'});");
91 91
 		return $this;
92 92
 	}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 *
131 131
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
132 132
 	 */
133
-	public function asHeader(){
133
+	public function asHeader() {
134 134
 		return $this->addToProperty("class", "header");
135 135
 	}
136 136
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 * show it is currently the active user selection
139 139
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
140 140
 	 */
141
-	public function setActive($value=true){
141
+	public function setActive($value=true) {
142 142
 		return $this->addToProperty("class", "active");
143 143
 	}
144 144
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	}
155 155
 
156 156
 	public function setFloated($direction="right") {
157
-		return $this->addToPropertyCtrl("class", $direction . " floated", Direction::getConstantValues("floated"));
157
+		return $this->addToPropertyCtrl("class", $direction." floated", Direction::getConstantValues("floated"));
158 158
 	}
159 159
 
160 160
 	public function floatRight() {
Please login to merge, or discard this patch.
Ajax/semantic/html/base/HtmlSemDoubleElement.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	use BaseTrait;
22 22
 	protected $_popup=NULL;
23 23
 	protected $_dimmer=NULL;
24
-	protected $_params=array ();
24
+	protected $_params=array();
25 25
 
26 26
 
27 27
 	public function __construct($identifier, $tagName="p", $baseClass="ui", $content=NULL) {
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	}
52 52
 
53 53
 	public function addDimmer($params=array(), $content=NULL) {
54
-		$dimmer=new HtmlDimmer("dimmer-" . $this->identifier, $content);
54
+		$dimmer=new HtmlDimmer("dimmer-".$this->identifier, $content);
55 55
 		$dimmer->setParams($params);
56 56
 		$dimmer->setContainer($this);
57 57
 		$this->addContent($dimmer);
@@ -60,20 +60,20 @@  discard block
 block discarded – undo
60 60
 
61 61
 	public function addLabel($label, $before=false, $icon=NULL) {
62 62
 		$labelO=$label;
63
-		if (\is_object($label) === false) {
64
-			$labelO=new HtmlLabel("label-" . $this->identifier, $label);
63
+		if (\is_object($label)===false) {
64
+			$labelO=new HtmlLabel("label-".$this->identifier, $label);
65 65
 			if (isset($icon))
66 66
 				$labelO->addIcon($icon);
67 67
 		} else {
68
-			$labelO->addToPropertyCtrl("class", "label", array ("label" ));
68
+			$labelO->addToPropertyCtrl("class", "label", array("label"));
69 69
 		}
70 70
 		$this->addContent($labelO, $before);
71 71
 		return $labelO;
72 72
 	}
73 73
 
74
-	public function attachLabel($label,$side,$direction=Direction::NONE,$icon=NULL){
75
-		$label=$this->addLabel($label,true,$icon);
76
-		$label->setAttached($side,$direction);
74
+	public function attachLabel($label, $side, $direction=Direction::NONE, $icon=NULL) {
75
+		$label=$this->addLabel($label, true, $icon);
76
+		$label->setAttached($side, $direction);
77 77
 		return $this;
78 78
 	}
79 79
 
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 
90 90
 	public function jsShowDimmer($show=true) {
91 91
 		$status="hide";
92
-		if ($show === true)
92
+		if ($show===true)
93 93
 			$status="show";
94
-		return '$("#.' . $this->identifier . ').dimmer("' . $status . '");';
94
+		return '$("#.'.$this->identifier.').dimmer("'.$status.'");';
95 95
 	}
96 96
 
97 97
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	}
102 102
 
103 103
 	public function run(JsUtils $js) {
104
-		$this->_bsComponent=$js->semantic()->generic("#" . $this->identifier);
104
+		$this->_bsComponent=$js->semantic()->generic("#".$this->identifier);
105 105
 		parent::run($js);
106 106
 		$this->addEventsOnRun($js);
107 107
 		if (isset($this->_popup)) {
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlSearch.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@  discard block
 block discarded – undo
8 8
 use Ajax\semantic\html\base\constants\Direction;
9 9
 
10 10
 class HtmlSearch extends HtmlSemDoubleElement {
11
-	private $_elements=array ();
12
-	private $_searchFields=array ("title" );
11
+	private $_elements=array();
12
+	private $_searchFields=array("title");
13 13
 	private $_local=false;
14 14
 
15 15
 	public function __construct($identifier, $placeholder=NULL, $icon=NULL) {
16
-		parent::__construct("search-" . $identifier, "div", "ui search", array ());
16
+		parent::__construct("search-".$identifier, "div", "ui search", array());
17 17
 		$this->createField($placeholder, $icon);
18 18
 		$this->createResult();
19 19
 		$this->_params["type"]="standard";
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 
22 22
 	private function createField($placeholder=NULL, $icon=NULL) {
23 23
 		$field=new HtmlInput($this->identifier);
24
-		if (isset($placeholder) === true)
24
+		if (isset($placeholder)===true)
25 25
 			$field->setPlaceholder($placeholder);
26
-		if (isset($icon) === true)
26
+		if (isset($icon)===true)
27 27
 			$field->addIcon($icon, Direction::RIGHT);
28 28
 		$field->getField()->setClass("prompt");
29 29
 		$this->content["field"]=$field;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	}
32 32
 
33 33
 	private function createResult() {
34
-		$this->content["result"]=new HtmlSemDoubleElement("results-" . $this->identifier, "div", "results");
34
+		$this->content["result"]=new HtmlSemDoubleElement("results-".$this->identifier, "div", "results");
35 35
 		return $this->content["result"];
36 36
 	}
37 37
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 
50 50
 	public function setUrl($url) {
51
-		$this->_params["apiSettings"]="%{url: %quote%" . $url . "%quote%}%";
51
+		$this->_params["apiSettings"]="%{url: %quote%".$url."%quote%}%";
52 52
 		return $this;
53 53
 	}
54 54
 
@@ -71,16 +71,16 @@  discard block
 block discarded – undo
71 71
 	}
72 72
 
73 73
 	public function run(JsUtils $js) {
74
-		$this->_params["onSelect"]='%function(result,response){$(%quote%#' . $this->identifier . '%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%';
74
+		$this->_params["onSelect"]='%function(result,response){$(%quote%#'.$this->identifier.'%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%';
75 75
 		$searchFields=\json_encode($this->_searchFields);
76 76
 		$searchFields=str_ireplace("\"", "%quote%", $searchFields);
77
-		$this->_params["searchFields"]="%" . $searchFields . "%";
78
-		if ($this->_local === true) {
77
+		$this->_params["searchFields"]="%".$searchFields."%";
78
+		if ($this->_local===true) {
79 79
 			$this->_params["source"]="%content%";
80
-			$this->addEvent("beforeExecute", "var content=" . $this->resultsToJson() . ";");
80
+			$this->addEvent("beforeExecute", "var content=".$this->resultsToJson().";");
81 81
 		}
82
-		if (isset($this->_bsComponent) === false) {
83
-			$this->_bsComponent=$js->semantic()->search("#" . $this->identifier, $this->_params);
82
+		if (isset($this->_bsComponent)===false) {
83
+			$this->_bsComponent=$js->semantic()->search("#".$this->identifier, $this->_params);
84 84
 		}
85 85
 		$this->addEventsOnRun($js);
86 86
 		return $this->_bsComponent;
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDimmer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 	}
19 19
 
20 20
 	public function setContent($content) {
21
-		$this->content=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content));
21
+		$this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content));
22 22
 		return $this;
23 23
 	}
24 24
 
25 25
 	public function asIcon($icon, $title, $subHeader=NULL) {
26
-		$header=new HtmlHeader("header-" . $this->identifier);
26
+		$header=new HtmlHeader("header-".$this->identifier);
27 27
 		$header->asIcon($icon, $title, $subHeader);
28
-		if ($this->_inverted === false)
28
+		if ($this->_inverted===false)
29 29
 			$header->setInverted();
30 30
 		return $this->setContent($header);
31 31
 	}
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function run(JsUtils $js) {
44 44
 		if ($this->_container instanceof HtmlSingleElement)
45
-			$this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params);
45
+			$this->_bsComponent=$js->semantic()->dimmer("#".$this->_container->getIdentifier(), $this->_params);
46 46
 		return parent::run($js);
47 47
 	}
48 48
 
49 49
 	public function jsShow() {
50
-		if (isset($this->_container) === true)
51
-			return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");';
50
+		if (isset($this->_container)===true)
51
+			return '$("#.'.$this->_container->getIdentifier().').dimmer("show");';
52 52
 	}
53 53
 
54 54
 	public function setBlurring() {
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlProgress.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -12,22 +12,22 @@  discard block
 block discarded – undo
12 12
 
13 13
 	public function __construct($identifier, $value=NULL, $label=NULL, $attributes=array()) {
14 14
 		parent::__construct($identifier, "div", "ui progress");
15
-		if (isset($value) === true)
15
+		if (isset($value)===true)
16 16
 			$this->setProperty("data-percent", $value);
17 17
 		$this->createBar();
18
-		if (isset($label) === true)
18
+		if (isset($label)===true)
19 19
 			$this->setLabel($label);
20
-		$this->_states=[ State::SUCCESS,State::WARNING,State::ERROR,State::ACTIVE,State::DISABLED ];
20
+		$this->_states=[State::SUCCESS, State::WARNING, State::ERROR, State::ACTIVE, State::DISABLED];
21 21
 		$this->addToProperty("class", $attributes);
22 22
 	}
23 23
 
24 24
 	public function setLabel($label) {
25
-		$this->content["label"]=new HtmlSemDoubleElement("lbl-" . $this->identifier, "div", "label", $label);
25
+		$this->content["label"]=new HtmlSemDoubleElement("lbl-".$this->identifier, "div", "label", $label);
26 26
 		return $this;
27 27
 	}
28 28
 
29 29
 	private function createBar() {
30
-		$bar=new HtmlSemDoubleElement("bar-" . $this->identifier, "div", "bar", new HtmlSemDoubleElement("progress-" . $this->identifier, "div", "progress"));
30
+		$bar=new HtmlSemDoubleElement("bar-".$this->identifier, "div", "bar", new HtmlSemDoubleElement("progress-".$this->identifier, "div", "progress"));
31 31
 		$this->content["bar"]=$bar;
32 32
 		return $this;
33 33
 	}
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
64 64
 	 */
65 65
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
66
-		$this->content=JArray::sortAssociative($this->content, [ "bar","label" ]);
66
+		$this->content=JArray::sortAssociative($this->content, ["bar", "label"]);
67 67
 		return parent::compile($js, $view);
68 68
 	}
69 69
 
70 70
 	public function jsSetValue($value) {
71
-		return '$("#' . $this->identifier . '").progress({value:' . $value . '});';
71
+		return '$("#'.$this->identifier.'").progress({value:'.$value.'});';
72 72
 	}
73 73
 
74 74
 	public function jsIncValue() {
75
-		return '$("#' . $this->identifier . '").progress("increment");';
75
+		return '$("#'.$this->identifier.'").progress("increment");';
76 76
 	}
77 77
 
78 78
 	public function jsDecValue() {
79
-		return '$("#' . $this->identifier . '").progress("decrement");';
79
+		return '$("#'.$this->identifier.'").progress("decrement");';
80 80
 	}
81 81
 
82 82
 	/**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 * @return HtmlProgress
91 91
 	 */
92 92
 	public function setTextValues($active=false, $error=false, $success=false, $warning=false, $percent="{percent}%", $ratio="{value} of {total}") {
93
-		if (\is_array($active) == true) {
93
+		if (\is_array($active)==true) {
94 94
 			$array=$active;
95 95
 			$active=JArray::getDefaultValue($array, "active", false);
96 96
 			$success=JArray::getDefaultValue($array, "success", $success);
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 			$percent=JArray::getDefaultValue($array, "percent", $percent);
99 99
 			$ratio=JArray::getDefaultValue($array, "ratio", $ratio);
100 100
 		}
101
-		$this->_params["text"]="%{active  : " . \var_export($active, true) . ",error: " . \var_export($error, true) . ",success : " . \var_export($success, true) . ",warning : " . \var_export($warning, true) . ",percent : " . \var_export($percent, true) . ",ratio   : " . \var_export($ratio, true) . "}%";
101
+		$this->_params["text"]="%{active  : ".\var_export($active, true).",error: ".\var_export($error, true).",success : ".\var_export($success, true).",warning : ".\var_export($warning, true).",percent : ".\var_export($percent, true).",ratio   : ".\var_export($ratio, true)."}%";
102 102
 		return $this;
103 103
 	}
104 104
 
105 105
 	public function onChange($jsCode) {
106
-		return $this->_params["onChange"]="%function(percent, value, total){" . $jsCode . "}%";
106
+		return $this->_params["onChange"]="%function(percent, value, total){".$jsCode."}%";
107 107
 	}
108 108
 
109 109
 	/*
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 	 * @see BaseHtml::run()
112 112
 	 */
113 113
 	public function run(JsUtils $js) {
114
-		if (isset($this->_bsComponent) === false)
115
-			$this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params);
114
+		if (isset($this->_bsComponent)===false)
115
+			$this->_bsComponent=$js->semantic()->progress("#".$this->identifier, $this->_params);
116 116
 		$this->addEventsOnRun($js);
117 117
 		return $this->_bsComponent;
118 118
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlShape.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 use Ajax\common\html\BaseHtml;
9 9
 
10 10
 
11
-class HtmlShape extends HtmlSemCollection{
11
+class HtmlShape extends HtmlSemCollection {
12 12
 
13 13
 	protected $_params=array();
14 14
 	protected $_autoActive=true;
15 15
 
16
-	public function __construct( $identifier, $sides){
17
-		parent::__construct( $identifier, "div", "ui shape");
16
+	public function __construct($identifier, $sides) {
17
+		parent::__construct($identifier, "div", "ui shape");
18 18
 		$this->_template="<%tagName% id='%identifier%' %properties%><div class='sides'>%wrapContentBefore%%content%%wrapContentAfter%</div></%tagName%>";
19 19
 		$this->addItems($sides);
20 20
 	}
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 	 * {@inheritDoc}
24 24
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
25 25
 	 */
26
-	protected function createItem($value){
27
-		if(\is_object($value)===false){
28
-			$value=new HtmlSemDoubleElement("","div","content",$value);
26
+	protected function createItem($value) {
27
+		if (\is_object($value)===false) {
28
+			$value=new HtmlSemDoubleElement("", "div", "content", $value);
29 29
 		}
30 30
 		return new HtmlShapeItem("side-".$this->identifier."-".$this->count(), $value);
31 31
 	}
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * {@inheritDoc}
35 35
 	 * @see \Ajax\common\html\HtmlCollection::createCondition()
36 36
 	 */
37
-	protected function createCondition($value){
37
+	protected function createCondition($value) {
38 38
 		return ($value instanceof HtmlShapeItem)===false;
39 39
 	}
40 40
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 * @param int $index
43 43
 	 * @return \Ajax\semantic\html\content\HtmlShapeItem
44 44
 	 */
45
-	public function getSide($index){
45
+	public function getSide($index) {
46 46
 		return $this->getItem($index);
47 47
 	}
48 48
 
@@ -50,96 +50,96 @@  discard block
 block discarded – undo
50 50
 	 * @param int $index
51 51
 	 * @return mixed|NULL
52 52
 	 */
53
-	public function getSideContent($index){
54
-		$item= $this->getItem($index);
55
-		if(isset($item))
53
+	public function getSideContent($index) {
54
+		$item=$this->getItem($index);
55
+		if (isset($item))
56 56
 			return $item->getContent();
57 57
 		return null;
58 58
 	}
59 59
 
60
-	public function jsDo($action){
60
+	public function jsDo($action) {
61 61
 		return "$('#".$this->identifier."').shape('".$action."');";
62 62
 	}
63 63
 
64
-	public function jsFlipLeft(){
64
+	public function jsFlipLeft() {
65 65
 		return $this->jsDo("flip left");
66 66
 	}
67 67
 
68
-	public function jsFlipRight(){
68
+	public function jsFlipRight() {
69 69
 		return $this->jsDo("flip right");
70 70
 	}
71 71
 
72
-	public function jsFlipUp(){
72
+	public function jsFlipUp() {
73 73
 		return $this->jsDo("flip up");
74 74
 	}
75 75
 
76
-	public function jsFlipDown(){
76
+	public function jsFlipDown() {
77 77
 		return $this->jsDo("flip down");
78 78
 	}
79 79
 
80
-	public function jsFlipOver(){
80
+	public function jsFlipOver() {
81 81
 		return $this->jsDo("flip over");
82 82
 	}
83 83
 
84
-	public function jsFlipBack(){
84
+	public function jsFlipBack() {
85 85
 		return $this->jsDo("flip back");
86 86
 	}
87 87
 
88
-	private function doActionOn($element,$event,$what){
89
-		if($element instanceof BaseHtml){
90
-			return $element->on($event, $what,true,true);
88
+	private function doActionOn($element, $event, $what) {
89
+		if ($element instanceof BaseHtml) {
90
+			return $element->on($event, $what, true, true);
91 91
 		}
92 92
 	}
93 93
 
94
-	public function flipLeftOn($element,$event){
94
+	public function flipLeftOn($element, $event) {
95 95
 		return $this->doActionOn($element, $event, $this->jsFlipLeft());
96 96
 	}
97 97
 
98
-	public function flipRightOn($element,$event){
98
+	public function flipRightOn($element, $event) {
99 99
 		return $this->doActionOn($element, $event, $this->jsFlipRight());
100 100
 	}
101 101
 
102
-	public function flipUpOn($element,$event){
102
+	public function flipUpOn($element, $event) {
103 103
 		return $this->doActionOn($element, $event, $this->jsFlipUp());
104 104
 	}
105 105
 
106
-	public function flipDownOn($element,$event){
106
+	public function flipDownOn($element, $event) {
107 107
 		return $this->doActionOn($element, $event, $this->jsFlipDown());
108 108
 	}
109 109
 
110
-	public function flipBackOn($element,$event){
110
+	public function flipBackOn($element, $event) {
111 111
 		return $this->doActionOn($element, $event, $this->jsFlipBack());
112 112
 	}
113 113
 
114
-	public function flipOverOn($element,$event){
114
+	public function flipOverOn($element, $event) {
115 115
 		return $this->doActionOn($element, $event, $this->jsFlipOver());
116 116
 	}
117 117
 
118
-	public function setActiveSide($index){
118
+	public function setActiveSide($index) {
119 119
 		$side=$this->getSide($index);
120
-		if(isset($side)){
120
+		if (isset($side)) {
121 121
 			$side->setActive(true);
122 122
 		}
123 123
 		return $this;
124 124
 	}
125 125
 
126
-	public function asCube(){
126
+	public function asCube() {
127 127
 		return $this->addToPropertyCtrl("class", "cube", ["cube"]);
128 128
 	}
129 129
 
130
-	public function asText(){
130
+	public function asText() {
131 131
 		return $this->addToPropertyCtrl("class", "text", ["text"]);
132 132
 	}
133 133
 
134
-	public function setWidth($width="initial"){
134
+	public function setWidth($width="initial") {
135 135
 		$this->_params["width"]=$width;
136 136
 	}
137
-	public function onChange($jsCode){
138
-		return $this->_params["onChange"]="%function(){" . $jsCode . "}%";
137
+	public function onChange($jsCode) {
138
+		return $this->_params["onChange"]="%function(){".$jsCode."}%";
139 139
 	}
140 140
 
141
-	public function beforeChange($jsCode){
142
-		return $this->_params["beforeChange"]="%function(){" . $jsCode . "}%";
141
+	public function beforeChange($jsCode) {
142
+		return $this->_params["beforeChange"]="%function(){".$jsCode."}%";
143 143
 	}
144 144
 
145 145
 	/*
@@ -147,15 +147,15 @@  discard block
 block discarded – undo
147 147
 	 * @see BaseHtml::run()
148 148
 	 */
149 149
 	public function run(JsUtils $js) {
150
-		if (isset($this->_bsComponent) === false)
151
-			$this->_bsComponent=$js->semantic()->shape("#" . $this->identifier, $this->_params);
150
+		if (isset($this->_bsComponent)===false)
151
+			$this->_bsComponent=$js->semantic()->shape("#".$this->identifier, $this->_params);
152 152
 		$this->addEventsOnRun($js);
153 153
 		return $this->_bsComponent;
154 154
 	}
155 155
 
156 156
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
157
-		if($this->_autoActive)
157
+		if ($this->_autoActive)
158 158
 			$this->setActiveSide(0);
159
-		return parent::compile($js,$view);
159
+		return parent::compile($js, $view);
160 160
 	}
161 161
 }
162 162
\ No newline at end of file
Please login to merge, or discard this patch.