Completed
Push — master ( d88325...fa0c00 )
by Jean-Christophe
03:31
created
Ajax/semantic/traits/SemanticComponentsTrait.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -47,6 +47,9 @@
 block discarded – undo
47 47
 		return $this->addComponent(new Accordion($this->js), $attachTo, $params);
48 48
 	}
49 49
 
50
+	/**
51
+	 * @param string $attachTo
52
+	 */
50 53
 	public function sticky($attachTo=NULL, $params=NULL) {
51 54
 		return $this->addComponent(new Sticky($this->js), $attachTo, $params);
52 55
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlSticky.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 class HtmlSticky extends HtmlSemDoubleElement {
9 9
 	private $_params=array();
10 10
 
11
-	public function __construct($identifier,$context=NULL,$content=NULL) {
11
+	public function __construct($identifier, $context=NULL, $content=NULL) {
12 12
 		parent::__construct($identifier, "div", "ui sticky", $content);
13
-		if(isset($content))
13
+		if (isset($content))
14 14
 			$this->setContext($context);
15 15
 	}
16 16
 
17
-	public function setContext($context){
17
+	public function setContext($context) {
18 18
 		$this->_params["context"]=$context;
19 19
 		return $this;
20 20
 	}
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 	 * {@inheritDoc}
24 24
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
25 25
 	 */
26
-	public function run(JsUtils $js){
26
+	public function run(JsUtils $js) {
27 27
 		parent::run($js);
28
-		return $js->semantic()->sticky("#".$this->identifier,$this->_params);
28
+		return $js->semantic()->sticky("#".$this->identifier, $this->_params);
29 29
 	}
30 30
 }
31 31
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,9 @@
 block discarded – undo
10 10
 
11 11
 	public function __construct($identifier,$context=NULL,$content=NULL) {
12 12
 		parent::__construct($identifier, "div", "ui sticky", $content);
13
-		if(isset($content))
14
-			$this->setContext($context);
13
+		if(isset($content)) {
14
+					$this->setContext($context);
15
+		}
15 16
 	}
16 17
 
17 18
 	public function setContext($context){
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlGrid.php 3 patches
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.
Doc Comments   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,6 +22,10 @@  discard block
 block discarded – undo
22 22
 	private $_colSizing=true;
23 23
 	private $_implicitRows=false;
24 24
 
25
+	/**
26
+	 * @param string $identifier
27
+	 * @param integer $numCols
28
+	 */
25 29
 	public function __construct( $identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){
26 30
 		parent::__construct( $identifier, "div","ui grid");
27 31
 		$this->_implicitRows=$implicitRows;
@@ -148,7 +152,7 @@  discard block
 block discarded – undo
148 152
 	/**
149 153
 	 * return the row at $index
150 154
 	 * @param int $index
151
-	 * @return \Ajax\semantic\html\collections\HtmlGridRow
155
+	 * @return \Ajax\common\html\HtmlDoubleElement
152 156
 	 */
153 157
 	public function getRow($index){
154 158
 		return $this->getItem($index);
@@ -284,7 +288,7 @@  discard block
 block discarded – undo
284 288
 
285 289
 	/**
286 290
 	 * stretch the row contents to take up the entire column height
287
-	 * @return \Ajax\semantic\html\content\HtmlGridRow
291
+	 * @return HtmlGrid
288 292
 	 */
289 293
 	public function setStretched(){
290 294
 		return $this->addToProperty("class", "stretched");
Please login to merge, or discard this patch.
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -16,26 +16,26 @@  discard block
 block discarded – undo
16 16
  * @author jc
17 17
  * @version 1.001
18 18
  */
19
-class HtmlGrid extends HtmlSemCollection{
19
+class HtmlGrid extends HtmlSemCollection {
20 20
 	use TextAlignmentTrait;
21 21
 	private $_createCols;
22 22
 	private $_colSizing=true;
23 23
 	private $_implicitRows=false;
24 24
 
25
-	public function __construct( $identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){
26
-		parent::__construct( $identifier, "div","ui grid");
25
+	public function __construct($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) {
26
+		parent::__construct($identifier, "div", "ui grid");
27 27
 		$this->_implicitRows=$implicitRows;
28 28
 		$this->_createCols=$createCols;
29
-		if(isset($numCols)){
29
+		if (isset($numCols)) {
30 30
 			//if($this->_createCols){
31 31
 				$this->_colSizing=false;
32 32
 			//}
33 33
 			$this->setWide($numCols);
34 34
 		}
35
-		$this->setRowsCount($numRows,$numCols);
35
+		$this->setRowsCount($numRows, $numCols);
36 36
 	}
37 37
 
38
-	public function asSegment(){
38
+	public function asSegment() {
39 39
 		return $this->addToPropertyCtrl("class", "segment", array("segment"));
40 40
 	}
41 41
 
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 	 * Defines the grid width (alias for setWidth)
44 44
 	 * @param int $wide
45 45
 	 */
46
-	public function setWide($wide){
46
+	public function setWide($wide) {
47 47
 		$wide=Wide::getConstants()["W".$wide];
48 48
 		$this->addToPropertyCtrl("class", $wide, Wide::getConstants());
49
-		return $this->addToPropertyCtrl("class","column",array("column"));
49
+		return $this->addToPropertyCtrl("class", "column", array("column"));
50 50
 	}
51 51
 
52 52
 	/**
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 * @param int $width
55 55
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
56 56
 	 */
57
-	public function setWidth($width){
57
+	public function setWidth($width) {
58 58
 	return $this->setWide($width);
59 59
 	}
60 60
 
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 	 * @param int $colsCount number of columns to create
64 64
 	 * @return mixed
65 65
 	 */
66
-	public function addRow($colsCount=NULL){
66
+	public function addRow($colsCount=NULL) {
67 67
 		$rowCount=$this->rowCount()+1;
68
-		$this->setRowsCount($rowCount,$colsCount,true);
68
+		$this->setRowsCount($rowCount, $colsCount, true);
69 69
 		return $this->content[$rowCount-1];
70 70
 	}
71 71
 
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 	 * @param int $width with of the column to add
75 75
 	 * @return mixed|\Ajax\semantic\html\collections\HtmlGrid
76 76
 	 */
77
-	public function addCol($width=NULL){
77
+	public function addCol($width=NULL) {
78 78
 		$colCount=$this->colCount()+1;
79
-		$this->setColsCount($colCount,true,$width);
80
-		if($this->hasOnlyCols($this->count()))
79
+		$this->setColsCount($colCount, true, $width);
80
+		if ($this->hasOnlyCols($this->count()))
81 81
 			return $this->content[$colCount-1];
82 82
 		return $this;
83 83
 	}
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	 * @param array $sizes array of width of the columns to create
87 87
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
88 88
 	 */
89
-	public function addCols($sizes=array()){
90
-		foreach ($sizes as $size){
89
+	public function addCols($sizes=array()) {
90
+		foreach ($sizes as $size) {
91 91
 			$this->addCol($size);
92 92
 		}
93 93
 		return $this;
@@ -99,28 +99,28 @@  discard block
 block discarded – undo
99 99
 	 * @param int $colsCount
100 100
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
101 101
 	 */
102
-	public function setRowsCount($rowsCount,$colsCount=NULL,$force=false){
102
+	public function setRowsCount($rowsCount, $colsCount=NULL, $force=false) {
103 103
 		$count=$this->count();
104
-		if($rowsCount<2 && $force===false){
105
-			for($i=$count;$i<$colsCount;$i++){
104
+		if ($rowsCount<2 && $force===false) {
105
+			for ($i=$count; $i<$colsCount; $i++) {
106 106
 				$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i));
107 107
 			}
108
-		}else{
109
-			if($this->hasOnlyCols($count)){
108
+		}else {
109
+			if ($this->hasOnlyCols($count)) {
110 110
 				$tmpContent=$this->content;
111 111
 				$item=$this->addItem($colsCount);
112 112
 				$item->setContent($tmpContent);
113 113
 				$this->content=array();
114 114
 				$count=1;
115 115
 			}
116
-			for($i=$count;$i<$rowsCount;$i++){
116
+			for ($i=$count; $i<$rowsCount; $i++) {
117 117
 				$this->addItem($colsCount);
118 118
 			}
119 119
 		}
120 120
 		return $this;
121 121
 	}
122 122
 
123
-	protected function hasOnlyCols($count){
123
+	protected function hasOnlyCols($count) {
124 124
 		return $count>0 && $this->content[0] instanceof HtmlGridCol;
125 125
 	}
126 126
 
@@ -131,17 +131,17 @@  discard block
 block discarded – undo
131 131
 	 * @param int $width
132 132
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
133 133
 	 */
134
-	public function setColsCount($numCols,$toCreate=true,$width=NULL){
135
-		if(isset($width)===false)
134
+	public function setColsCount($numCols, $toCreate=true, $width=NULL) {
135
+		if (isset($width)===false)
136 136
 			$this->setWide($numCols);
137
-		if($toCreate==true){
137
+		if ($toCreate==true) {
138 138
 			$count=$this->count();
139
-			if($count==0 || $this->hasOnlyCols($count)){
140
-				for($i=$count;$i<$numCols;$i++){
141
-					$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i,$width));
139
+			if ($count==0 || $this->hasOnlyCols($count)) {
140
+				for ($i=$count; $i<$numCols; $i++) {
141
+					$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i, $width));
142 142
 				}
143
-			}else{
144
-				for($i=0;$i<$count;$i++){
143
+			}else {
144
+				for ($i=0; $i<$count; $i++) {
145 145
 					$this->getItem($i)->setColsCount($numCols);
146 146
 				}
147 147
 			}
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 * @param int $index
155 155
 	 * @return \Ajax\semantic\html\collections\HtmlGridRow
156 156
 	 */
157
-	public function getRow($index){
157
+	public function getRow($index) {
158 158
 		return $this->getItem($index);
159 159
 	}
160 160
 
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
 	 * Returns the row count
163 163
 	 * @return int
164 164
 	 */
165
-	public function rowCount(){
165
+	public function rowCount() {
166 166
 		$count=$this->count();
167
-		if($this->hasOnlyCols($count))
167
+		if ($this->hasOnlyCols($count))
168 168
 			return 0;
169 169
 		return $count;
170 170
 	}
@@ -173,11 +173,11 @@  discard block
 block discarded – undo
173 173
 	 * Returns the column count
174 174
 	 * @return int
175 175
 	 */
176
-	public function colCount(){
176
+	public function colCount() {
177 177
 		$count=$this->count();
178
-		if($this->hasOnlyCols($count))
178
+		if ($this->hasOnlyCols($count))
179 179
 			return $count;
180
-		if($count>0)
180
+		if ($count>0)
181 181
 			return $this->getItem(0)->count();
182 182
 		return 0;
183 183
 	}
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
 	 * @param int $col
189 189
 	 * @return \Ajax\semantic\html\collections\HtmlGridCol
190 190
 	 */
191
-	public function getCell($row,$col){
192
-		if($row<2 && $this->hasOnlyCols($this->count()))
191
+	public function getCell($row, $col) {
192
+		if ($row<2 && $this->hasOnlyCols($this->count()))
193 193
 			return $this->getItem($col);
194 194
 		$row=$this->getItem($row);
195
-		if(isset($row)){
195
+		if (isset($row)) {
196 196
 			$col=$row->getItem($col);
197 197
 		}
198 198
 		return $col;
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
 	 * @param boolean $vertically
204 204
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
205 205
 	 */
206
-	public function setDivided($vertically=false){
207
-		$value=($vertically===true)?"vertically divided":"divided";
208
-		return $this->addToPropertyCtrl("class", $value,array("divided"));
206
+	public function setDivided($vertically=false) {
207
+		$value=($vertically===true) ? "vertically divided" : "divided";
208
+		return $this->addToPropertyCtrl("class", $value, array("divided"));
209 209
 	}
210 210
 
211 211
 	/**
@@ -213,23 +213,23 @@  discard block
 block discarded – undo
213 213
 	 * @param boolean $internally true for internal cells
214 214
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
215 215
 	 */
216
-	public function setCelled($internally=false){
217
-		$value=($internally===true)?"internally celled":"celled";
218
-		return $this->addToPropertyCtrl("class", $value,array("celled","internally celled"));
216
+	public function setCelled($internally=false) {
217
+		$value=($internally===true) ? "internally celled" : "celled";
218
+		return $this->addToPropertyCtrl("class", $value, array("celled", "internally celled"));
219 219
 	}
220 220
 
221 221
 	/**
222 222
 	 * A grid can have its columns centered
223 223
 	 */
224
-	public function setCentered(){
225
-		return $this->addToPropertyCtrl("class", "centered",array("centered"));
224
+	public function setCentered() {
225
+		return $this->addToPropertyCtrl("class", "centered", array("centered"));
226 226
 	}
227 227
 
228 228
 	/**
229 229
 	 * automatically resize all elements to split the available width evenly
230 230
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
231 231
 	 */
232
-	public function setEqualWidth(){
232
+	public function setEqualWidth() {
233 233
 		return $this->addToProperty("class", "equal width");
234 234
 	}
235 235
 
@@ -238,9 +238,9 @@  discard block
 block discarded – undo
238 238
 	 * @param string $value
239 239
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
240 240
 	 */
241
-	public function setPadded($value=NULL){
242
-		if(isset($value))
243
-			$this->addToPropertyCtrl("class", $value,array("vertically","horizontally"));
241
+	public function setPadded($value=NULL) {
242
+		if (isset($value))
243
+			$this->addToPropertyCtrl("class", $value, array("vertically", "horizontally"));
244 244
 		return $this->addToProperty("class", "padded");
245 245
 	}
246 246
 
@@ -248,23 +248,23 @@  discard block
 block discarded – undo
248 248
 	 * @param boolean $very
249 249
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
250 250
 	 */
251
-	public function setRelaxed($very=false){
252
-		$value=($very===true)?"very relaxed":"relaxed";
253
-		return $this->addToPropertyCtrl("class", $value,array("relaxed","very relaxed"));
251
+	public function setRelaxed($very=false) {
252
+		$value=($very===true) ? "very relaxed" : "relaxed";
253
+		return $this->addToPropertyCtrl("class", $value, array("relaxed", "very relaxed"));
254 254
 	}
255 255
 
256
-	public function setVerticalAlignment($value=VerticalAlignment::MIDDLE){
257
-		return $this->addToPropertyCtrl("class", $value." aligned",VerticalAlignment::getConstantValues("aligned"));
256
+	public function setVerticalAlignment($value=VerticalAlignment::MIDDLE) {
257
+		return $this->addToPropertyCtrl("class", $value." aligned", VerticalAlignment::getConstantValues("aligned"));
258 258
 	}
259 259
 
260 260
 	/**
261 261
 	 * {@inheritDoc}
262 262
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
263 263
 	 */
264
-	protected function createItem($value){
265
-		if($this->_createCols===false)
264
+	protected function createItem($value) {
265
+		if ($this->_createCols===false)
266 266
 			$value=null;
267
-		$item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing,$this->_implicitRows);
267
+		$item=new HtmlGridRow($this->identifier."-row-".($this->count()+1), $value, $this->_colSizing, $this->_implicitRows);
268 268
 		return $item;
269 269
 	}
270 270
 
@@ -272,17 +272,17 @@  discard block
 block discarded – undo
272 272
 	 * Sets $values to the grid
273 273
 	 * @param array $values
274 274
 	 */
275
-	public function setValues($values,$force=true){
275
+	public function setValues($values, $force=true) {
276 276
 		$count=$this->count();
277
-		if($this->_createCols===false || $force===true){
278
-			for($i=$count;$i<\sizeof($values);$i++){
277
+		if ($this->_createCols===false || $force===true) {
278
+			for ($i=$count; $i<\sizeof($values); $i++) {
279 279
 				$colSize=\sizeof($values[$i]);
280
-				$this->addItem(new HtmlGridRow($this->identifier."-row-".($this->count()+1),$colSize,$this->_colSizing,$this->_implicitRows));
280
+				$this->addItem(new HtmlGridRow($this->identifier."-row-".($this->count()+1), $colSize, $this->_colSizing, $this->_implicitRows));
281 281
 			}
282 282
 		}
283
-		$count=\min(array($this->count(),\sizeof($values)));
284
-		for($i=0;$i<$count;$i++){
285
-			$this->content[$i]->setValues($values[$i],$this->_createCols===false);
283
+		$count=\min(array($this->count(), \sizeof($values)));
284
+		for ($i=0; $i<$count; $i++) {
285
+			$this->content[$i]->setValues($values[$i], $this->_createCols===false);
286 286
 		}
287 287
 	}
288 288
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	 * stretch the row contents to take up the entire column height
291 291
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
292 292
 	 */
293
-	public function setStretched(){
293
+	public function setStretched() {
294 294
 		return $this->addToProperty("class", "stretched");
295 295
 	}
296 296
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormRadio.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
  */
11 11
 class HtmlFormRadio extends AbstractHtmlFormRadioCheckbox {
12 12
 
13
-	public function __construct($identifier, $name=NULL,$label=NULL,$value=NULL,$type=NULL) {
14
-		parent::__construct($identifier, $name,$label,$value,$type);
13
+	public function __construct($identifier, $name=NULL, $label=NULL, $value=NULL, $type=NULL) {
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))
17
+		if (isset($name))
18 18
 			$this->_input->getField()->setProperty("name", $name);
19
-		if(isset($type))
19
+		if (isset($type))
20 20
 			$this->setType($type);
21 21
 	}
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this 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/HtmlFormInput.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@
 block discarded – undo
8 8
 class HtmlFormInput extends HtmlFormField {
9 9
 	use TextFieldsTrait;
10 10
 
11
-	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
12
-		if(!isset($placeholder) && $type==="text")
11
+	public function __construct($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) {
12
+		if (!isset($placeholder) && $type==="text")
13 13
 			$placeholder=$label;
14
-		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
14
+		parent::__construct("field-".$identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label);
15 15
 	}
16 16
 
17
-	public function setReadonly(){
17
+	public function setReadonly() {
18 18
 		$this->getField()->setProperty("readonly", "");
19 19
 	}
20 20
 }
21 21
\ No newline at end of file
Please login to merge, or discard this 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/HtmlPopup.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 class HtmlPopup extends HtmlSemDoubleElement {
13 13
 	private $_params;
14 14
 	private $_container;
15
-	public function __construct(BaseHtml $container,$identifier, $content="") {
15
+	public function __construct(BaseHtml $container, $identifier, $content="") {
16 16
 		parent::__construct($identifier, "div");
17 17
 		$this->_container=$container;
18 18
 		$this->setClass("ui popup");
@@ -20,21 +20,21 @@  discard block
 block discarded – undo
20 20
 		$this->_params=array("on"=>"hover");
21 21
 	}
22 22
 
23
-	public function addList($items=array(),$header=NULL){
24
-		if(!$this->content instanceof HtmlGrid){
25
-			$this->content=new HtmlGrid("Grid-".$this->identifier,0);
23
+	public function addList($items=array(), $header=NULL) {
24
+		if (!$this->content instanceof HtmlGrid) {
25
+			$this->content=new HtmlGrid("Grid-".$this->identifier, 0);
26 26
 		}
27 27
 		$grid=$this->content;
28 28
 
29 29
 		$colCount=$grid->colCount();
30 30
 		$grid->setColsCount(++$colCount);
31 31
 
32
-		$list=new HtmlList("",$items);
32
+		$list=new HtmlList("", $items);
33 33
 		$list->asLink();
34
-		if(isset($header)){
35
-			$list->addHeader(4,$header);
34
+		if (isset($header)) {
35
+			$list->addHeader(4, $header);
36 36
 		}
37
-		$grid->getCell(0,$colCount-1)->setContent($list);
37
+		$grid->getCell(0, $colCount-1)->setContent($list);
38 38
 		$grid->setDivided()->setRelaxed(true);
39 39
 		return $list;
40 40
 	}
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
 	/**
43 43
 	 * A popup can have no maximum width and continue to flow to fit its content
44 44
 	 */
45
-	public function setFlowing(){
45
+	public function setFlowing() {
46 46
 		return $this->addToProperty("class", "flowing");
47 47
 	}
48 48
 
49 49
 	/**
50 50
 	 * A popup can provide more basic formatting
51 51
 	 */
52
-	public function setBasic(){
52
+	public function setBasic() {
53 53
 		return $this->addToProperty("class", "basic");
54 54
 	}
55 55
 
@@ -57,22 +57,22 @@  discard block
 block discarded – undo
57 57
 	 * {@inheritDoc}
58 58
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
59 59
 	 */
60
-	public function run(JsUtils $js){
60
+	public function run(JsUtils $js) {
61 61
 		$this->_params["popup"]="#".$this->identifier;
62
-		$js->semantic()->popup("#".$this->_container->getIdentifier(),$this->_params);
62
+		$js->semantic()->popup("#".$this->_container->getIdentifier(), $this->_params);
63 63
 	}
64 64
 
65
-	public function setOn($event="click"){
65
+	public function setOn($event="click") {
66 66
 		$this->_params["on"]=$event;
67 67
 		return $this;
68 68
 	}
69 69
 
70
-	public function setInline($value=true){
70
+	public function setInline($value=true) {
71 71
 		$this->_params["inline"]=$value;
72 72
 		return $this;
73 73
 	}
74 74
 
75
-	public function setPosition($position){
75
+	public function setPosition($position) {
76 76
 		$this->_params["position"]=$position;
77 77
 		return $this;
78 78
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlList.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -10,6 +10,9 @@  discard block
 block discarded – undo
10 10
 class HtmlList extends HtmlSemCollection{
11 11
 	protected $_hasCheckedList;
12 12
 
13
+	/**
14
+	 * @param string $identifier
15
+	 */
13 16
 	public function __construct( $identifier, $items=array()){
14 17
 		parent::__construct( $identifier, "div", "ui list");
15 18
 		$this->addItems($items);
@@ -27,6 +30,9 @@  discard block
 block discarded – undo
27 30
 		return $item;
28 31
 	}
29 32
 
33
+	/**
34
+	 * @param integer $niveau
35
+	 */
30 36
 	public function addHeader($niveau,$content){
31 37
 		return $this->wrap(new HtmlHeader("header-".$this->identifier,$niveau,$content,"page"));
32 38
 	}
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -7,86 +7,86 @@
 block discarded – undo
7 7
 use Ajax\semantic\html\collections\form\HtmlFormCheckbox;
8 8
 use Ajax\JsUtils;
9 9
 
10
-class HtmlList extends HtmlSemCollection{
10
+class HtmlList extends HtmlSemCollection {
11 11
 	protected $_hasCheckedList;
12 12
 
13
-	public function __construct( $identifier, $items=array()){
14
-		parent::__construct( $identifier, "div", "ui list");
13
+	public function __construct($identifier, $items=array()) {
14
+		parent::__construct($identifier, "div", "ui list");
15 15
 		$this->addItems($items);
16 16
 		$this->_hasCheckedList=false;
17 17
 	}
18 18
 
19 19
 
20
-	protected function createItem($value){
20
+	protected function createItem($value) {
21 21
 		$count=$this->count();
22
-		if(\is_array($value)){
22
+		if (\is_array($value)) {
23 23
 			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]);
24 24
 			$item->addIcon($value[1]);
25 25
 		}else
26
-			$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
26
+			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value);
27 27
 		return $item;
28 28
 	}
29 29
 
30
-	public function addHeader($niveau,$content){
31
-		return $this->wrap(new HtmlHeader("header-".$this->identifier,$niveau,$content,"page"));
30
+	public function addHeader($niveau, $content) {
31
+		return $this->wrap(new HtmlHeader("header-".$this->identifier, $niveau, $content, "page"));
32 32
 	}
33 33
 
34
-	public function itemsAs($tagName){
34
+	public function itemsAs($tagName) {
35 35
 		return $this->contentAs($tagName);
36 36
 	}
37 37
 
38
-	public function asLink(){
38
+	public function asLink() {
39 39
 		$this->addToPropertyCtrl("class", "link", array("link"));
40 40
 		return $this->contentAs("a");
41 41
 	}
42 42
 
43
-	public function addList($items=array()){
44
-		$list=new HtmlList("",$items);
43
+	public function addList($items=array()) {
44
+		$list=new HtmlList("", $items);
45 45
 		$list->setClass("list");
46 46
 		return $this->addItem($list);
47 47
 	}
48 48
 
49
-	public function setCelled(){
49
+	public function setCelled() {
50 50
 		return $this->addToProperty("class", "celled");
51 51
 	}
52 52
 
53
-	public function run(JsUtils $js){
54
-		if($this->_hasCheckedList===true){
53
+	public function run(JsUtils $js) {
54
+		if ($this->_hasCheckedList===true) {
55 55
 			$jsCode=include dirname(__FILE__).'/../../components/jsTemplates/tplCheckedList.php';
56
-			$jsCode=\str_replace("%identifier%","#".$this->identifier,$jsCode);
56
+			$jsCode=\str_replace("%identifier%", "#".$this->identifier, $jsCode);
57 57
 			$this->executeOnRun($jsCode);
58 58
 		}
59 59
 		return parent::run($js);
60 60
 	}
61 61
 
62
-	public function setRelaxed(){
62
+	public function setRelaxed() {
63 63
 		return $this->addToProperty("class", "relaxed");
64 64
 	}
65 65
 
66
-	public function addCheckedList($items=array(),$masterItem=NULL,$values=array()){
66
+	public function addCheckedList($items=array(), $masterItem=NULL, $values=array()) {
67 67
 		$count=$this->count();
68 68
 		$identifier=$this->identifier."-".$count;
69
-		if(isset($masterItem)){
70
-			$masterO=new HtmlFormCheckbox("master-".$identifier,$masterItem);
71
-			$masterO->getField()->addToProperty("class","master");
69
+		if (isset($masterItem)) {
70
+			$masterO=new HtmlFormCheckbox("master-".$identifier, $masterItem);
71
+			$masterO->getField()->addToProperty("class", "master");
72 72
 			$masterO->setClass("item");
73 73
 			$this->addItem($masterO);
74 74
 		}
75 75
 		$fields=array();
76 76
 		$i=0;
77
-		foreach ($items as $val=>$caption){
78
-			$itemO=new HtmlFormCheckbox($identifier."-".$i++,$caption,$val,"child");
79
-			if(\array_search($val, $values)!==false){
77
+		foreach ($items as $val=>$caption) {
78
+			$itemO=new HtmlFormCheckbox($identifier."-".$i++, $caption, $val, "child");
79
+			if (\array_search($val, $values)!==false) {
80 80
 				$itemO->getInput()->getField()->setProperty("checked", "");
81 81
 			}
82 82
 			$itemO->setClass("item");
83 83
 			$fields[]=$itemO;
84 84
 		}
85
-		if(isset($masterO)===true){
86
-			$list=new HtmlList("",$fields);
85
+		if (isset($masterO)===true) {
86
+			$list=new HtmlList("", $fields);
87 87
 			$list->setClass("list");
88 88
 			$masterO->addContent($list);
89
-		}else{
89
+		}else {
90 90
 			$this->addList($fields);
91 91
 		}
92 92
 		$this->_hasCheckedList=true;
Please login to merge, or discard this 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/common/components/SimpleComponent.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
 
17 17
 	public function __construct(JsUtils $js) {
18 18
 		parent::__construct($js);
19
-		$this->events=array ();
19
+		$this->events=array();
20 20
 	}
21 21
 
22 22
 	protected function compileEvents() {
23
-		foreach ( $this->events as $event => $jsCode ) {
24
-			if($event=="execute"){
23
+		foreach ($this->events as $event => $jsCode) {
24
+			if ($event=="execute") {
25 25
 				$this->jquery_code_for_compile []=$jsCode;
26 26
 			}else
27 27
 			$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		$result=implode("\n", $this->jquery_code_for_compile);
33 33
 		$result=str_ireplace("\"%", "", $result);
34 34
 		$result=str_ireplace("%\"", "", $result);
35
-		$result=str_replace(array (
35
+		$result=str_replace(array(
36 36
 				"\\n",
37 37
 				"\\r",
38 38
 				"\\t"
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function getScript() {
44 44
 		$allParams=$this->params;
45
-		$this->jquery_code_for_compile=array ();
45
+		$this->jquery_code_for_compile=array();
46 46
 		$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");";
47 47
 		$this->compileEvents();
48 48
 		return $this->compileJQueryCode();
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		if (is_array($typeCtrl)) {
70 70
 			if (array_search($value, $typeCtrl)===false)
71 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)."}");
72
-		} else {
72
+		}else {
73 73
 			if (!$typeCtrl($value)) {
74 74
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName);
75 75
 			}
Please login to merge, or discard this 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.
Ajax/service/JArray.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 class JArray {
6 6
 
7 7
 	public static function isAssociative($array) {
8
-		return (array_values($array) !== $array);
8
+		return (array_values($array)!==$array);
9 9
 		//return (array_keys($array)!==range(0, count($array)-1));
10 10
 	}
11 11
 
@@ -18,16 +18,16 @@  discard block
 block discarded – undo
18 18
 			return $values [$pos];
19 19
 	}
20 20
 
21
-	public static function getConditionalValue($array,$key,$condition){
21
+	public static function getConditionalValue($array, $key, $condition) {
22 22
 		$result=NULL;
23 23
 		if (array_key_exists($key, $array)) {
24 24
 			$result=$array [$key];
25
-			if($condition($result)===true)
25
+			if ($condition($result)===true)
26 26
 				return $result;
27 27
 		}
28 28
 		$values=array_values($array);
29
-		foreach ($values as $val){
30
-			if($condition($val)===true)
29
+		foreach ($values as $val) {
30
+			if ($condition($val)===true)
31 31
 				return $val;
32 32
 		}
33 33
 		return $result;
@@ -36,21 +36,21 @@  discard block
 block discarded – undo
36 36
 	public static function getDefaultValue($array, $key, $default=NULL) {
37 37
 		if (array_key_exists($key, $array)) {
38 38
 			return $array [$key];
39
-		} else
39
+		}else
40 40
 			return $default;
41 41
 	}
42 42
 
43
-	public static function implode($glue,$pieces){
43
+	public static function implode($glue, $pieces) {
44 44
 		$result="";
45
-		if(\is_array($glue)){
45
+		if (\is_array($glue)) {
46 46
 			$size=\sizeof($pieces);
47
-			if($size>0){
48
-				for($i=0;$i<$size-1;$i++){
47
+			if ($size>0) {
48
+				for ($i=0; $i<$size-1; $i++) {
49 49
 					$result.=$pieces[$i].@$glue[$i];
50 50
 				}
51 51
 				$result.=$pieces[$size-1];
52 52
 			}
53
-		}else{
53
+		}else {
54 54
 			$result=\implode($glue, $pieces);
55 55
 		}
56 56
 		return $result;
Please login to merge, or discard this patch.
Braces   +13 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,21 +14,24 @@  discard block
 block discarded – undo
14 14
 			return $array [$key];
15 15
 		}
16 16
 		$values=array_values($array);
17
-		if ($pos<sizeof($values))
18
-			return $values [$pos];
17
+		if ($pos<sizeof($values)) {
18
+					return $values [$pos];
19
+		}
19 20
 	}
20 21
 
21 22
 	public static function getConditionalValue($array,$key,$condition){
22 23
 		$result=NULL;
23 24
 		if (array_key_exists($key, $array)) {
24 25
 			$result=$array [$key];
25
-			if($condition($result)===true)
26
-				return $result;
26
+			if($condition($result)===true) {
27
+							return $result;
28
+			}
27 29
 		}
28 30
 		$values=array_values($array);
29 31
 		foreach ($values as $val){
30
-			if($condition($val)===true)
31
-				return $val;
32
+			if($condition($val)===true) {
33
+							return $val;
34
+			}
32 35
 		}
33 36
 		return $result;
34 37
 	}
@@ -36,8 +39,9 @@  discard block
 block discarded – undo
36 39
 	public static function getDefaultValue($array, $key, $default=NULL) {
37 40
 		if (array_key_exists($key, $array)) {
38 41
 			return $array [$key];
39
-		} else
40
-			return $default;
42
+		} else {
43
+					return $default;
44
+		}
41 45
 	}
42 46
 
43 47
 	public static function implode($glue,$pieces){
@@ -50,7 +54,7 @@  discard block
 block discarded – undo
50 54
 				}
51 55
 				$result.=$pieces[$size-1];
52 56
 			}
53
-		}else{
57
+		} else{
54 58
 			$result=\implode($glue, $pieces);
55 59
 		}
56 60
 		return $result;
Please login to merge, or discard this patch.