@@ -12,12 +12,12 @@ discard block |
||
12 | 12 | * @author jc |
13 | 13 | * @version 1.001 |
14 | 14 | */ |
15 | -class HtmlGridCol extends HtmlSemDoubleElement{ |
|
15 | +class HtmlGridCol extends HtmlSemDoubleElement { |
|
16 | 16 | use TextAlignmentTrait; |
17 | - public function __construct($identifier,$width){ |
|
18 | - parent::__construct($identifier,"div"); |
|
17 | + public function __construct($identifier, $width) { |
|
18 | + parent::__construct($identifier, "div"); |
|
19 | 19 | $this->setClass("column"); |
20 | - if(isset($width)) |
|
20 | + if (isset($width)) |
|
21 | 21 | $this->setWidth($width); |
22 | 22 | } |
23 | 23 | |
@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | * @param int $width |
27 | 27 | * @return \Ajax\semantic\html\content\HtmlGridCol |
28 | 28 | */ |
29 | - public function setWidth($width){ |
|
30 | - if(\is_int($width)){ |
|
29 | + public function setWidth($width) { |
|
30 | + if (\is_int($width)) { |
|
31 | 31 | $width=Wide::getConstants()["W".$width]; |
32 | 32 | } |
33 | 33 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
34 | - return $this->addToPropertyCtrl("class", "wide",array("wide")); |
|
34 | + return $this->addToPropertyCtrl("class", "wide", array("wide")); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | * @param string $value left or right |
40 | 40 | * @return \Ajax\semantic\html\content\HtmlGridCol |
41 | 41 | */ |
42 | - public function setFloated($value="left"){ |
|
42 | + public function setFloated($value="left") { |
|
43 | 43 | return $this->addToProperty("class", $value." floated"); |
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | - public function setValue($value){ |
|
47 | + public function setValue($value) { |
|
48 | 48 | $this->content=$value; |
49 | 49 | } |
50 | 50 | } |
51 | 51 | \ No newline at end of file |
@@ -16,23 +16,23 @@ discard block |
||
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 | - public function __construct( $identifier,$numCols=NULL,$colSizing=false,$implicite=false){ |
|
25 | - parent::__construct( $identifier,"div","row"); |
|
24 | + public function __construct($identifier, $numCols=NULL, $colSizing=false, $implicite=false) { |
|
25 | + parent::__construct($identifier, "div", "row"); |
|
26 | 26 | $this->_implicite=$implicite; |
27 | 27 | $width=null; |
28 | - if(isset($numCols)){ |
|
29 | - $numCols=min(16,$numCols); |
|
30 | - $numCols=max(1,$numCols); |
|
31 | - if($colSizing) |
|
32 | - $width=(int)(16/$numCols); |
|
28 | + if (isset($numCols)) { |
|
29 | + $numCols=min(16, $numCols); |
|
30 | + $numCols=max(1, $numCols); |
|
31 | + if ($colSizing) |
|
32 | + $width=(int) (16 / $numCols); |
|
33 | 33 | else |
34 | - $this->_colSize=16/$numCols; |
|
35 | - for ($i=0;$i<$numCols;$i++){ |
|
34 | + $this->_colSize=16 / $numCols; |
|
35 | + for ($i=0; $i<$numCols; $i++) { |
|
36 | 36 | $this->addItem($width); |
37 | 37 | } |
38 | 38 | } |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | * @param int $width |
44 | 44 | * @return \Ajax\semantic\html\content\HtmlGridRow |
45 | 45 | */ |
46 | - public function setWidth($width){ |
|
47 | - if(\is_int($width)){ |
|
46 | + public function setWidth($width) { |
|
47 | + if (\is_int($width)) { |
|
48 | 48 | $width=Wide::getConstants()["W".$width]; |
49 | 49 | } |
50 | 50 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
51 | - return $this->addToPropertyCtrl("class", "column",array("column")); |
|
51 | + return $this->addToPropertyCtrl("class", "column", array("column")); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @param int $index |
57 | 57 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
58 | 58 | */ |
59 | - public function getCol($index){ |
|
59 | + public function getCol($index) { |
|
60 | 60 | return $this->getItem($index); |
61 | 61 | } |
62 | 62 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * stretch the row contents to take up the entire column height |
65 | 65 | * @return \Ajax\semantic\html\content\HtmlGridRow |
66 | 66 | */ |
67 | - public function setStretched(){ |
|
67 | + public function setStretched() { |
|
68 | 68 | return $this->addToProperty("class", "stretched"); |
69 | 69 | } |
70 | 70 | |
@@ -72,19 +72,19 @@ discard block |
||
72 | 72 | * @param string $color |
73 | 73 | * @return \Ajax\semantic\html\content\HtmlGridRow |
74 | 74 | */ |
75 | - public function setColor($color){ |
|
76 | - return $this->addToPropertyCtrl("class", $color,Color::getConstants()); |
|
75 | + public function setColor($color) { |
|
76 | + return $this->addToPropertyCtrl("class", $color, Color::getConstants()); |
|
77 | 77 | } |
78 | 78 | |
79 | - public function setValues($values,$force=false){ |
|
79 | + public function setValues($values, $force=false) { |
|
80 | 80 | $count=$this->count(); |
81 | - if($force===true){ |
|
82 | - for($i=$count;$i<\sizeof($values);$i++){ |
|
83 | - $this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1),null)); |
|
81 | + if ($force===true) { |
|
82 | + for ($i=$count; $i<\sizeof($values); $i++) { |
|
83 | + $this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1), null)); |
|
84 | 84 | } |
85 | 85 | } |
86 | - $count=\min(array($this->count(),\sizeof($values))); |
|
87 | - for($i=0;$i<$count;$i++){ |
|
86 | + $count=\min(array($this->count(), \sizeof($values))); |
|
87 | + for ($i=0; $i<$count; $i++) { |
|
88 | 88 | $this->content[$i]->setValue($values[$i]); |
89 | 89 | } |
90 | 90 | } |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | * {@inheritDoc} |
94 | 94 | * @see \Ajax\common\html\HtmlCollection::createItem() |
95 | 95 | */ |
96 | - protected function createItem($value){ |
|
97 | - $col=new HtmlGridCol($this->identifier."-col-".($this->count()+1),$value); |
|
96 | + protected function createItem($value) { |
|
97 | + $col=new HtmlGridCol($this->identifier."-col-".($this->count()+1), $value); |
|
98 | 98 | return $col; |
99 | 99 | } |
100 | 100 | |
101 | - public function compile(JsUtils $js=NULL,View $view=NULL){ |
|
102 | - if($this->_implicite===true){ |
|
101 | + public function compile(JsUtils $js=NULL, View $view=NULL) { |
|
102 | + if ($this->_implicite===true) { |
|
103 | 103 | $this->_template="%wrapContentBefore%%content%%wrapContentAfter%"; |
104 | 104 | } |
105 | - return parent::compile($js,$view); |
|
105 | + return parent::compile($js, $view); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | \ No newline at end of file |
@@ -7,11 +7,11 @@ |
||
7 | 7 | |
8 | 8 | class HtmlInput extends HtmlSingleElement { |
9 | 9 | |
10 | - public function __construct($identifier,$type="text",$value="",$placeholder="") { |
|
10 | + public function __construct($identifier, $type="text", $value="", $placeholder="") { |
|
11 | 11 | parent::__construct($identifier, "input"); |
12 | 12 | $this->setProperty("name", $identifier); |
13 | 13 | $this->setProperty("value", $value); |
14 | - if(JString::isNotNull($placeholder)) |
|
14 | + if (JString::isNotNull($placeholder)) |
|
15 | 15 | $this->setProperty("placeholder", $placeholder); |
16 | 16 | $this->setProperty("type", $type); |
17 | 17 | } |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | |
11 | 11 | class HtmlLabel extends HtmlSemDoubleElement { |
12 | 12 | use LabeledIconTrait; |
13 | - public function __construct($identifier,$caption="",$tagName="div") { |
|
14 | - parent::__construct($identifier,$tagName,"ui label"); |
|
13 | + public function __construct($identifier, $caption="", $tagName="div") { |
|
14 | + parent::__construct($identifier, $tagName, "ui label"); |
|
15 | 15 | $this->content=$caption; |
16 | 16 | } |
17 | 17 | |
@@ -19,33 +19,33 @@ discard block |
||
19 | 19 | * @param string $side |
20 | 20 | * @return \Ajax\semantic\html\elements\HtmlLabel |
21 | 21 | */ |
22 | - public function setPointing($value=Direction::NONE){ |
|
23 | - return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing")); |
|
22 | + public function setPointing($value=Direction::NONE) { |
|
23 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @param string $side |
28 | 28 | * @return \Ajax\semantic\html\elements\HtmlLabel |
29 | 29 | */ |
30 | - public function toCorner($side="left"){ |
|
31 | - return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner")); |
|
30 | + public function toCorner($side="left") { |
|
31 | + return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner")); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
35 | 35 | * @return \Ajax\semantic\html\elements\HtmlLabel |
36 | 36 | */ |
37 | - public function asTag(){ |
|
37 | + public function asTag() { |
|
38 | 38 | return $this->addToProperty("class", "tag"); |
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | 42 | * @return \Ajax\semantic\html\elements\HtmlLabel |
43 | 43 | */ |
44 | - public function asLink(){ |
|
44 | + public function asLink() { |
|
45 | 45 | return $this->setTagName("a"); |
46 | 46 | } |
47 | 47 | |
48 | - public function setBasic(){ |
|
48 | + public function setBasic() { |
|
49 | 49 | return $this->addToProperty("class", "basic"); |
50 | 50 | } |
51 | 51 | |
@@ -56,17 +56,17 @@ discard block |
||
56 | 56 | * @param string $before |
57 | 57 | * @return \Ajax\semantic\html\elements\HtmlLabel |
58 | 58 | */ |
59 | - public function addImage($src,$alt="",$before=true){ |
|
59 | + public function addImage($src, $alt="", $before=true) { |
|
60 | 60 | $this->addToProperty("class", "image"); |
61 | - return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before); |
|
61 | + return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | 65 | * @param string $detail |
66 | 66 | * @return \Ajax\common\html\HtmlDoubleElement |
67 | 67 | */ |
68 | - public function addDetail($detail){ |
|
69 | - $div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName); |
|
68 | + public function addDetail($detail) { |
|
69 | + $div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName); |
|
70 | 70 | $div->setClass("detail"); |
71 | 71 | $div->setContent($detail); |
72 | 72 | $this->addContent($div); |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | abstract class State extends BaseEnum { |
8 | - const ACTIVE="active",DISABLED="disabled",ERROR="error",FOCUS="focus",LOADING="loading"; |
|
8 | + const ACTIVE="active", DISABLED="disabled", ERROR="error", FOCUS="focus", LOADING="loading"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -13,17 +13,17 @@ |
||
13 | 13 | * @param boolean $labeled |
14 | 14 | * @return \Ajax\semantic\html\elements\HtmlIcon |
15 | 15 | */ |
16 | - public function addIcon($icon,$before=true,$labeled=false){ |
|
16 | + public function addIcon($icon, $before=true, $labeled=false) { |
|
17 | 17 | $iconO=$icon; |
18 | - if(\is_string($icon)){ |
|
18 | + if (\is_string($icon)) { |
|
19 | 19 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
20 | 20 | } |
21 | - if($labeled!==false){ |
|
22 | - $direction=($before===true)?Direction::RIGHT:Direction::LEFT; |
|
21 | + if ($labeled!==false) { |
|
22 | + $direction=($before===true) ? Direction::RIGHT : Direction::LEFT; |
|
23 | 23 | $this->addToProperty("class", $direction." labeled icon"); |
24 | 24 | $this->tagName="div"; |
25 | 25 | } |
26 | - $this->addContent($iconO,$before); |
|
26 | + $this->addContent($iconO, $before); |
|
27 | 27 | return $iconO; |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -7,15 +7,15 @@ |
||
7 | 7 | |
8 | 8 | class HtmlListItem extends HtmlSemDoubleElement { |
9 | 9 | protected $image; |
10 | - public function __construct($identifier,$content) { |
|
10 | + public function __construct($identifier, $content) { |
|
11 | 11 | parent::__construct($identifier, "div", "item"); |
12 | 12 | $this->_template='<%tagName% id="%identifier%" %properties%>%image%%content%</%tagName%>'; |
13 | 13 | $this->content=$content; |
14 | 14 | } |
15 | - public function addIcon($icon){ |
|
15 | + public function addIcon($icon) { |
|
16 | 16 | $content=$this->content; |
17 | - $this->content=new HtmlSemDoubleElement("content-".$this->identifier,"div","content"); |
|
17 | + $this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content"); |
|
18 | 18 | $this->content->setContent($content); |
19 | - $this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon),true); |
|
19 | + $this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon), true); |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | abstract class Variation extends BaseEnum { |
8 | - const ANIMATED="animated",AVATAR="avatar",COMPACT="compact",FLUID="fluid",INVERTED="inverted",PADDED="padded",TRANSPARENT="transparent"; |
|
8 | + const ANIMATED="animated", AVATAR="avatar", COMPACT="compact", FLUID="fluid", INVERTED="inverted", PADDED="padded", TRANSPARENT="transparent"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -5,22 +5,22 @@ |
||
5 | 5 | use Ajax\semantic\html\base\HtmlSemCollection; |
6 | 6 | use Ajax\semantic\html\content\HtmlListItem; |
7 | 7 | |
8 | -class HtmlList extends HtmlSemCollection{ |
|
8 | +class HtmlList extends HtmlSemCollection { |
|
9 | 9 | |
10 | 10 | |
11 | - public function __construct( $identifier, $items=array()){ |
|
12 | - parent::__construct( $identifier, "div", "ui list"); |
|
11 | + public function __construct($identifier, $items=array()) { |
|
12 | + parent::__construct($identifier, "div", "ui list"); |
|
13 | 13 | $this->addItems($items); |
14 | 14 | } |
15 | 15 | |
16 | 16 | |
17 | - protected function createItem($value){ |
|
17 | + protected function createItem($value) { |
|
18 | 18 | $count=$this->count(); |
19 | - if(\is_array($value)){ |
|
19 | + if (\is_array($value)) { |
|
20 | 20 | $item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]); |
21 | 21 | $item->addIcon($value[1]); |
22 | 22 | }else |
23 | - $item= new HtmlListItem("item-".$this->identifier."-".$count, $value); |
|
23 | + $item=new HtmlListItem("item-".$this->identifier."-".$count, $value); |
|
24 | 24 | return $item; |
25 | 25 | } |
26 | 26 |