Completed
Push — master ( 0c3815...012895 )
by Jean-Christophe
03:40
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/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/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 2 patches
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -16,46 +16,46 @@  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
-	public function __construct( $identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){
25
-		parent::__construct( $identifier, "div","ui grid");
24
+	public function __construct($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) {
25
+		parent::__construct($identifier, "div", "ui grid");
26 26
 		$this->_implicitRows=$implicitRows;
27 27
 		$this->_createCols=$createCols;
28
-		if(isset($numCols)){
28
+		if (isset($numCols)) {
29 29
 			//if($this->_createCols){
30 30
 				$this->_colSizing=false;
31 31
 			//}
32 32
 			$this->setWide($numCols);
33 33
 		}
34
-		$this->setRowsCount($numRows,$numCols);
34
+		$this->setRowsCount($numRows, $numCols);
35 35
 	}
36 36
 
37
-	public function setWide($wide){
37
+	public function setWide($wide) {
38 38
 		$wide=Wide::getConstants()["W".$wide];
39 39
 		$this->addToPropertyCtrl("class", $wide, Wide::getConstants());
40
-		return $this->addToPropertyCtrl("class","column",array("column"));
40
+		return $this->addToPropertyCtrl("class", "column", array("column"));
41 41
 	}
42 42
 
43
-	public function addRow($colsCount=NULL){
43
+	public function addRow($colsCount=NULL) {
44 44
 		$rowCount=$this->rowCount()+1;
45
-		$this->setRowsCount($rowCount,$colsCount,true);
45
+		$this->setRowsCount($rowCount, $colsCount, true);
46 46
 		return $this->content[$rowCount-1];
47 47
 	}
48 48
 
49
-	public function addCol($width=NULL){
49
+	public function addCol($width=NULL) {
50 50
 		$colCount=$this->colCount()+1;
51
-		$this->setColsCount($colCount,true,$width);
52
-		if($this->hasOnlyCols($this->count()))
51
+		$this->setColsCount($colCount, true, $width);
52
+		if ($this->hasOnlyCols($this->count()))
53 53
 			return $this->content[$colCount-1];
54 54
 		return $this;
55 55
 	}
56 56
 
57
-	public function addCols($sizes=array()){
58
-		foreach ($sizes as $size){
57
+	public function addCols($sizes=array()) {
58
+		foreach ($sizes as $size) {
59 59
 			$this->addCol($size);
60 60
 		}
61 61
 		return $this;
@@ -67,42 +67,42 @@  discard block
 block discarded – undo
67 67
 	 * @param int $colsCount
68 68
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
69 69
 	 */
70
-	public function setRowsCount($rowsCount,$colsCount=NULL,$force=false){
70
+	public function setRowsCount($rowsCount, $colsCount=NULL, $force=false) {
71 71
 		$count=$this->count();
72
-		if($rowsCount<2 && $force===false){
73
-			for($i=$count;$i<$colsCount;$i++){
72
+		if ($rowsCount<2 && $force===false) {
73
+			for ($i=$count; $i<$colsCount; $i++) {
74 74
 				$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i));
75 75
 			}
76
-		}else{
77
-			if($this->hasOnlyCols($count)){
76
+		}else {
77
+			if ($this->hasOnlyCols($count)) {
78 78
 				$tmpContent=$this->content;
79 79
 				$item=$this->addItem($colsCount);
80 80
 				$item->setContent($tmpContent);
81 81
 				$this->content=array();
82 82
 				$count=1;
83 83
 			}
84
-			for($i=$count;$i<$rowsCount;$i++){
84
+			for ($i=$count; $i<$rowsCount; $i++) {
85 85
 				$this->addItem($colsCount);
86 86
 			}
87 87
 		}
88 88
 		return $this;
89 89
 	}
90 90
 
91
-	protected function hasOnlyCols($count){
91
+	protected function hasOnlyCols($count) {
92 92
 		return $count>0 && $this->content[0] instanceof HtmlGridCol;
93 93
 	}
94 94
 
95
-	public function setColsCount($numCols,$toCreate=true,$width=NULL){
96
-		if(isset($width)===false)
95
+	public function setColsCount($numCols, $toCreate=true, $width=NULL) {
96
+		if (isset($width)===false)
97 97
 			$this->setWide($numCols);
98
-		if($toCreate==true){
98
+		if ($toCreate==true) {
99 99
 			$count=$this->count();
100
-			if($count==0 || $this->hasOnlyCols($count)){
101
-				for($i=$count;$i<$numCols;$i++){
102
-					$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i,$width));
100
+			if ($count==0 || $this->hasOnlyCols($count)) {
101
+				for ($i=$count; $i<$numCols; $i++) {
102
+					$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i, $width));
103 103
 				}
104
-			}else{
105
-				for($i=0;$i<$count;$i++){
104
+			}else {
105
+				for ($i=0; $i<$count; $i++) {
106 106
 					$this->getItem($i)->setColsCount($numCols);
107 107
 				}
108 108
 			}
@@ -115,22 +115,22 @@  discard block
 block discarded – undo
115 115
 	 * @param int $index
116 116
 	 * @return \Ajax\semantic\html\collections\HtmlGridRow
117 117
 	 */
118
-	public function getRow($index){
118
+	public function getRow($index) {
119 119
 		return $this->getItem($index);
120 120
 	}
121 121
 
122
-	public function rowCount(){
122
+	public function rowCount() {
123 123
 		$count=$this->count();
124
-		if($this->hasOnlyCols($count))
124
+		if ($this->hasOnlyCols($count))
125 125
 			return 0;
126 126
 		return $count;
127 127
 	}
128 128
 
129
-	public function colCount(){
129
+	public function colCount() {
130 130
 		$count=$this->count();
131
-		if($this->hasOnlyCols($count))
131
+		if ($this->hasOnlyCols($count))
132 132
 			return $count;
133
-		if($count>0)
133
+		if ($count>0)
134 134
 			return $this->getItem(0)->count();
135 135
 		return 0;
136 136
 	}
@@ -140,11 +140,11 @@  discard block
 block discarded – undo
140 140
 	 * @param int $col
141 141
 	 * @return \Ajax\semantic\html\collections\HtmlGridCol
142 142
 	 */
143
-	public function getCell($row,$col){
144
-		if($row<2 && $this->hasOnlyCols($this->count()))
143
+	public function getCell($row, $col) {
144
+		if ($row<2 && $this->hasOnlyCols($this->count()))
145 145
 			return $this->getItem($col);
146 146
 		$row=$this->getItem($row);
147
-		if(isset($row)){
147
+		if (isset($row)) {
148 148
 			$col=$row->getItem($col);
149 149
 		}
150 150
 		return $col;
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
 	 * @param boolean $vertically
156 156
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
157 157
 	 */
158
-	public function setDivided($vertically=false){
159
-		$value=($vertically===true)?"vertically divided":"divided";
160
-		return $this->addToPropertyCtrl("class", $value,array("divided"));
158
+	public function setDivided($vertically=false) {
159
+		$value=($vertically===true) ? "vertically divided" : "divided";
160
+		return $this->addToPropertyCtrl("class", $value, array("divided"));
161 161
 	}
162 162
 
163 163
 	/**
@@ -165,23 +165,23 @@  discard block
 block discarded – undo
165 165
 	 * @param boolean $internally true for internal cells
166 166
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
167 167
 	 */
168
-	public function setCelled($internally=false){
169
-		$value=($internally===true)?"internally celled":"celled";
170
-		return $this->addToPropertyCtrl("class", $value,array("celled","internally celled"));
168
+	public function setCelled($internally=false) {
169
+		$value=($internally===true) ? "internally celled" : "celled";
170
+		return $this->addToPropertyCtrl("class", $value, array("celled", "internally celled"));
171 171
 	}
172 172
 
173 173
 	/**
174 174
 	 * A grid can have its columns centered
175 175
 	 */
176
-	public function setCentered(){
177
-		return $this->addToPropertyCtrl("class", "centered",array("centered"));
176
+	public function setCentered() {
177
+		return $this->addToPropertyCtrl("class", "centered", array("centered"));
178 178
 	}
179 179
 
180 180
 	/**
181 181
 	 * automatically resize all elements to split the available width evenly
182 182
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
183 183
 	 */
184
-	public function setEqualWidth(){
184
+	public function setEqualWidth() {
185 185
 		return $this->addToProperty("class", "equal width");
186 186
 	}
187 187
 
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
 	 * @param string $value
191 191
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
192 192
 	 */
193
-	public function setPadded($value=NULL){
194
-		if(isset($value))
195
-			$this->addToPropertyCtrl("class", $value,array("vertically","horizontally"));
193
+	public function setPadded($value=NULL) {
194
+		if (isset($value))
195
+			$this->addToPropertyCtrl("class", $value, array("vertically", "horizontally"));
196 196
 		return $this->addToProperty("class", "padded");
197 197
 	}
198 198
 
@@ -200,37 +200,37 @@  discard block
 block discarded – undo
200 200
 	 * @param boolean $very
201 201
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
202 202
 	 */
203
-	public function setRelaxed($very=false){
204
-		$value=($very===true)?"very relaxed":"relaxed";
205
-		return $this->addToPropertyCtrl("class", $value,array("relaxed","very relaxed"));
203
+	public function setRelaxed($very=false) {
204
+		$value=($very===true) ? "very relaxed" : "relaxed";
205
+		return $this->addToPropertyCtrl("class", $value, array("relaxed", "very relaxed"));
206 206
 	}
207 207
 
208
-	public function setVerticalAlignment($value=VerticalAlignment::MIDDLE){
209
-		return $this->addToPropertyCtrl("class", $value." aligned",VerticalAlignment::getConstantValues("aligned"));
208
+	public function setVerticalAlignment($value=VerticalAlignment::MIDDLE) {
209
+		return $this->addToPropertyCtrl("class", $value." aligned", VerticalAlignment::getConstantValues("aligned"));
210 210
 	}
211 211
 
212 212
 	/**
213 213
 	 * {@inheritDoc}
214 214
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
215 215
 	 */
216
-	protected function createItem($value){
217
-		if($this->_createCols===false)
216
+	protected function createItem($value) {
217
+		if ($this->_createCols===false)
218 218
 			$value=null;
219
-		$item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing,$this->_implicitRows);
219
+		$item=new HtmlGridRow($this->identifier."-row-".($this->count()+1), $value, $this->_colSizing, $this->_implicitRows);
220 220
 		return $item;
221 221
 	}
222 222
 
223
-	public function setValues($values){
223
+	public function setValues($values) {
224 224
 		$count=$this->count();
225
-		if($this->_createCols===false){
226
-			for($i=$count;$i<\sizeof($values);$i++){
225
+		if ($this->_createCols===false) {
226
+			for ($i=$count; $i<\sizeof($values); $i++) {
227 227
 				$colSize=\sizeof($values[$i]);
228
-				$this->addItem(new HtmlGridRow($this->identifier."-row-".($this->count()+1),$colSize,$this->_colSizing,$this->_implicitRows));
228
+				$this->addItem(new HtmlGridRow($this->identifier."-row-".($this->count()+1), $colSize, $this->_colSizing, $this->_implicitRows));
229 229
 			}
230 230
 		}
231
-		$count=\min(array($this->count(),\sizeof($values)));
232
-		for($i=0;$i<$count;$i++){
233
-			$this->content[$i]->setValues($values[$i],$this->_createCols===false);
231
+		$count=\min(array($this->count(), \sizeof($values)));
232
+		for ($i=0; $i<$count; $i++) {
233
+			$this->content[$i]->setValues($values[$i], $this->_createCols===false);
234 234
 		}
235 235
 	}
236 236
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 	 * stretch the row contents to take up the entire column height
239 239
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
240 240
 	 */
241
-	public function setStretched(){
241
+	public function setStretched() {
242 242
 		return $this->addToProperty("class", "stretched");
243 243
 	}
244 244
 
Please login to merge, or discard this 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/menus/HtmlMenu.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 	 * @param string $type one of text,item
35 35
 	 * @return \Ajax\semantic\html\collections\HtmlMenu
36 36
 	 */
37
-	public function setType($type=""){
38
-		return $this->addToPropertyCtrl("class", $type, array("","item","text"));
37
+	public function setType($type="") {
38
+		return $this->addToPropertyCtrl("class", $type, array("", "item", "text"));
39 39
 	}
40 40
 
41
-	public function setActiveItem($index){
41
+	public function setActiveItem($index) {
42 42
 		$item=$this->getItem($index);
43
-		if($item!==null){
43
+		if ($item!==null) {
44 44
 			$item->addToProperty("class", "active");
45 45
 		}
46 46
 		return $this;
@@ -50,26 +50,26 @@  discard block
 block discarded – undo
50 50
 	 * {@inheritDoc}
51 51
 	 * @see \Ajax\common\html\html5\HtmlCollection::addItem()
52 52
 	 */
53
-	public function addItem($item){
54
-		if($item instanceof HtmlInput || $item instanceof HtmlImg){
55
-			$itemO=new HtmlSemDoubleElement("item-".$this->identifier,"div","");
53
+	public function addItem($item) {
54
+		if ($item instanceof HtmlInput || $item instanceof HtmlImg) {
55
+			$itemO=new HtmlSemDoubleElement("item-".$this->identifier, "div", "");
56 56
 			$itemO->setContent($item);
57 57
 			$item=$itemO;
58 58
 		}
59 59
 		$item=parent::addItem($item);
60
-		if(!$item instanceof HtmlMenu)
61
-			$item->addToPropertyCtrl("class", "item",array("item"));
62
-		else{
60
+		if (!$item instanceof HtmlMenu)
61
+			$item->addToPropertyCtrl("class", "item", array("item"));
62
+		else {
63 63
 			$this->setSecondary();
64 64
 		}
65 65
 		return $item;
66 66
 	}
67 67
 
68
-	public function generateMenuAsItem($menu,$header=null){
68
+	public function generateMenuAsItem($menu, $header=null) {
69 69
 		$count=$this->count();
70
-		$item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count,"div");
71
-		if(isset($header)){
72
-			$headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count,"div","header");
70
+		$item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div");
71
+		if (isset($header)) {
72
+			$headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header");
73 73
 			$headerItem->setContent($header);
74 74
 			$item->addContent($headerItem);
75 75
 		}
@@ -77,24 +77,24 @@  discard block
 block discarded – undo
77 77
 		$item->addContent($menu);
78 78
 		return $item;
79 79
 	}
80
-	public function addMenuAsItem($menu,$header=null){
81
-		return $this->addItem($this->generateMenuAsItem($menu,$header));
80
+	public function addMenuAsItem($menu, $header=null) {
81
+		return $this->addItem($this->generateMenuAsItem($menu, $header));
82 82
 	}
83 83
 
84
-	public function addPopupAsItem($value,$identifier, $content=""){
85
-		$value=new HtmlSemDoubleElement($identifier,"a","browse item",$value);
84
+	public function addPopupAsItem($value, $identifier, $content="") {
85
+		$value=new HtmlSemDoubleElement($identifier, "a", "browse item", $value);
86 86
 		$value->addContent(new HtmlIcon("", "dropdown"));
87 87
 		$value=$this->addItem($value);
88
-		$popup=new HtmlPopup($value,"popup-".$this->identifier."-".$this->count(),$content);
88
+		$popup=new HtmlPopup($value, "popup-".$this->identifier."-".$this->count(), $content);
89 89
 		$popup->setFlowing()->setPosition("bottom left")->setOn("click");
90
-		$this->wrap("",$popup);
90
+		$this->wrap("", $popup);
91 91
 		return $popup;
92 92
 	}
93 93
 
94
-	public function addDropdownAsItem($value,$items=NULL){
94
+	public function addDropdownAsItem($value, $items=NULL) {
95 95
 		$dd=$value;
96
-		if(\is_string($value)){
97
-			$dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(),$value,$items);
96
+		if (\is_string($value)) {
97
+			$dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(), $value, $items);
98 98
 		}
99 99
 		return $this->addItem($dd);
100 100
 	}
@@ -103,51 +103,51 @@  discard block
 block discarded – undo
103 103
 	 * @see \Ajax\common\html\html5\HtmlCollection::createItem()
104 104
 	 */
105 105
 	protected function createItem($value) {
106
-		$itemO=new HtmlLink("item-".\sizeof($this->content),"",$value);
106
+		$itemO=new HtmlLink("item-".\sizeof($this->content), "", $value);
107 107
 		return $itemO->setClass("item");
108 108
 	}
109 109
 
110
-	public function setInverted(){
110
+	public function setInverted() {
111 111
 		return $this->addToProperty("class", "inverted");
112 112
 	}
113 113
 
114
-	public function setSecondary(){
114
+	public function setSecondary() {
115 115
 		return $this->addToProperty("class", "secondary");
116 116
 	}
117 117
 
118
-	public function setVertical(){
119
-		return $this->addToPropertyCtrl("class", "vertical",array("vertical"));
118
+	public function setVertical() {
119
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical"));
120 120
 	}
121 121
 
122
-	public function setPosition($value="right"){
123
-		return $this->addToPropertyCtrl("class", $value,array("right","left"));
122
+	public function setPosition($value="right") {
123
+		return $this->addToPropertyCtrl("class", $value, array("right", "left"));
124 124
 	}
125 125
 
126
-	public function setPointing($value=Direction::NONE){
127
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
126
+	public function setPointing($value=Direction::NONE) {
127
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
128 128
 	}
129 129
 
130
-	public function asTab($vertical=false){
131
-		$this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");});
132
-		if($vertical===true)
130
+	public function asTab($vertical=false) {
131
+		$this->apply(function(HtmlDoubleElement & $item) {$item->setTagName("a"); });
132
+		if ($vertical===true)
133 133
 			$this->setVertical();
134 134
 		return $this->addToProperty("class", "tabular");
135 135
 	}
136 136
 
137
-	public function asPagination(){
138
-		$this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");});
137
+	public function asPagination() {
138
+		$this->apply(function(HtmlDoubleElement & $item) {$item->setTagName("a"); });
139 139
 			return $this->addToProperty("class", "pagination");
140 140
 	}
141 141
 
142
-	public function setFixed(){
142
+	public function setFixed() {
143 143
 		return $this->addToProperty("class", "fixed");
144 144
 	}
145 145
 
146
-	public function setFluid(){
146
+	public function setFluid() {
147 147
 		return $this->addToProperty("class", "fluid");
148 148
 	}
149 149
 
150
-	public function setCompact(){
150
+	public function setCompact() {
151 151
 		return $this->addToProperty("class", "compact");
152 152
 	}
153 153
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	public function fromDatabaseObject($object, $function) {
158 158
 		$return=$function($object);
159
-		if(\is_array($return))
159
+		if (\is_array($return))
160 160
 			$this->addItems($return);
161 161
 		else
162 162
 		$this->addItem($return);
@@ -167,19 +167,19 @@  discard block
 block discarded – undo
167 167
 	 * @param int $width
168 168
 	 * @return \Ajax\semantic\html\collections\menus\HtmlMenu
169 169
 	 */
170
-	public function setWidth($width){
171
-		if(\is_int($width)){
170
+	public function setWidth($width) {
171
+		if (\is_int($width)) {
172 172
 			$width=Wide::getConstants()["W".$width];
173 173
 		}
174 174
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
175
-		return $this->addToPropertyCtrl("class", "item",array("item"));
175
+		return $this->addToPropertyCtrl("class", "item", array("item"));
176 176
 	}
177 177
 
178
-	public function addImage($identifier, $src="", $alt=""){
179
-		return $this->addItem(new HtmlImg($identifier,$src,$alt));
178
+	public function addImage($identifier, $src="", $alt="") {
179
+		return $this->addItem(new HtmlImg($identifier, $src, $alt));
180 180
 	}
181 181
 
182
-	public static function vertical($identifier,$items=array()){
183
-		return (new HtmlMenu($identifier,$items))->setVertical();
182
+	public static function vertical($identifier, $items=array()) {
183
+		return (new HtmlMenu($identifier, $items))->setVertical();
184 184
 	}
185 185
 }
186 186
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlGridRow.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -16,24 +16,24 @@  discard block
 block discarded – undo
16 16
  * @author jc
17 17
  * @version 1.001
18 18
  */
19
-class HtmlGridRow extends HtmlSemCollection{
19
+class HtmlGridRow extends HtmlSemCollection {
20 20
 	use TextAlignmentTrait;
21 21
 
22 22
 	private $_colSize;
23 23
 	private $_implicite=false;
24 24
 
25
-	public function __construct( $identifier,$numCols=NULL,$colSizing=false,$implicite=false){
26
-		parent::__construct( $identifier,"div","row");
25
+	public function __construct($identifier, $numCols=NULL, $colSizing=false, $implicite=false) {
26
+		parent::__construct($identifier, "div", "row");
27 27
 		$this->_implicite=$implicite;
28 28
 		$width=null;
29
-		if(isset($numCols)){
30
-			$numCols=min(16,$numCols);
31
-			$numCols=max(1,$numCols);
32
-			if($colSizing)
33
-				$width=(int)(16/$numCols);
29
+		if (isset($numCols)) {
30
+			$numCols=min(16, $numCols);
31
+			$numCols=max(1, $numCols);
32
+			if ($colSizing)
33
+				$width=(int) (16 / $numCols);
34 34
 			else
35
-				$this->_colSize=16/$numCols;
36
-			for ($i=0;$i<$numCols;$i++){
35
+				$this->_colSize=16 / $numCols;
36
+			for ($i=0; $i<$numCols; $i++) {
37 37
 				$this->addItem($width);
38 38
 			}
39 39
 		}
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 	 * @param int $width
45 45
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
46 46
 	 */
47
-	public function setWidth($width){
48
-		if(\is_int($width)){
47
+	public function setWidth($width) {
48
+		if (\is_int($width)) {
49 49
 			$width=Wide::getConstants()["W".$width];
50 50
 		}
51 51
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
52
-		return $this->addToPropertyCtrl("class", "column",array("column"));
52
+		return $this->addToPropertyCtrl("class", "column", array("column"));
53 53
 	}
54 54
 
55 55
 	/**
@@ -57,23 +57,23 @@  discard block
 block discarded – undo
57 57
 	 * @param int $index
58 58
 	 * @return \Ajax\semantic\html\collections\HtmlGridCol
59 59
 	 */
60
-	public function getCol($index){
60
+	public function getCol($index) {
61 61
 		return $this->getItem($index);
62 62
 	}
63 63
 
64
-	public function setColsCount($colsCount,$toCreate=true){
64
+	public function setColsCount($colsCount, $toCreate=true) {
65 65
 		$this->setWidth($colsCount);
66
-		if($toCreate===true){
66
+		if ($toCreate===true) {
67 67
 			$count=$this->count();
68
-			for($i=$count;$i<$colsCount;$i++){
68
+			for ($i=$count; $i<$colsCount; $i++) {
69 69
 				$this->addItem(null);
70 70
 			}
71 71
 		}
72 72
 		return $this;
73 73
 	}
74 74
 
75
-	public function addCols($colCount){
76
-		for($i=0;$i<$colCount;$i++){
75
+	public function addCols($colCount) {
76
+		for ($i=0; $i<$colCount; $i++) {
77 77
 			$this->addItem(null);
78 78
 		}
79 79
 		return $this;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * stretch the row contents to take up the entire column height
84 84
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
85 85
 	 */
86
-	public function setStretched(){
86
+	public function setStretched() {
87 87
 		return $this->addToProperty("class", "stretched");
88 88
 	}
89 89
 
@@ -91,19 +91,19 @@  discard block
 block discarded – undo
91 91
 	 * @param string $color
92 92
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
93 93
 	 */
94
-	public function setColor($color){
95
-		return $this->addToPropertyCtrl("class", $color,Color::getConstants());
94
+	public function setColor($color) {
95
+		return $this->addToPropertyCtrl("class", $color, Color::getConstants());
96 96
 	}
97 97
 
98
-	public function setValues($values,$force=false){
98
+	public function setValues($values, $force=false) {
99 99
 		$count=$this->count();
100
-		if($force===true){
101
-			for($i=$count;$i<\sizeof($values);$i++){
102
-				$this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1),null));
100
+		if ($force===true) {
101
+			for ($i=$count; $i<\sizeof($values); $i++) {
102
+				$this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1), null));
103 103
 			}
104 104
 		}
105
-		$count=\min(array($this->count(),\sizeof($values)));
106
-		for($i=0;$i<$count;$i++){
105
+		$count=\min(array($this->count(), \sizeof($values)));
106
+		for ($i=0; $i<$count; $i++) {
107 107
 			$this->content[$i]->setValue($values[$i]);
108 108
 		}
109 109
 		return $this;
@@ -113,15 +113,15 @@  discard block
 block discarded – undo
113 113
 	 * {@inheritDoc}
114 114
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
115 115
 	 */
116
-	protected function createItem($value){
117
-		$col=new HtmlGridCol($this->identifier."-col-".($this->count()+1),$value);
116
+	protected function createItem($value) {
117
+		$col=new HtmlGridCol($this->identifier."-col-".($this->count()+1), $value);
118 118
 		return $col;
119 119
 	}
120 120
 
121
-	public function compile(JsUtils $js=NULL,View $view=NULL){
122
-		if($this->_implicite===true){
121
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
122
+		if ($this->_implicite===true) {
123 123
 			$this->_template="%wrapContentBefore%%content%%wrapContentAfter%";
124 124
 		}
125
-		return parent::compile($js,$view);
125
+		return parent::compile($js, $view);
126 126
 	}
127 127
 }
128 128
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/Semantic.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 use Ajax\semantic\html\modules\HtmlSticky;
22 22
 
23 23
 class Semantic extends BaseGui {
24
-	use SemanticComponentsTrait,SemanticHtmlElementsTrait;
24
+	use SemanticComponentsTrait, SemanticHtmlElementsTrait;
25 25
 	public function __construct($autoCompile=true) {
26 26
 		parent::__construct($autoCompile=true);
27 27
 	}
@@ -32,24 +32,24 @@  discard block
 block discarded – undo
32 32
 	 * @param array $items
33 33
 	 * @return Ajax\semantic\html\collections\HtmlMenu
34 34
 	 */
35
-	public function htmlMenu($identifier,$items=array()){
36
-		return $this->addHtmlComponent(new HtmlMenu($identifier,$items));
35
+	public function htmlMenu($identifier, $items=array()) {
36
+		return $this->addHtmlComponent(new HtmlMenu($identifier, $items));
37 37
 	}
38 38
 
39 39
 	/**Adds an icon menu
40 40
 	 * @param string $identifier
41 41
 	 * @param array $items icons
42 42
 	 */
43
-	public function htmlIconMenu($identifier,$items=array()){
44
-		return $this->addHtmlComponent(new HtmlIconMenu($identifier,$items));
43
+	public function htmlIconMenu($identifier, $items=array()) {
44
+		return $this->addHtmlComponent(new HtmlIconMenu($identifier, $items));
45 45
 	}
46 46
 
47 47
 	/**Adds an labeled icon menu
48 48
 	 * @param string $identifier
49 49
 	 * @param array $items icons
50 50
 	 */
51
-	public function htmlLabeledIconMenu($identifier,$items=array()){
52
-		return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier,$items));
51
+	public function htmlLabeledIconMenu($identifier, $items=array()) {
52
+		return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier, $items));
53 53
 	}
54 54
 
55 55
 	/**
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 	 * @param string $value
58 58
 	 * @param array $items
59 59
 	 */
60
-	public function htmlDropdown($identifier, $value="", $items=array()){
61
-		return $this->addHtmlComponent(new HtmlDropdown($identifier,$value,$items));
60
+	public function htmlDropdown($identifier, $value="", $items=array()) {
61
+		return $this->addHtmlComponent(new HtmlDropdown($identifier, $value, $items));
62 62
 	}
63 63
 
64 64
 	/**
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
 	 * @param string $identifier
67 67
 	 * @param string $content
68 68
 	 */
69
-	public function htmlMessage($identifier, $content=""){
70
-		return $this->addHtmlComponent(new HtmlMessage($identifier,$content));
69
+	public function htmlMessage($identifier, $content="") {
70
+		return $this->addHtmlComponent(new HtmlMessage($identifier, $content));
71 71
 	}
72 72
 
73 73
 	/**
74 74
 	 * @param string $identifier
75 75
 	 * @param mixed $content
76 76
 	 */
77
-	public function htmlPopup(BaseHtml $container,$identifier,$content){
78
-		return $this->addHtmlComponent(new HtmlPopup($container,$identifier,$content));
77
+	public function htmlPopup(BaseHtml $container, $identifier, $content) {
78
+		return $this->addHtmlComponent(new HtmlPopup($container, $identifier, $content));
79 79
 	}
80 80
 
81 81
 	/**
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 * @param boolean $createCols
86 86
 	 * @param boolean $implicitRows
87 87
 	 */
88
-	public function htmlGrid($identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){
89
-		return $this->addHtmlComponent(new HtmlGrid($identifier,$numRows,$numCols,$createCols,$implicitRows));
88
+	public function htmlGrid($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) {
89
+		return $this->addHtmlComponent(new HtmlGrid($identifier, $numRows, $numCols, $createCols, $implicitRows));
90 90
 	}
91 91
 
92 92
 
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
100 100
 	 * @return HtmlBreadcrumb
101 101
 	 */
102
-	public function htmlBreadcrumb( $identifier,$items=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){
103
-		return $this->addHtmlComponent(new HtmlBreadcrumb($identifier,$items,$autoActive,$startIndex,$hrefFunction));
102
+	public function htmlBreadcrumb($identifier, $items=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) {
103
+		return $this->addHtmlComponent(new HtmlBreadcrumb($identifier, $items, $autoActive, $startIndex, $hrefFunction));
104 104
 	}
105 105
 
106 106
 	/**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 	 * @param string $identifier
118 118
 	 * @return HtmlAccordion
119 119
 	 */
120
-	public function htmlAccordionMenu($identifier,$items=array()) {
121
-		return $this->addHtmlComponent(new HtmlAccordionMenu($identifier,$items));
120
+	public function htmlAccordionMenu($identifier, $items=array()) {
121
+		return $this->addHtmlComponent(new HtmlAccordionMenu($identifier, $items));
122 122
 	}
123 123
 
124 124
 	/**
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
 	 * @param string $identifier
127 127
 	 * @param array $elements
128 128
 	 */
129
-	public function htmlForm($identifier,$elements=array()) {
130
-		return $this->addHtmlComponent(new HtmlForm($identifier,$elements));
129
+	public function htmlForm($identifier, $elements=array()) {
130
+		return $this->addHtmlComponent(new HtmlForm($identifier, $elements));
131 131
 	}
132 132
 
133
-	public function htmlSticky($identifier,$content=array()) {
134
-		return $this->addHtmlComponent(new HtmlSticky($identifier,$content));
133
+	public function htmlSticky($identifier, $content=array()) {
134
+		return $this->addHtmlComponent(new HtmlSticky($identifier, $content));
135 135
 	}
136 136
 }
137 137
\ No newline at end of file
Please login to merge, or discard this patch.