Completed
Push — master ( 9e0835...2461e8 )
by Jean-Christophe
03:27
created
Ajax/semantic/html/collections/HtmlGrid.php 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -49,8 +49,9 @@  discard block
 block discarded – undo
49 49
 	public function addCol($width=NULL){
50 50
 		$colCount=$this->colCount()+1;
51 51
 		$this->setColsCount($colCount,true,$width);
52
-		if($this->hasOnlyCols($this->count()))
53
-			return $this->content[$colCount-1];
52
+		if($this->hasOnlyCols($this->count())) {
53
+					return $this->content[$colCount-1];
54
+		}
54 55
 		return $this;
55 56
 	}
56 57
 
@@ -73,7 +74,7 @@  discard block
 block discarded – undo
73 74
 			for($i=$count;$i<$colsCount;$i++){
74 75
 				$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i));
75 76
 			}
76
-		}else{
77
+		} else{
77 78
 			if($this->hasOnlyCols($count)){
78 79
 				$tmpContent=$this->content;
79 80
 				$item=$this->addItem($colsCount);
@@ -93,15 +94,16 @@  discard block
 block discarded – undo
93 94
 	}
94 95
 
95 96
 	public function setColsCount($numCols,$toCreate=true,$width=NULL){
96
-		if(isset($width)===false)
97
-			$this->setWide($numCols);
97
+		if(isset($width)===false) {
98
+					$this->setWide($numCols);
99
+		}
98 100
 		if($toCreate==true){
99 101
 			$count=$this->count();
100 102
 			if($count==0 || $this->hasOnlyCols($count)){
101 103
 				for($i=$count;$i<$numCols;$i++){
102 104
 					$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i,$width));
103 105
 				}
104
-			}else{
106
+			} else{
105 107
 				for($i=0;$i<$count;$i++){
106 108
 					$this->getItem($i)->setColsCount($numCols);
107 109
 				}
@@ -121,17 +123,20 @@  discard block
 block discarded – undo
121 123
 
122 124
 	public function rowCount(){
123 125
 		$count=$this->count();
124
-		if($this->hasOnlyCols($count))
125
-			return 0;
126
+		if($this->hasOnlyCols($count)) {
127
+					return 0;
128
+		}
126 129
 		return $count;
127 130
 	}
128 131
 
129 132
 	public function colCount(){
130 133
 		$count=$this->count();
131
-		if($this->hasOnlyCols($count))
132
-			return $count;
133
-		if($count>0)
134
-			return $this->getItem(0)->count();
134
+		if($this->hasOnlyCols($count)) {
135
+					return $count;
136
+		}
137
+		if($count>0) {
138
+					return $this->getItem(0)->count();
139
+		}
135 140
 		return 0;
136 141
 	}
137 142
 
@@ -141,8 +146,9 @@  discard block
 block discarded – undo
141 146
 	 * @return \Ajax\semantic\html\collections\HtmlGridCol
142 147
 	 */
143 148
 	public function getCell($row,$col){
144
-		if($row<2 && $this->hasOnlyCols($this->count()))
145
-			return $this->getItem($col);
149
+		if($row<2 && $this->hasOnlyCols($this->count())) {
150
+					return $this->getItem($col);
151
+		}
146 152
 		$row=$this->getItem($row);
147 153
 		if(isset($row)){
148 154
 			$col=$row->getItem($col);
@@ -191,8 +197,9 @@  discard block
 block discarded – undo
191 197
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
192 198
 	 */
193 199
 	public function setPadded($value=NULL){
194
-		if(isset($value))
195
-			$this->addToPropertyCtrl("class", $value,array("vertically","horizontally"));
200
+		if(isset($value)) {
201
+					$this->addToPropertyCtrl("class", $value,array("vertically","horizontally"));
202
+		}
196 203
 		return $this->addToProperty("class", "padded");
197 204
 	}
198 205
 
@@ -214,8 +221,9 @@  discard block
 block discarded – undo
214 221
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
215 222
 	 */
216 223
 	protected function createItem($value){
217
-		if($this->_createCols===false)
218
-			$value=null;
224
+		if($this->_createCols===false) {
225
+					$value=null;
226
+		}
219 227
 		$item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing,$this->_implicitRows);
220 228
 		return $item;
221 229
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormRadio.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,9 +14,11 @@
 block discarded – undo
14 14
 		parent::__construct($identifier, $name,$label,$value,$type);
15 15
 		$this->_input->getField()->setProperty("type", "radio");
16 16
 		$this->_input->setClass("ui radio checkbox");
17
-		if(isset($name))
18
-			$this->_input->getField()->setProperty("name", $name);
19
-		if(isset($type))
20
-			$this->setType($type);
17
+		if(isset($name)) {
18
+					$this->_input->getField()->setProperty("name", $name);
19
+		}
20
+		if(isset($type)) {
21
+					$this->setType($type);
22
+		}
21 23
 	}
22 24
 }
23 25
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormCheckbox.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@
 block discarded – undo
12 12
 	public function __construct($identifier, $label=NULL,$value=NULL,$type=NULL) {
13 13
 		parent::__construct($identifier, NULL,$label,$value,$type);
14 14
 		$this->_input->setClass("ui checkbox");
15
-		if(isset($type))
16
-			$this->setType($type);
15
+		if(isset($type)) {
16
+					$this->setType($type);
17
+		}
17 18
 	}
18 19
 }
19 20
\ No newline at end of file
Please login to merge, or discard this patch.
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/elements/HtmlList.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
 		if(\is_array($value)){
23 23
 			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]);
24 24
 			$item->addIcon($value[1]);
25
-		}else
26
-			$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
25
+		} else {
26
+					$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
27
+		}
27 28
 		return $item;
28 29
 	}
29 30
 
@@ -86,7 +87,7 @@  discard block
 block discarded – undo
86 87
 			$list=new HtmlList("",$fields);
87 88
 			$list->setClass("list");
88 89
 			$masterO->addContent($list);
89
-		}else{
90
+		} else{
90 91
 			$this->addList($fields);
91 92
 		}
92 93
 		$this->_hasCheckedList=true;
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormFields.php 1 patch
Braces   +15 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,11 +29,14 @@  discard block
 block discarded – undo
29 29
 				if(\is_string($end)){
30 30
 					$label=$end;
31 31
 					\array_pop($fields);
32
-				}else $label=NULL;
32
+				} else {
33
+					$label=NULL;
34
+				}
33 35
 			}
34 36
 		}
35
-		if(isset($label))
36
-			$this->setLabel($label);
37
+		if(isset($label)) {
38
+					$this->setLabel($label);
39
+		}
37 40
 		foreach ($fields as $field){
38 41
 			$this->addItem($field);
39 42
 		}
@@ -61,8 +64,9 @@  discard block
 block discarded – undo
61 64
 		if($this->_equalWidth){
62 65
 			$count=$this->count();
63 66
 			$this->addToProperty("class", Wide::getConstants()["W".$count]." fields");
64
-		}else
65
-			$this->addToProperty("class","fields");
67
+		} else {
68
+					$this->addToProperty("class","fields");
69
+		}
66 70
 		return parent::compile($js,$view);
67 71
 	}
68 72
 
@@ -102,8 +106,9 @@  discard block
 block discarded – undo
102 106
 			$fields[]=$itemO;
103 107
 		}
104 108
 		$radios=new HtmlFormFields("fields-".$name,$fields);
105
-		if(isset($label))
106
-			$radios->setLabel($label)->setProperty("for", $name);
109
+		if(isset($label)) {
110
+					$radios->setLabel($label)->setProperty("for", $name);
111
+		}
107 112
 		return $radios;
108 113
 	}
109 114
 
@@ -118,8 +123,9 @@  discard block
 block discarded – undo
118 123
 			$fields[]=$itemO;
119 124
 		}
120 125
 		$radios=new HtmlFormFields("fields-".$name,$fields);
121
-		if(isset($label))
122
-			$radios->setLabel($label)->setProperty("for", $name);
126
+		if(isset($label)) {
127
+					$radios->setLabel($label)->setProperty("for", $name);
128
+		}
123 129
 			return $radios;
124 130
 	}
125 131
 
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/common/components/SimpleComponent.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,8 +23,9 @@  discard block
 block discarded – undo
23 23
 		foreach ( $this->events as $event => $jsCode ) {
24 24
 			if($event=="execute"){
25 25
 				$this->jquery_code_for_compile []=$jsCode;
26
-			}else
27
-			$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
26
+			} else {
27
+						$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
28
+			}
28 29
 		}
29 30
 	}
30 31
 
@@ -67,8 +68,9 @@  discard block
 block discarded – undo
67 68
 
68 69
 	protected function setParamCtrl($key, $value, $typeCtrl) {
69 70
 		if (is_array($typeCtrl)) {
70
-			if (array_search($value, $typeCtrl)===false)
71
-				throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
71
+			if (array_search($value, $typeCtrl)===false) {
72
+							throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
73
+			}
72 74
 		} else {
73 75
 			if (!$typeCtrl($value)) {
74 76
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName);
Please login to merge, or discard this patch.