Completed
Push — master ( b3a3fe...f04c22 )
by Jean-Christophe
04:06
created
Ajax/semantic/html/collections/form/HtmlFormInput.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,9 @@
 block discarded – undo
9 9
 	use TextFieldsTrait;
10 10
 
11 11
 	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
12
-		if(!isset($placeholder) && $type==="text")
13
-			$placeholder=$label;
12
+		if(!isset($placeholder) && $type==="text") {
13
+					$placeholder=$label;
14
+		}
14 15
 		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
15 16
 	}
16 17
 
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
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		$itemO=$item;
64 64
 		if(!$item instanceof HtmlDropdownItem){
65 65
 			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image);
66
-		}elseif($itemO instanceof HtmlDropdownItem){
66
+		} elseif($itemO instanceof HtmlDropdownItem){
67 67
 			$this->addToProperty("class", "vertical");
68 68
 		}
69 69
 		return $itemO;
@@ -77,8 +77,9 @@  discard block
 block discarded – undo
77 77
 	}
78 78
 
79 79
 	public function addInput($name){
80
-		if(!isset($name))
81
-			$name="input-".$this->identifier;
80
+		if(!isset($name)) {
81
+					$name="input-".$this->identifier;
82
+		}
82 83
 		$this->setAction("activate");
83 84
 		$this->input=new HtmlInput($name,"hidden");
84 85
 	}
@@ -88,7 +89,7 @@  discard block
 block discarded – undo
88 89
 			foreach ($items as $k=>$v){
89 90
 				$this->addItem($v)->setData($k);
90 91
 			}
91
-		}else{
92
+		} else{
92 93
 			foreach ($items as $item){
93 94
 				$this->addItem($item);
94 95
 			}
@@ -105,7 +106,7 @@  discard block
 block discarded – undo
105 106
 		if($dropdown===false){
106 107
 			$this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php';
107 108
 			$dropdown="menu";
108
-		}else{
109
+		} else{
109 110
 			$dropdown="dropdown";
110 111
 			$this->mClass="menu";
111 112
 		}
@@ -121,18 +122,22 @@  discard block
 block discarded – undo
121 122
 	}
122 123
 
123 124
 	public function asButton($floating=false){
124
-		if($floating)
125
-			$this->addToProperty("class", "floating");
125
+		if($floating) {
126
+					$this->addToProperty("class", "floating");
127
+		}
126 128
 		return $this->addToProperty("class", "button");
127 129
 	}
128 130
 
129 131
 	public function asSelect($name=NULL,$multiple=false,$selection=true){
130
-		if(isset($name))
131
-			$this->addInput($name);
132
-		if($multiple)
133
-			$this->addToProperty("class", "multiple");
134
-		if ($selection)
135
-			$this->addToPropertyCtrl("class", "selection",array("selection"));
132
+		if(isset($name)) {
133
+					$this->addInput($name);
134
+		}
135
+		if($multiple) {
136
+					$this->addToProperty("class", "multiple");
137
+		}
138
+		if ($selection) {
139
+					$this->addToPropertyCtrl("class", "selection",array("selection"));
140
+		}
136 141
 		return $this;
137 142
 	}
138 143
 
@@ -142,8 +147,9 @@  discard block
 block discarded – undo
142 147
 	}
143 148
 
144 149
 	public function setSelect($name=NULL,$multiple=false){
145
-		if(!isset($name))
146
-			$name="select-".$this->identifier;
150
+		if(!isset($name)) {
151
+					$name="select-".$this->identifier;
152
+		}
147 153
 		$this->input=null;
148 154
 		if($multiple){
149 155
 			$this->setProperty("multiple", true);
@@ -174,12 +180,13 @@  discard block
 block discarded – undo
174 180
 	public function setValue($value){
175 181
 		if(isset($this->input)){
176 182
 			$this->input->setProperty("value", $value);
177
-		}else{
183
+		} else{
178 184
 			$this->setProperty("value", $value);
179 185
 		}
180 186
 		$textElement=$this->getElementById("text-".$this->identifier, $this->content);
181
-		if(isset($textElement))
182
-			$textElement->setContent($value);
187
+		if(isset($textElement)) {
188
+					$textElement->setContent($value);
189
+		}
183 190
 		return $this;
184 191
 	}
185 192
 
@@ -189,8 +196,9 @@  discard block
 block discarded – undo
189 196
 	 */
190 197
 	public function run(JsUtils $js) {
191 198
 		if($this->propertyContains("class", "simple")===false){
192
-			if(isset($this->_bsComponent)===false)
193
-				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params);
199
+			if(isset($this->_bsComponent)===false) {
200
+							$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params);
201
+			}
194 202
 			$this->addEventsOnRun($js);
195 203
 			return $this->_bsComponent;
196 204
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlReveal.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 		}
24 24
 		if($content instanceof HtmlSemDoubleElement){
25 25
 			$content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content);
26
-		}elseif ($content instanceof HtmlImg){
26
+		} elseif ($content instanceof HtmlImg){
27 27
 			$this->addToPropertyCtrl("class", "image", array("image"));
28 28
 		}
29 29
 		$content->addToProperty("class",(($index===0)?"visible":"hidden")." content");
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlStep.php 1 patch
Braces   +14 added lines, -11 removed lines patch added patch discarded remove patch
@@ -54,26 +54,29 @@
 block discarded – undo
54 54
 			for($i=0;$i<$count;$i++){
55 55
 				$step=$this->content[$i];
56 56
 				$step->removeStatus();
57
-				if($i<$activestep)
58
-					$step->setCompleted();
59
-				elseif ($i===$activestep)
60
-					$step->setActive();
61
-				else
62
-					$step->setDisabled();
57
+				if($i<$activestep) {
58
+									$step->setCompleted();
59
+				} elseif ($i===$activestep) {
60
+									$step->setActive();
61
+				} else {
62
+									$step->setDisabled();
63
+				}
63 64
 			}
64
-		}else{
65
+		} else{
65 66
 			foreach ($this->content as $step){
66 67
 				$step->removeStatus();
67 68
 			}
68
-			if($activestep<$count)
69
-				$this->content[$activestep]->setActive();
69
+			if($activestep<$count) {
70
+							$this->content[$activestep]->setActive();
71
+			}
70 72
 		}
71 73
 		return $this;
72 74
 	}
73 75
 
74 76
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
75
-		if(isset($this->_activeStep)===true && \is_numeric($this->_activeStep))
76
-			$this->defineActiveStep();
77
+		if(isset($this->_activeStep)===true && \is_numeric($this->_activeStep)) {
78
+					$this->defineActiveStep();
79
+		}
77 80
 		return parent::compile($js,$view);
78 81
 	}
79 82
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlStepItem.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 				$title=JArray::getValue($content, "title",1);
19 19
 				$desc=JArray::getValue($content, "description",2);
20 20
 				$status=JArray::getValue($content, "status",3);
21
-			}else{
21
+			} else{
22 22
 				$icon=@$content["icon"];
23 23
 				$title=@$content["title"];
24 24
 				$desc=@$content["description"];
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 			if(isset($title)===true){
34 34
 				$this->setTitle($title,$desc);
35 35
 			}
36
-		}else{
36
+		} else{
37 37
 			$this->setContent($content);
38 38
 		}
39 39
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlHeader.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@
 block discarded – undo
18 18
 		if (isset($type)) {
19 19
 			if ($type=="page") {
20 20
 				$this->asPageHeader($niveau);
21
-			} else
22
-				$this->asContentHeader($niveau);
21
+			} else {
22
+							$this->asContentHeader($niveau);
23
+			}
23 24
 		}
24 25
 		$this->content=$content;
25 26
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormFields.php 1 patch
Braces   +15 added lines, -10 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
 		}
@@ -65,8 +67,9 @@  discard block
 block discarded – undo
65 67
 		if ($this->_equalWidth) {
66 68
 			$count=$this->count();
67 69
 			$this->addToProperty("class", Wide::getConstants()["W".$count]." fields");
68
-		} else
69
-			$this->addToProperty("class", "fields");
70
+		} else {
71
+					$this->addToProperty("class", "fields");
72
+		}
70 73
 		return parent::compile($js, $view);
71 74
 	}
72 75
 
@@ -106,8 +109,9 @@  discard block
 block discarded – undo
106 109
 			$fields[]=$itemO;
107 110
 		}
108 111
 		$radios=new HtmlFormFields("fields-".$name, $fields);
109
-		if (isset($label))
110
-			$radios->setLabel($label)->setProperty("for", $name);
112
+		if (isset($label)) {
113
+					$radios->setLabel($label)->setProperty("for", $name);
114
+		}
111 115
 		return $radios;
112 116
 	}
113 117
 
@@ -122,8 +126,9 @@  discard block
 block discarded – undo
122 126
 			$fields[]=$itemO;
123 127
 		}
124 128
 		$radios=new HtmlFormFields("fields-".$name, $fields);
125
-		if (isset($label))
126
-			$radios->setLabel($label)->setProperty("for", $name);
129
+		if (isset($label)) {
130
+					$radios->setLabel($label)->setProperty("for", $name);
131
+		}
127 132
 		return $radios;
128 133
 	}
129 134
 
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/checkbox/AbstractCheckbox.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,8 +13,9 @@  discard block
 block discarded – undo
13 13
 		$field=new \Ajax\common\html\html5\HtmlInput($identifier, $inputType, $value);
14 14
 		$field->setProperty("name", $name);
15 15
 		$this->setField($field);
16
-		if (isset($label))
17
-			$this->setLabel($label);
16
+		if (isset($label)) {
17
+					$this->setLabel($label);
18
+		}
18 19
 	}
19 20
 
20 21
 	public function setType($checkboxType) {
@@ -40,8 +41,9 @@  discard block
 block discarded – undo
40 41
 	 * @return mixed
41 42
 	 */
42 43
 	public function getLabel() {
43
-		if (\array_key_exists("label", $this->content))
44
-			return $this->content["label"];
44
+		if (\array_key_exists("label", $this->content)) {
45
+					return $this->content["label"];
46
+		}
45 47
 	}
46 48
 
47 49
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/menus/HtmlMenu.php 1 patch
Braces   +11 added lines, -9 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	private function afterInsert($item) {
58
-		if (!$item instanceof HtmlMenu)
59
-			$item->addToPropertyCtrl("class", "item", array ("item" ));
60
-		else {
58
+		if (!$item instanceof HtmlMenu) {
59
+					$item->addToPropertyCtrl("class", "item", array ("item" ));
60
+		} else {
61 61
 			$this->setSecondary();
62 62
 		}
63 63
 		return $item;
@@ -155,8 +155,9 @@  discard block
 block discarded – undo
155 155
 		$this->apply(function (HtmlDoubleElement &$item) {
156 156
 			$item->setTagName("a");
157 157
 		});
158
-		if ($vertical === true)
159
-			$this->setVertical();
158
+		if ($vertical === true) {
159
+					$this->setVertical();
160
+		}
160 161
 		return $this->addToProperty("class", "tabular");
161 162
 	}
162 163
 
@@ -185,10 +186,11 @@  discard block
 block discarded – undo
185 186
 	 */
186 187
 	public function fromDatabaseObject($object, $function) {
187 188
 		$return=$function($object);
188
-		if (\is_array($return))
189
-			$this->addItems($return);
190
-		else
191
-			$this->addItem($return);
189
+		if (\is_array($return)) {
190
+					$this->addItems($return);
191
+		} else {
192
+					$this->addItem($return);
193
+		}
192 194
 	}
193 195
 
194 196
 	/**
Please login to merge, or discard this patch.