@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base\constants; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Direction extends BaseEnum { |
5 | - const RIGHT="right", LEFT="left",DOWN="down",UP="up",NONE=""; |
|
5 | + const RIGHT="right", LEFT="left", DOWN="down", UP="up", NONE=""; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | abstract class RevealType extends BaseEnum { |
8 | - const FADE="fade",MOVE="move",ROTATE="rotate"; |
|
8 | + const FADE="fade", MOVE="move", ROTATE="rotate"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -16,26 +16,26 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -12,70 +12,70 @@ |
||
12 | 12 | public function __construct($identifier, $content) { |
13 | 13 | parent::__construct($identifier, "div", "step"); |
14 | 14 | $this->content=array(); |
15 | - if(\is_array($content)){ |
|
16 | - if(JArray::isAssociative($content)===false){ |
|
17 | - $icon=JArray::getValue($content, "icon",0); |
|
18 | - $title=JArray::getValue($content, "title",1); |
|
19 | - $desc=JArray::getValue($content, "description",2); |
|
20 | - $status=JArray::getValue($content, "status",3); |
|
21 | - }else{ |
|
15 | + if (\is_array($content)) { |
|
16 | + if (JArray::isAssociative($content)===false) { |
|
17 | + $icon=JArray::getValue($content, "icon", 0); |
|
18 | + $title=JArray::getValue($content, "title", 1); |
|
19 | + $desc=JArray::getValue($content, "description", 2); |
|
20 | + $status=JArray::getValue($content, "status", 3); |
|
21 | + }else { |
|
22 | 22 | $icon=@$content["icon"]; |
23 | 23 | $title=@$content["title"]; |
24 | 24 | $desc=@$content["description"]; |
25 | 25 | $status=@$content["status"]; |
26 | 26 | } |
27 | - if(isset($icon)===true){ |
|
27 | + if (isset($icon)===true) { |
|
28 | 28 | $this->setIcon($icon); |
29 | 29 | } |
30 | - if(isset($status)===true){ |
|
30 | + if (isset($status)===true) { |
|
31 | 31 | $this->setStatus($status); |
32 | 32 | } |
33 | - if(isset($title)===true){ |
|
34 | - $this->setTitle($title,$desc); |
|
33 | + if (isset($title)===true) { |
|
34 | + $this->setTitle($title, $desc); |
|
35 | 35 | } |
36 | - }else{ |
|
36 | + }else { |
|
37 | 37 | $this->setContent($content); |
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
41 | - public function setIcon($icon){ |
|
41 | + public function setIcon($icon) { |
|
42 | 42 | $this->content["icon"]=new HtmlIcon("icon-".$this->identifier, $icon); |
43 | 43 | } |
44 | 44 | |
45 | - private function createContent(){ |
|
46 | - $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier,"div","content"); |
|
45 | + private function createContent() { |
|
46 | + $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content"); |
|
47 | 47 | return $this->content["content"]; |
48 | 48 | } |
49 | 49 | |
50 | - public function setTitle($title,$description=NULL){ |
|
51 | - $title=new HtmlSemDoubleElement("","div","title",$title); |
|
52 | - if(\array_key_exists("content", $this->content)===false){ |
|
50 | + public function setTitle($title, $description=NULL) { |
|
51 | + $title=new HtmlSemDoubleElement("", "div", "title", $title); |
|
52 | + if (\array_key_exists("content", $this->content)===false) { |
|
53 | 53 | $this->createContent(); |
54 | 54 | } |
55 | 55 | $this->content["content"]->addContent($title); |
56 | - if(isset($description)){ |
|
57 | - $description=new HtmlSemDoubleElement("","div","description",$description); |
|
56 | + if (isset($description)) { |
|
57 | + $description=new HtmlSemDoubleElement("", "div", "description", $description); |
|
58 | 58 | $this->content["content"]->addContent($description); |
59 | 59 | } |
60 | 60 | return $this; |
61 | 61 | } |
62 | 62 | |
63 | - public function setActive(){ |
|
63 | + public function setActive() { |
|
64 | 64 | return $this->setStatus(StepStatus::ACTIVE); |
65 | 65 | } |
66 | 66 | |
67 | - public function setCompleted(){ |
|
67 | + public function setCompleted() { |
|
68 | 68 | return $this->setStatus(StepStatus::COMPLETED); |
69 | 69 | } |
70 | 70 | |
71 | - public function setStatus($status){ |
|
71 | + public function setStatus($status) { |
|
72 | 72 | return $this->addToPropertyCtrl("class", $status, StepStatus::getConstants()); |
73 | 73 | } |
74 | 74 | |
75 | - public function asLink(){ |
|
75 | + public function asLink() { |
|
76 | 76 | return $this->setTagName("a"); |
77 | 77 | } |
78 | - public function removeStatus(){ |
|
78 | + public function removeStatus() { |
|
79 | 79 | $this->removePropertyValues("class", StepStatus::getConstants()); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | \ No newline at end of file |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | class HtmlLabel extends HtmlSemDoubleElement { |
12 | 12 | use LabeledIconTrait; |
13 | - public function __construct($identifier,$caption="",$icon=NULL,$tagName="div") { |
|
14 | - parent::__construct($identifier,$tagName,"ui label"); |
|
13 | + public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") { |
|
14 | + parent::__construct($identifier, $tagName, "ui label"); |
|
15 | 15 | $this->content=$caption; |
16 | - if(isset($icon)) |
|
16 | + if (isset($icon)) |
|
17 | 17 | $this->addIcon($icon); |
18 | 18 | } |
19 | 19 | |
@@ -21,33 +21,33 @@ discard block |
||
21 | 21 | * @param string $side |
22 | 22 | * @return \Ajax\semantic\html\elements\HtmlLabel |
23 | 23 | */ |
24 | - public function setPointing($value=Direction::NONE){ |
|
25 | - return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing")); |
|
24 | + public function setPointing($value=Direction::NONE) { |
|
25 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
29 | 29 | * @param string $side |
30 | 30 | * @return \Ajax\semantic\html\elements\HtmlLabel |
31 | 31 | */ |
32 | - public function toCorner($side="left"){ |
|
33 | - return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner")); |
|
32 | + public function toCorner($side="left") { |
|
33 | + return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner")); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @return \Ajax\semantic\html\elements\HtmlLabel |
38 | 38 | */ |
39 | - public function asTag(){ |
|
39 | + public function asTag() { |
|
40 | 40 | return $this->addToProperty("class", "tag"); |
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
44 | 44 | * @return \Ajax\semantic\html\elements\HtmlLabel |
45 | 45 | */ |
46 | - public function asLink(){ |
|
46 | + public function asLink() { |
|
47 | 47 | return $this->setTagName("a"); |
48 | 48 | } |
49 | 49 | |
50 | - public function setBasic(){ |
|
50 | + public function setBasic() { |
|
51 | 51 | return $this->addToProperty("class", "basic"); |
52 | 52 | } |
53 | 53 | |
@@ -58,28 +58,28 @@ discard block |
||
58 | 58 | * @param string $before |
59 | 59 | * @return \Ajax\semantic\html\elements\HtmlLabel |
60 | 60 | */ |
61 | - public function addImage($src,$alt="",$before=true){ |
|
61 | + public function addImage($src, $alt="", $before=true) { |
|
62 | 62 | $this->addToProperty("class", "image"); |
63 | - return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before); |
|
63 | + return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | 67 | * @param string $detail |
68 | 68 | * @return \Ajax\common\html\HtmlDoubleElement |
69 | 69 | */ |
70 | - public function addDetail($detail){ |
|
71 | - $div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName); |
|
70 | + public function addDetail($detail) { |
|
71 | + $div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName); |
|
72 | 72 | $div->setClass("detail"); |
73 | 73 | $div->setContent($detail); |
74 | 74 | $this->addContent($div); |
75 | 75 | return $div; |
76 | 76 | } |
77 | 77 | |
78 | - public function asRibbon(){ |
|
78 | + public function asRibbon() { |
|
79 | 79 | return $this->addToPropertyCtrl("class", "ribbon", array("ribbon")); |
80 | 80 | } |
81 | 81 | |
82 | - public static function ribbon($identifier,$caption){ |
|
83 | - return (new HtmlLabel($identifier,$caption))->asRibbon(); |
|
82 | + public static function ribbon($identifier, $caption) { |
|
83 | + return (new HtmlLabel($identifier, $caption))->asRibbon(); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -7,19 +7,19 @@ |
||
7 | 7 | use Phalcon\Mvc\View; |
8 | 8 | use Ajax\semantic\html\elements\HtmlIcon; |
9 | 9 | |
10 | -class HtmlPaginationMenu extends HtmlMenu{ |
|
10 | +class HtmlPaginationMenu extends HtmlMenu { |
|
11 | 11 | |
12 | - public function __construct( $identifier, $items=array() ){ |
|
13 | - parent::__construct( $identifier,$items); |
|
12 | + public function __construct($identifier, $items=array()) { |
|
13 | + parent::__construct($identifier, $items); |
|
14 | 14 | } |
15 | 15 | /** |
16 | 16 | * {@inheritDoc} |
17 | 17 | * @see \Ajax\common\html\BaseHtml::compile() |
18 | 18 | */ |
19 | - public function compile(JsUtils $js=NULL,View $view=NULL){ |
|
19 | + public function compile(JsUtils $js=NULL, View $view=NULL) { |
|
20 | 20 | $this->insertItem(new HtmlIcon("", "left chevron")); |
21 | 21 | $this->addItem(new HtmlIcon("", "right chevron")); |
22 | 22 | $this->asPagination(); |
23 | - return parent::compile($js,$view); |
|
23 | + return parent::compile($js, $view); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | * @param boolean $asIcons |
43 | 43 | * @return HtmlButtonGroups |
44 | 44 | */ |
45 | - public function htmlButtonGroups($identifier,$elements=array(),$asIcons=false){ |
|
46 | - return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements,$asIcons)); |
|
45 | + public function htmlButtonGroups($identifier, $elements=array(), $asIcons=false) { |
|
46 | + return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements, $asIcons)); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param string $content |
53 | 53 | * @return HtmlContainer |
54 | 54 | */ |
55 | - public function htmlContainer($identifier,$content=""){ |
|
55 | + public function htmlContainer($identifier, $content="") { |
|
56 | 56 | return $this->addHtmlComponent(new HtmlContainer($identifier, $content)); |
57 | 57 | } |
58 | 58 | |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | * @param string $content |
62 | 62 | * @return HtmlDivider |
63 | 63 | */ |
64 | - public function htmlDivider($identifier,$content="",$tagName="div"){ |
|
65 | - return $this->addHtmlComponent(new HtmlDivider($identifier, $content,$tagName)); |
|
64 | + public function htmlDivider($identifier, $content="", $tagName="div") { |
|
65 | + return $this->addHtmlComponent(new HtmlDivider($identifier, $content, $tagName)); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | * @param string $type |
73 | 73 | * @return HtmlHeader |
74 | 74 | */ |
75 | - public function htmlHeader($identifier,$niveau=1,$content=NULL,$type="page"){ |
|
76 | - return $this->addHtmlComponent(new HtmlHeader($identifier,$niveau,$content,$type)); |
|
75 | + public function htmlHeader($identifier, $niveau=1, $content=NULL, $type="page") { |
|
76 | + return $this->addHtmlComponent(new HtmlHeader($identifier, $niveau, $content, $type)); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * @param string $icon |
82 | 82 | * @return HtmlIcon |
83 | 83 | */ |
84 | - public function htmlIcon($identifier,$icon){ |
|
84 | + public function htmlIcon($identifier, $icon) { |
|
85 | 85 | return $this->addHtmlComponent(new HtmlIcon($identifier, $icon)); |
86 | 86 | } |
87 | 87 | |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | * @param array $icons |
92 | 92 | * @return HtmlIconGroups |
93 | 93 | */ |
94 | - public function htmlIconGroups($identifier,$size="",$icons=array()){ |
|
95 | - $group=new HtmlIconGroups($identifier,$size); |
|
96 | - if(JArray::isAssociative($icons)){ |
|
97 | - foreach ($icons as $icon=>$size){ |
|
98 | - $group->add($icon,$size); |
|
94 | + public function htmlIconGroups($identifier, $size="", $icons=array()) { |
|
95 | + $group=new HtmlIconGroups($identifier, $size); |
|
96 | + if (JArray::isAssociative($icons)) { |
|
97 | + foreach ($icons as $icon=>$size) { |
|
98 | + $group->add($icon, $size); |
|
99 | 99 | } |
100 | - }else{ |
|
101 | - foreach ($icons as $icon){ |
|
100 | + }else { |
|
101 | + foreach ($icons as $icon) { |
|
102 | 102 | $group->add($icon); |
103 | 103 | } |
104 | 104 | } |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | * @param string $placeholder |
114 | 114 | * @return HtmlInput |
115 | 115 | */ |
116 | - public function htmlInput($identifier,$type="text",$value="",$placeholder=""){ |
|
117 | - return $this->addHtmlComponent(new HtmlInput($identifier,$type,$value,$placeholder)); |
|
116 | + public function htmlInput($identifier, $type="text", $value="", $placeholder="") { |
|
117 | + return $this->addHtmlComponent(new HtmlInput($identifier, $type, $value, $placeholder)); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | * @param string $tagName |
124 | 124 | * @return HtmlLabel |
125 | 125 | */ |
126 | - public function htmlLabel($identifier,$content="",$tagName="div"){ |
|
127 | - return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$tagName)); |
|
126 | + public function htmlLabel($identifier, $content="", $tagName="div") { |
|
127 | + return $this->addHtmlComponent(new HtmlLabel($identifier, $content, $tagName)); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | * @param array $items |
134 | 134 | * @return HtmlList |
135 | 135 | */ |
136 | - public function htmlList($identifier,$items=array()){ |
|
137 | - return $this->addHtmlComponent(new HtmlList($identifier,$items)); |
|
136 | + public function htmlList($identifier, $items=array()) { |
|
137 | + return $this->addHtmlComponent(new HtmlList($identifier, $items)); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | * @param string $content |
144 | 144 | * @return HtmlSegment |
145 | 145 | */ |
146 | - public function htmlSegment($identifier, $content=""){ |
|
147 | - return $this->addHtmlComponent(new HtmlSegment($identifier,$content)); |
|
146 | + public function htmlSegment($identifier, $content="") { |
|
147 | + return $this->addHtmlComponent(new HtmlSegment($identifier, $content)); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | * @param array $items the segments |
154 | 154 | * @return HtmlSegmentGroups |
155 | 155 | */ |
156 | - public function htmlSegmentGroups($identifier, $items=array()){ |
|
157 | - return $this->addHtmlComponent(new HtmlSegmentGroups($identifier,$items)); |
|
156 | + public function htmlSegmentGroups($identifier, $items=array()) { |
|
157 | + return $this->addHtmlComponent(new HtmlSegmentGroups($identifier, $items)); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -164,11 +164,11 @@ discard block |
||
164 | 164 | * @param RevealType|string $type |
165 | 165 | * @param Direction|string $attributeType |
166 | 166 | */ |
167 | - public function htmlReveal($identifier, $visibleContent,$hiddenContent,$type=RevealType::FADE,$attributeType=NULL){ |
|
168 | - return $this->addHtmlComponent(new HtmlReveal($identifier,$visibleContent,$hiddenContent,$type,$attributeType)); |
|
167 | + public function htmlReveal($identifier, $visibleContent, $hiddenContent, $type=RevealType::FADE, $attributeType=NULL) { |
|
168 | + return $this->addHtmlComponent(new HtmlReveal($identifier, $visibleContent, $hiddenContent, $type, $attributeType)); |
|
169 | 169 | } |
170 | 170 | |
171 | - public function htmlStep($identifier, $steps=array()){ |
|
172 | - return $this->addHtmlComponent(new HtmlStep($identifier,$steps)); |
|
171 | + public function htmlStep($identifier, $steps=array()) { |
|
172 | + return $this->addHtmlComponent(new HtmlStep($identifier, $steps)); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | \ No newline at end of file |
@@ -10,23 +10,23 @@ |
||
10 | 10 | * @param string $value |
11 | 11 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
12 | 12 | */ |
13 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
14 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
13 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
14 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
15 | 15 | } |
16 | 16 | |
17 | - public function textCenterAligned(){ |
|
17 | + public function textCenterAligned() { |
|
18 | 18 | return $this->setTextAlignment(TextAlignment::CENTER); |
19 | 19 | } |
20 | 20 | |
21 | - public function textJustified(){ |
|
21 | + public function textJustified() { |
|
22 | 22 | return $this->setTextAlignment(TextAlignment::JUSTIFIED); |
23 | 23 | } |
24 | 24 | |
25 | - public function textRightAligned(){ |
|
25 | + public function textRightAligned() { |
|
26 | 26 | return $this->setTextAlignment(TextAlignment::RIGHT); |
27 | 27 | } |
28 | 28 | |
29 | - public function textLeftAligned(){ |
|
29 | + public function textLeftAligned() { |
|
30 | 30 | return $this->setTextAlignment(); |
31 | 31 | } |
32 | 32 | } |
33 | 33 | \ No newline at end of file |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | * @param int $max |
14 | 14 | * @param string $icon star or heart |
15 | 15 | */ |
16 | - public function __construct($identifier, $value,$max=5,$icon="") { |
|
16 | + public function __construct($identifier, $value, $max=5, $icon="") { |
|
17 | 17 | parent::__construct($identifier, "div", "ui {$icon} rating"); |
18 | 18 | $this->setValue($value); |
19 | 19 | $this->setMax($max); |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | * {@inheritDoc} |
24 | 24 | * @see \Ajax\common\html\HtmlDoubleElement::setValue() |
25 | 25 | */ |
26 | - public function setValue($value){ |
|
26 | + public function setValue($value) { |
|
27 | 27 | $this->setProperty("data-rating", $value); |
28 | 28 | } |
29 | 29 | |
30 | - public function setMax($max){ |
|
30 | + public function setMax($max) { |
|
31 | 31 | $this->setProperty("data-max-rating", $max); |
32 | 32 | } |
33 | 33 | |
@@ -35,20 +35,20 @@ discard block |
||
35 | 35 | * {@inheritDoc} |
36 | 36 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
37 | 37 | */ |
38 | - public function run(JsUtils $js){ |
|
38 | + public function run(JsUtils $js) { |
|
39 | 39 | parent::run($js); |
40 | - return $js->semantic()->rating("#".$this->identifier,$this->_params); |
|
40 | + return $js->semantic()->rating("#".$this->identifier, $this->_params); |
|
41 | 41 | } |
42 | 42 | |
43 | - public function asStar(){ |
|
43 | + public function asStar() { |
|
44 | 44 | return $this->setIcon(); |
45 | 45 | } |
46 | 46 | |
47 | - public function asHeart(){ |
|
47 | + public function asHeart() { |
|
48 | 48 | return $this->setIcon("heart"); |
49 | 49 | } |
50 | 50 | |
51 | - public function setIcon($icon="star"){ |
|
52 | - return $this->addToPropertyCtrl("class", $icon, ["star","heart",""]); |
|
51 | + public function setIcon($icon="star") { |
|
52 | + return $this->addToPropertyCtrl("class", $icon, ["star", "heart", ""]); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | \ No newline at end of file |