Completed
Push — master ( baf19c...6831db )
by Jean-Christophe
03:30
created
Ajax/php/cakephp/_JsUtils.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 		$viewVars=$view->viewVars;
14 14
 		if (isset($viewVars["q"]) === false) {
15 15
 			$controls=array ();
16
-		}else{
16
+		} else{
17 17
 			$controls=$viewVars["q"];
18 18
 		}
19 19
 		$controls[$identifier]=$content;
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlTab.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,8 +67,9 @@  discard block
 block discarded – undo
67 67
 		if($index<$menu->count()){
68 68
 			if(isset($this->content[$index])===false){
69 69
 				$this->content[$index]=$this->createSegment($index, $content, $menu->getItem($index)->getIdentifier());
70
-			}else
71
-				$this->content[$index]->setContent($content);
70
+			} else {
71
+							$this->content[$index]->setContent($content);
72
+			}
72 73
 		}
73 74
 		return $this;
74 75
 	}
@@ -228,15 +229,17 @@  discard block
 block discarded – undo
228 229
 	 * @see BaseHtml::run()
229 230
 	 */
230 231
 	public function run(JsUtils $js) {
231
-		if(isset($this->_bsComponent)===false)
232
-			$this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item",$this->params);
232
+		if(isset($this->_bsComponent)===false) {
233
+					$this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item",$this->params);
234
+		}
233 235
 			$this->addEventsOnRun($js);
234 236
 			return $this->_bsComponent;
235 237
 	}
236 238
 
237 239
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
238
-		if($this->content["menu"]->count()>0 && \sizeof($this->content)>1)
239
-			$this->activate(0);
240
+		if($this->content["menu"]->count()>0 && \sizeof($this->content)>1) {
241
+					$this->activate(0);
242
+		}
240 243
 		return parent::compile($js,$view);
241 244
 	}
242 245
 }
243 246
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/HtmlSemDoubleElement.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@  discard block
 block discarded – undo
32 32
 	}
33 33
 
34 34
 	public function setPopupAttributes($variation=NULL, $popupEvent=NULL) {
35
-		if (isset($this->_popup))
36
-			$this->_popup->setAttributes($variation, $popupEvent);
35
+		if (isset($this->_popup)) {
36
+					$this->_popup->setAttributes($variation, $popupEvent);
37
+		}
37 38
 	}
38 39
 
39 40
 	public function addPopup($title="", $content="", $variation=NULL, $params=array()) {
@@ -60,8 +61,9 @@  discard block
 block discarded – undo
60 61
 		$labelO=$label;
61 62
 		if (\is_object($label) === false) {
62 63
 			$labelO=new HtmlLabel("label-" . $this->identifier, $label);
63
-			if (isset($icon))
64
-				$labelO->addIcon($icon);
64
+			if (isset($icon)) {
65
+							$labelO->addIcon($icon);
66
+			}
65 67
 		} else {
66 68
 			$labelO->addToPropertyCtrl("class", "label", array ("label" ));
67 69
 		}
@@ -80,21 +82,24 @@  discard block
 block discarded – undo
80 82
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
81 83
 	 */
82 84
 	public function asLink($href=NULL) {
83
-		if (isset($href))
84
-			$this->setProperty("href", $href);
85
+		if (isset($href)) {
86
+					$this->setProperty("href", $href);
87
+		}
85 88
 		return $this->setTagName("a");
86 89
 	}
87 90
 
88 91
 	public function jsShowDimmer($show=true) {
89 92
 		$status="hide";
90
-		if ($show === true)
91
-			$status="show";
93
+		if ($show === true) {
94
+					$status="show";
95
+		}
92 96
 		return '$("#.' . $this->identifier . ').dimmer("' . $status . '");';
93 97
 	}
94 98
 
95 99
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
96
-	if (isset($this->_popup))
97
-			$this->_popup->compile($js);
100
+	if (isset($this->_popup)) {
101
+				$this->_popup->compile($js);
102
+	}
98 103
 		return parent::compile($js, $view);
99 104
 	}
100 105
 
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDropdown.php 1 patch
Braces   +28 added lines, -20 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		}
72 72
 		if(!$item instanceof HtmlDropdownItem){
73 73
 			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image,$description);
74
-		}elseif($itemO instanceof HtmlDropdownItem){
74
+		} elseif($itemO instanceof HtmlDropdownItem){
75 75
 			$this->addToProperty("class", "vertical");
76 76
 		}
77 77
 		return $itemO;
@@ -85,8 +85,9 @@  discard block
 block discarded – undo
85 85
 	}
86 86
 
87 87
 	public function addInput($name){
88
-		if(!isset($name))
89
-			$name="input-".$this->identifier;
88
+		if(!isset($name)) {
89
+					$name="input-".$this->identifier;
90
+		}
90 91
 		$this->setAction("activate");
91 92
 		$this->input=new HtmlInput($name,"hidden");
92 93
 	}
@@ -143,7 +144,7 @@  discard block
 block discarded – undo
143 144
 			foreach ($items as $k=>$v){
144 145
 				$this->addItem($v)->setData($k);
145 146
 			}
146
-		}else{
147
+		} else{
147 148
 			foreach ($items as $item){
148 149
 				$this->addItem($item);
149 150
 			}
@@ -167,7 +168,7 @@  discard block
 block discarded – undo
167 168
 		if($dropdown===false){
168 169
 			$this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php';
169 170
 			$dropdown="menu";
170
-		}else{
171
+		} else{
171 172
 			$dropdown="dropdown";
172 173
 			$this->mClass="menu";
173 174
 		}
@@ -187,20 +188,24 @@  discard block
 block discarded – undo
187 188
 	}
188 189
 
189 190
 	public function asButton($floating=false){
190
-		if($floating)
191
-			$this->addToProperty("class", "floating");
191
+		if($floating) {
192
+					$this->addToProperty("class", "floating");
193
+		}
192 194
 		$this->removePropertyValue("class", "selection");
193 195
 		return $this->addToProperty("class", "button");
194 196
 	}
195 197
 
196 198
 	public function asSelect($name=NULL,$multiple=false,$selection=true){
197
-		if(isset($name))
198
-			$this->addInput($name);
199
-		if($multiple)
200
-			$this->addToProperty("class", "multiple");
199
+		if(isset($name)) {
200
+					$this->addInput($name);
201
+		}
202
+		if($multiple) {
203
+					$this->addToProperty("class", "multiple");
204
+		}
201 205
 		if ($selection){
202
-			if($this->propertyContains("class", "button")===false)
203
-				$this->addToPropertyCtrl("class", "selection",array("selection"));
206
+			if($this->propertyContains("class", "button")===false) {
207
+							$this->addToPropertyCtrl("class", "selection",array("selection"));
208
+			}
204 209
 		}
205 210
 		return $this;
206 211
 	}
@@ -211,8 +216,9 @@  discard block
 block discarded – undo
211 216
 	}
212 217
 
213 218
 	public function setSelect($name=NULL,$multiple=false){
214
-		if(!isset($name))
215
-			$name="select-".$this->identifier;
219
+		if(!isset($name)) {
220
+					$name="select-".$this->identifier;
221
+		}
216 222
 		$this->input=null;
217 223
 		if($multiple){
218 224
 			$this->setProperty("multiple", true);
@@ -248,12 +254,13 @@  discard block
 block discarded – undo
248 254
 		$value=$this->value;
249 255
 		if(isset($this->input) && isset($value)){
250 256
 			$this->input->setProperty("value", $value);
251
-		}else{
257
+		} else{
252 258
 			$this->setProperty("value", $value);
253 259
 		}
254 260
 			$textElement=$this->getElementById("text-".$this->identifier, $this->content);
255
-			if(isset($textElement))
256
-				$textElement->setContent($value);
261
+			if(isset($textElement)) {
262
+							$textElement->setContent($value);
263
+			}
257 264
 		return $this;
258 265
 	}
259 266
 
@@ -263,8 +270,9 @@  discard block
 block discarded – undo
263 270
 	 */
264 271
 	public function run(JsUtils $js) {
265 272
 		if($this->propertyContains("class", "simple")===false){
266
-			if(isset($this->_bsComponent)===false)
267
-				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params);
273
+			if(isset($this->_bsComponent)===false) {
274
+							$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params);
275
+			}
268 276
 			$this->addEventsOnRun($js);
269 277
 			return $this->_bsComponent;
270 278
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlDropdownItem.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,12 +17,15 @@  discard block
 block discarded – undo
17 17
 		parent::__construct($identifier, "a");
18 18
 		$this->setClass("item");
19 19
 		$this->setContent($content);
20
-		if($value!==NULL)
21
-			$this->setData($value);
22
-		if($image!==NULL)
23
-			$this->asMiniAvatar($image);
24
-		if($description!==NULL)
25
-			$this->setDescription($description);
20
+		if($value!==NULL) {
21
+					$this->setData($value);
22
+		}
23
+		if($image!==NULL) {
24
+					$this->asMiniAvatar($image);
25
+		}
26
+		if($description!==NULL) {
27
+					$this->setDescription($description);
28
+		}
26 29
 	}
27 30
 
28 31
 	public function setDescription($description){
@@ -39,8 +42,9 @@  discard block
 block discarded – undo
39 42
 
40 43
 	public function asOption(){
41 44
 		$this->tagName="option";
42
-		if($this->getProperty("data-value")!==null)
43
-			$this->setProperty("value", $this->getProperty("data-value"));
45
+		if($this->getProperty("data-value")!==null) {
46
+					$this->setProperty("value", $this->getProperty("data-value"));
47
+		}
44 48
 	}
45 49
 
46 50
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlShape.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,8 +51,9 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	public function getSideContent($index){
53 53
 		$item= $this->getItem($index);
54
-		if(isset($item))
55
-			return $item->getContent();
54
+		if(isset($item)) {
55
+					return $item->getContent();
56
+		}
56 57
 		return null;
57 58
 	}
58 59
 
@@ -85,15 +86,17 @@  discard block
 block discarded – undo
85 86
 	 * @see BaseHtml::run()
86 87
 	 */
87 88
 	public function run(JsUtils $js) {
88
-		if (isset($this->_bsComponent) === false)
89
-			$this->_bsComponent=$js->semantic()->shape("#" . $this->identifier, $this->_params);
89
+		if (isset($this->_bsComponent) === false) {
90
+					$this->_bsComponent=$js->semantic()->shape("#" . $this->identifier, $this->_params);
91
+		}
90 92
 		$this->addEventsOnRun($js);
91 93
 		return $this->_bsComponent;
92 94
 	}
93 95
 
94 96
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
95
-		if($this->_autoActive)
96
-			$this->setActiveSide(0);
97
+		if($this->_autoActive) {
98
+					$this->setActiveSide(0);
99
+		}
97 100
 		return parent::compile($js,$view);
98 101
 	}
99 102
 }
100 103
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlButtonGroups.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@  discard block
 block discarded – undo
15 15
 
16 16
 	public function __construct($identifier, $elements=array(), $asIcons=false) {
17 17
 		parent::__construct($identifier, "div", "ui buttons");
18
-		if ($asIcons === true)
19
-			$this->asIcons();
18
+		if ($asIcons === true) {
19
+					$this->asIcons();
20
+		}
20 21
 		$this->addElements($elements, $asIcons);
21 22
 	}
22 23
 	protected function createItem($value){
@@ -26,8 +27,9 @@  discard block
 block discarded – undo
26 27
 
27 28
 	public function addElement($element, $asIcon=false) {
28 29
 		$item=$this->addItem($element);
29
-		if($asIcon)
30
-			$item->asIcon($element);
30
+		if($asIcon) {
31
+					$item->asIcon($element);
32
+		}
31 33
 		return $item;
32 34
 	}
33 35
 
@@ -55,8 +57,9 @@  discard block
 block discarded – undo
55 57
 
56 58
 	public function asIcons() {
57 59
 		foreach ( $this->content as $item ) {
58
-			if($item instanceof HtmlButton)
59
-			$item->asIcon($item->getContent());
60
+			if($item instanceof HtmlButton) {
61
+						$item->asIcon($item->getContent());
62
+			}
60 63
 		}
61 64
 		return $this->addToProperty("class", "icons");
62 65
 	}
Please login to merge, or discard this patch.
Ajax/semantic/traits/SemanticHtmlCollectionsTrait.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,8 +31,9 @@
 block discarded – undo
31 31
 	 */
32 32
 	public function htmlMessage($identifier, $content="",$styles=NULL) {
33 33
 		$msg= $this->addHtmlComponent(new HtmlMessage($identifier, $content));
34
-		if(isset($msg))
35
-			$msg->setStyle($styles);
34
+		if(isset($msg)) {
35
+					$msg->setStyle($styles);
36
+		}
36 37
 		return $msg;
37 38
 	}
38 39
 
Please login to merge, or discard this patch.
Ajax/semantic/components/validation/FieldValidation.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,15 +43,16 @@
 block discarded – undo
43 43
 	}
44 44
 
45 45
 	public function addRule($type,$prompt=NULL,$value=NULL){
46
-		if($type instanceof  Rule)
47
-			$this->rules[]=$type;
48
-		else if(\is_array($type)){
46
+		if($type instanceof  Rule) {
47
+					$this->rules[]=$type;
48
+		} else if(\is_array($type)){
49 49
 			$value=JArray::getValue($type, "value", 2);
50 50
 			$prompt=JArray::getValue($type, "prompt", 1);
51 51
 			$type=JArray::getValue($type, "type", 0);
52 52
 			$this->rules[]=new Rule($type,$prompt,$value);
53
-		}else
54
-			$this->rules[]=new Rule($type,$prompt,$value);
53
+		} else {
54
+					$this->rules[]=new Rule($type,$prompt,$value);
55
+		}
55 56
 	}
56 57
 
57 58
 	public function jsonSerialize(){
Please login to merge, or discard this patch.