@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | foreach ($items as $k=>$v){ |
18 | 18 | $this->addItem([$k,$v]); |
19 | 19 | } |
20 | - }else{ |
|
20 | + } else{ |
|
21 | 21 | foreach ($items as $item){ |
22 | 22 | $this->addItem($item); |
23 | 23 | } |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @return \Ajax\common\html\HtmlDoubleElement |
54 | 54 | */ |
55 | 55 | public function getItem($index) { |
56 | - if (is_int($index)) |
|
57 | - return $this->content[$index]; |
|
58 | - else { |
|
56 | + if (is_int($index)) { |
|
57 | + return $this->content[$index]; |
|
58 | + } else { |
|
59 | 59 | $elm=$this->getElementById($index, $this->content); |
60 | 60 | return $elm; |
61 | 61 | } |
@@ -13,35 +13,35 @@ discard block |
||
13 | 13 | */ |
14 | 14 | abstract class HtmlCollection extends HtmlDoubleElement { |
15 | 15 | |
16 | - public function __construct($identifier,$tagName="div"){ |
|
17 | - parent::__construct($identifier,$tagName); |
|
16 | + public function __construct($identifier, $tagName="div") { |
|
17 | + parent::__construct($identifier, $tagName); |
|
18 | 18 | $this->content=array(); |
19 | 19 | } |
20 | 20 | |
21 | - public function addItems($items){ |
|
22 | - if(JArray::isAssociative($items)){ |
|
23 | - foreach ($items as $k=>$v){ |
|
24 | - $this->addItem([$k,$v]); |
|
21 | + public function addItems($items) { |
|
22 | + if (JArray::isAssociative($items)) { |
|
23 | + foreach ($items as $k=>$v) { |
|
24 | + $this->addItem([$k, $v]); |
|
25 | 25 | } |
26 | - }else{ |
|
27 | - foreach ($items as $item){ |
|
26 | + }else { |
|
27 | + foreach ($items as $item) { |
|
28 | 28 | $this->addItem($item); |
29 | 29 | } |
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
33 | - public function setItems($items){ |
|
33 | + public function setItems($items) { |
|
34 | 34 | $this->content=$items; |
35 | 35 | return $this; |
36 | 36 | } |
37 | 37 | |
38 | - public function getItems(){ |
|
38 | + public function getItems() { |
|
39 | 39 | return $this->content; |
40 | 40 | } |
41 | 41 | |
42 | - protected function getItemToAdd($item){ |
|
42 | + protected function getItemToAdd($item) { |
|
43 | 43 | $itemO=$item; |
44 | - if($this->createCondition($item)===true){ |
|
44 | + if ($this->createCondition($item)===true) { |
|
45 | 45 | $itemO=$this->createItem($item); |
46 | 46 | } |
47 | 47 | return $itemO; |
@@ -52,15 +52,15 @@ discard block |
||
52 | 52 | * @param HtmlDoubleElement|string $item |
53 | 53 | * @return \Ajax\common\html\HtmlDoubleElement |
54 | 54 | */ |
55 | - public function addItem($item){ |
|
55 | + public function addItem($item) { |
|
56 | 56 | $itemO=$this->getItemToAdd($item); |
57 | 57 | $this->addContent($itemO); |
58 | 58 | return $itemO; |
59 | 59 | } |
60 | 60 | |
61 | - public function insertItem($item,$position=0){ |
|
61 | + public function insertItem($item, $position=0) { |
|
62 | 62 | $itemO=$this->getItemToAdd($item); |
63 | - \array_splice( $this->content, $position, 0, array($itemO)); |
|
63 | + \array_splice($this->content, $position, 0, array($itemO)); |
|
64 | 64 | return $itemO; |
65 | 65 | } |
66 | 66 | |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | return $this; |
84 | 84 | } |
85 | 85 | |
86 | - public function removeItem($index){ |
|
86 | + public function removeItem($index) { |
|
87 | 87 | return array_splice($this->content, $index, 1); |
88 | 88 | } |
89 | 89 | |
90 | - public function count(){ |
|
90 | + public function count() { |
|
91 | 91 | return \sizeof($this->content); |
92 | 92 | } |
93 | 93 | |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | $this->addItem($function($object)); |
99 | 99 | } |
100 | 100 | |
101 | - public function apply($callBack){ |
|
102 | - foreach ($this->content as $item){ |
|
101 | + public function apply($callBack) { |
|
102 | + foreach ($this->content as $item) { |
|
103 | 103 | $callBack($item); |
104 | 104 | } |
105 | 105 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | protected abstract function createItem($value); |
119 | 119 | |
120 | - protected function createCondition($value){ |
|
120 | + protected function createCondition($value) { |
|
121 | 121 | return \is_object($value)===false; |
122 | 122 | } |
123 | 123 | |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | return $this->_bsComponent; |
133 | 133 | } |
134 | 134 | |
135 | - protected function contentAs($tagName){ |
|
136 | - foreach ($this->content as $item){ |
|
135 | + protected function contentAs($tagName) { |
|
136 | + foreach ($this->content as $item) { |
|
137 | 137 | $item->setTagName($tagName); |
138 | 138 | } |
139 | 139 | } |
@@ -84,6 +84,9 @@ discard block |
||
84 | 84 | return $this; |
85 | 85 | } |
86 | 86 | |
87 | + /** |
|
88 | + * @param integer $index |
|
89 | + */ |
|
87 | 90 | public function removeItem($index){ |
88 | 91 | return array_splice($this->content, $index, 1); |
89 | 92 | } |
@@ -99,6 +102,9 @@ discard block |
||
99 | 102 | return $this->addItem($function($object)); |
100 | 103 | } |
101 | 104 | |
105 | + /** |
|
106 | + * @param \Closure $callBack |
|
107 | + */ |
|
102 | 108 | public function apply($callBack){ |
103 | 109 | foreach ($this->content as $item){ |
104 | 110 | $callBack($item); |
@@ -4,7 +4,6 @@ |
||
4 | 4 | use Ajax\semantic\html\base\constants\Side; |
5 | 5 | trait AttachedTrait { |
6 | 6 | /** |
7 | - * @param string $side |
|
8 | 7 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
9 | 8 | */ |
10 | 9 | public function setAttachment($value=Side::BOTH){ |
@@ -14,8 +14,8 @@ |
||
14 | 14 | */ |
15 | 15 | public function setAttachment(HtmlSemDoubleElement $toElement, $value=Side::BOTH) { |
16 | 16 | if (isset($toElement)) { |
17 | - $toElement->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
17 | + $toElement->addToPropertyCtrl("class", "attached", array("attached")); |
|
18 | 18 | } |
19 | - return $this->addToPropertyCtrl("class", $value . " attached", Side::getConstantValues("attached")); |
|
19 | + return $this->addToPropertyCtrl("class", $value." attached", Side::getConstantValues("attached")); |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -20,6 +20,9 @@ |
||
20 | 20 | protected $_tabsType="tabs"; |
21 | 21 | protected $stacked=""; |
22 | 22 | |
23 | + /** |
|
24 | + * @param string $identifier |
|
25 | + */ |
|
23 | 26 | public function __construct($identifier, $tagName="ul") { |
24 | 27 | parent::__construct($identifier, $tagName); |
25 | 28 | $this->_template="<%tagName% %properties%>%tabs%</%tagName%>%content%"; |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | */ |
12 | 12 | class HtmlDivider extends HtmlDoubleElement { |
13 | 13 | |
14 | - public function __construct($identifier, $content="",$tagName="div") { |
|
15 | - parent::__construct($identifier, $tagName,"ui divider"); |
|
14 | + public function __construct($identifier, $content="", $tagName="div") { |
|
15 | + parent::__construct($identifier, $tagName, "ui divider"); |
|
16 | 16 | $this->content=$content; |
17 | 17 | } |
18 | 18 | |
@@ -20,23 +20,23 @@ discard block |
||
20 | 20 | * vertical divider |
21 | 21 | * @return \Ajax\semantic\html\elements\HtmlDivider |
22 | 22 | */ |
23 | - public function setVertical(){ |
|
24 | - return $this->addToPropertyUnique("class", "vertical", array("vertical","horizontal")); |
|
23 | + public function setVertical() { |
|
24 | + return $this->addToPropertyUnique("class", "vertical", array("vertical", "horizontal")); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * horizontal divider |
29 | 29 | * @return \Ajax\semantic\html\elements\HtmlDivider |
30 | 30 | */ |
31 | - public function setHorizontal(){ |
|
32 | - return $this->addToPropertyUnique("class", "horizontal", array("vertical","horizontal")); |
|
31 | + public function setHorizontal() { |
|
32 | + return $this->addToPropertyUnique("class", "horizontal", array("vertical", "horizontal")); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
36 | 36 | * hide the divider |
37 | 37 | * @return \Ajax\semantic\html\elements\HtmlDivider |
38 | 38 | */ |
39 | - public function setHidden(){ |
|
39 | + public function setHidden() { |
|
40 | 40 | return $this->addToProperty("class", "hidden"); |
41 | 41 | } |
42 | 42 | |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | * fitted, without any space above or below it |
45 | 45 | * @return \Ajax\semantic\html\elements\HtmlDivider |
46 | 46 | */ |
47 | - public function setFitted(){ |
|
47 | + public function setFitted() { |
|
48 | 48 | return $this->addToProperty("class", "fitted"); |
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | 52 | * @return \Ajax\semantic\html\elements\HtmlDivider |
53 | 53 | */ |
54 | - public function asHeader(){ |
|
54 | + public function asHeader() { |
|
55 | 55 | return $this->addToProperty("class", "header"); |
56 | 56 | } |
57 | 57 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * inverts the divider colors |
60 | 60 | * @return \Ajax\semantic\html\elements\HtmlDivider |
61 | 61 | */ |
62 | - public function setInverted(){ |
|
62 | + public function setInverted() { |
|
63 | 63 | return $this->addToProperty("class", "inverted"); |
64 | 64 | } |
65 | 65 | } |
66 | 66 | \ No newline at end of file |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | class HtmlSemSingleElement extends HtmlSingleElement { |
15 | 15 | use BaseTrait; |
16 | - public function __construct($identifier, $tagName="br",$baseClass="ui") { |
|
16 | + public function __construct($identifier, $tagName="br", $baseClass="ui") { |
|
17 | 17 | parent::__construct($identifier, $tagName); |
18 | 18 | $this->_baseClass=$baseClass; |
19 | 19 | $this->setClass($baseClass); |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | class TextAlignment extends BaseEnum { |
8 | - const LEFT="left aligned",CENTER="center aligned",RIGHT="right aligned",JUSTIFIED="justified"; |
|
8 | + const LEFT="left aligned", CENTER="center aligned", RIGHT="right aligned", JUSTIFIED="justified"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | class Style extends BaseEnum { |
8 | - const INFO="info",SUCCESS="success",POSITIVE="positive",WARNING="warning",ERROR="error",NEGATIVE="negative"; |
|
8 | + const INFO="info", SUCCESS="success", POSITIVE="positive", WARNING="warning", ERROR="error", NEGATIVE="negative"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base\constants; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Sens extends BaseEnum { |
5 | - const VERTICAL="vertical", HORIZONTAL="horizontal",NONE=""; |
|
5 | + const VERTICAL="vertical", HORIZONTAL="horizontal", 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 | class SegmentType extends BaseEnum { |
8 | - const RAISED="raised",STACKED="stacked",PILED="piled",NORMAL=""; |
|
8 | + const RAISED="raised", STACKED="stacked", PILED="piled", NORMAL=""; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Wide extends BaseEnum { |
5 | - const W1="one", W2="two", W3="three", W4="four",W5="five", W6="six", W7="seven", W8="eight",W9="nine",W10="ten",W11="eleven",W12="twelve",W13="thirteen",W14="fourteen",W15="fifteen",W16="sixteen"; |
|
5 | + const W1="one", W2="two", W3="three", W4="four", W5="five", W6="six", W7="seven", W8="eight", W9="nine", W10="ten", W11="eleven", W12="twelve", W13="thirteen", W14="fourteen", W15="fifteen", W16="sixteen"; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |