@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base\constants; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Social extends BaseEnum { |
5 | - const FACEBOOK="facebook", TWITTER="twitter",GOOGLEPLUS="google plus",VK="vk",LINKEDIN="linkedin",INSTAGRAM="instagram",YOUTUBE="youtube"; |
|
5 | + const FACEBOOK="facebook", TWITTER="twitter", GOOGLEPLUS="google plus", VK="vk", LINKEDIN="linkedin", INSTAGRAM="instagram", YOUTUBE="youtube"; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |
@@ -10,10 +10,10 @@ |
||
10 | 10 | * @author jc |
11 | 11 | * @version 1.001 |
12 | 12 | */ |
13 | -abstract class HtmlSemCollection extends HtmlCollection{ |
|
13 | +abstract class HtmlSemCollection extends HtmlCollection { |
|
14 | 14 | use BaseTrait; |
15 | - public function __construct( $identifier, $tagName="div",$baseClass=""){ |
|
16 | - parent::__construct( $identifier, $tagName); |
|
15 | + public function __construct($identifier, $tagName="div", $baseClass="") { |
|
16 | + parent::__construct($identifier, $tagName); |
|
17 | 17 | $this->_baseClass=$baseClass; |
18 | 18 | $this->setClass($baseClass); |
19 | 19 | } |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | * @version 1.001 |
19 | 19 | */ |
20 | 20 | class HtmlSegment extends HtmlSemDoubleElement { |
21 | - use AttachedTrait,TextAlignmentTrait; |
|
21 | + use AttachedTrait, TextAlignmentTrait; |
|
22 | 22 | |
23 | 23 | public function __construct($identifier, $content="") { |
24 | 24 | parent::__construct($identifier, "div", "ui segment"); |
25 | - $this->_variations=\array_merge($this->_variations, [ Variation::PADDED,Variation::COMPACT ]); |
|
26 | - $this->_states=\array_merge($this->_states, [ State::LOADING ]); |
|
25 | + $this->_variations=\array_merge($this->_variations, [Variation::PADDED, Variation::COMPACT]); |
|
26 | + $this->_states=\array_merge($this->_states, [State::LOADING]); |
|
27 | 27 | $this->content=$content; |
28 | 28 | } |
29 | 29 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | public function setSens($sens="vertical") { |
40 | - return $this->addToPropertyCtrl("class", $sens, array ("vertical","horizontal" )); |
|
40 | + return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal")); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | public function setEmphasis($value=Emphasis::SECONDARY) { |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | public function asContainer() { |
64 | - return $this->addToPropertyCtrl("class", "container", array ("container" )); |
|
64 | + return $this->addToPropertyCtrl("class", "container", array("container")); |
|
65 | 65 | } |
66 | 66 | |
67 | - public function addGrid($numRows=1, $numCols=NULL){ |
|
68 | - $grid=new HtmlGrid("Grid-".$this->identifier,$numRows,$numCols); |
|
67 | + public function addGrid($numRows=1, $numCols=NULL) { |
|
68 | + $grid=new HtmlGrid("Grid-".$this->identifier, $numRows, $numCols); |
|
69 | 69 | $this->content=$grid; |
70 | 70 | return $grid; |
71 | 71 | } |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | */ |
16 | 16 | class HtmlLabelGroups extends HtmlSemCollection { |
17 | 17 | |
18 | - public function __construct($identifier,$labels=array(), $attributes=array()) { |
|
18 | + public function __construct($identifier, $labels=array(), $attributes=array()) { |
|
19 | 19 | parent::__construct($identifier, "div", "ui labels"); |
20 | - $this->_states=\array_merge(Size::getConstants(),Color::getConstants(),["tag","circular"]); |
|
20 | + $this->_states=\array_merge(Size::getConstants(), Color::getConstants(), ["tag", "circular"]); |
|
21 | 21 | $this->addItems($labels); |
22 | 22 | $this->setStates($attributes); |
23 | 23 | } |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | $icon=JArray::getValue($value, "icon", 1); |
32 | 32 | $tagName=JArray::getValue($value, "tagName", 2); |
33 | 33 | } |
34 | - $labelO=new HtmlLabel("label-" . $this->identifier, $caption,$icon,$tagName); |
|
34 | + $labelO=new HtmlLabel("label-".$this->identifier, $caption, $icon, $tagName); |
|
35 | 35 | return $labelO; |
36 | 36 | } |
37 | 37 | |
38 | 38 | protected function createCondition($value) { |
39 | - return ($value instanceof HtmlLabel) === false; |
|
39 | + return ($value instanceof HtmlLabel)===false; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -10,64 +10,64 @@ |
||
10 | 10 | |
11 | 11 | class HtmlReveal extends HtmlSemDoubleElement { |
12 | 12 | |
13 | - public function __construct($identifier, $visibleContent,$hiddenContent,$type=RevealType::FADE,$attributeType=NULL) { |
|
13 | + public function __construct($identifier, $visibleContent, $hiddenContent, $type=RevealType::FADE, $attributeType=NULL) { |
|
14 | 14 | parent::__construct($identifier, "div", "ui reveal"); |
15 | 15 | $this->setElement(0, $visibleContent); |
16 | 16 | $this->setElement(1, $hiddenContent); |
17 | - $this->setType($type,$attributeType); |
|
17 | + $this->setType($type, $attributeType); |
|
18 | 18 | } |
19 | 19 | |
20 | - private function setElement($index,$content){ |
|
21 | - if(!$content instanceof HtmlSingleElement){ |
|
22 | - $content=new HtmlLabel("",$content); |
|
20 | + private function setElement($index, $content) { |
|
21 | + if (!$content instanceof HtmlSingleElement) { |
|
22 | + $content=new HtmlLabel("", $content); |
|
23 | 23 | } |
24 | - if($content instanceof HtmlSemDoubleElement){ |
|
25 | - $content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content); |
|
26 | - }elseif ($content instanceof HtmlImg){ |
|
24 | + if ($content instanceof HtmlSemDoubleElement) { |
|
25 | + $content=new HtmlSemDoubleElement($this->identifier."-".$index, "div", "", $content); |
|
26 | + }elseif ($content instanceof HtmlImg) { |
|
27 | 27 | $this->addToPropertyCtrl("class", "image", array("image")); |
28 | 28 | } |
29 | - $content->addToProperty("class",(($index===0)?"visible":"hidden")." content"); |
|
29 | + $content->addToProperty("class", (($index===0) ? "visible" : "hidden")." content"); |
|
30 | 30 | $this->content[$index]=$content; |
31 | 31 | return $this; |
32 | 32 | } |
33 | 33 | |
34 | - public function setVisibleContent($visibleContent){ |
|
34 | + public function setVisibleContent($visibleContent) { |
|
35 | 35 | return $this->setElement(0, $visibleContent); |
36 | 36 | } |
37 | 37 | |
38 | - public function setHiddenContent($hiddenContent){ |
|
38 | + public function setHiddenContent($hiddenContent) { |
|
39 | 39 | return $this->setElement(1, $hiddenContent); |
40 | 40 | } |
41 | 41 | |
42 | - public function getVisibleContent(){ |
|
42 | + public function getVisibleContent() { |
|
43 | 43 | return $this->content[0]; |
44 | 44 | } |
45 | 45 | |
46 | - public function getHiddenContent(){ |
|
46 | + public function getHiddenContent() { |
|
47 | 47 | return $this->content[1]; |
48 | 48 | } |
49 | 49 | |
50 | - public function setType($type,$attribute=NULL){ |
|
50 | + public function setType($type, $attribute=NULL) { |
|
51 | 51 | $this->addToPropertyCtrl("class", $type, RevealType::getConstants()); |
52 | - if(isset($attribute)){ |
|
52 | + if (isset($attribute)) { |
|
53 | 53 | $this->addToPropertyCtrl("class", $attribute, Direction::getConstants()); |
54 | 54 | } |
55 | 55 | return $this; |
56 | 56 | } |
57 | 57 | |
58 | - public function setFade($attribute=NULL){ |
|
59 | - return $this->setType(RevealType::FADE,$attribute); |
|
58 | + public function setFade($attribute=NULL) { |
|
59 | + return $this->setType(RevealType::FADE, $attribute); |
|
60 | 60 | } |
61 | 61 | |
62 | - public function setMove($attribute=NULL){ |
|
63 | - return $this->setType(RevealType::MOVE,$attribute); |
|
62 | + public function setMove($attribute=NULL) { |
|
63 | + return $this->setType(RevealType::MOVE, $attribute); |
|
64 | 64 | } |
65 | 65 | |
66 | - public function setRotate($attribute=NULL){ |
|
67 | - return $this->setType(RevealType::ROTATE,$attribute); |
|
66 | + public function setRotate($attribute=NULL) { |
|
67 | + return $this->setType(RevealType::ROTATE, $attribute); |
|
68 | 68 | } |
69 | 69 | |
70 | - public function setCircular(){ |
|
70 | + public function setCircular() { |
|
71 | 71 | return $this->addToProperty("class", "circular"); |
72 | 72 | } |
73 | 73 |
@@ -13,11 +13,11 @@ |
||
13 | 13 | class HtmlContainer extends HtmlSemDoubleElement { |
14 | 14 | use TextAlignmentTrait; |
15 | 15 | public function __construct($identifier, $content="") { |
16 | - parent::__construct($identifier, "div","ui container"); |
|
16 | + parent::__construct($identifier, "div", "ui container"); |
|
17 | 17 | $this->content=$content; |
18 | 18 | } |
19 | 19 | |
20 | - public function asText(){ |
|
20 | + public function asText() { |
|
21 | 21 | return $this->addToProperty("class", "text"); |
22 | 22 | } |
23 | 23 | } |
24 | 24 | \ No newline at end of file |
@@ -4,11 +4,11 @@ |
||
4 | 4 | |
5 | 5 | |
6 | 6 | class HtmlAccordionMenuItem extends HtmlMenuItem { |
7 | - public function __construct($identifier,$title,$content) { |
|
8 | - parent::__construct($identifier, new HtmlAccordionItem("accordion-".$identifier, $title,$content)); |
|
7 | + public function __construct($identifier, $title, $content) { |
|
8 | + parent::__construct($identifier, new HtmlAccordionItem("accordion-".$identifier, $title, $content)); |
|
9 | 9 | } |
10 | 10 | |
11 | - public function setActive($value=true){ |
|
11 | + public function setActive($value=true) { |
|
12 | 12 | $this->content->setActive($value); |
13 | 13 | return $this; |
14 | 14 | } |
@@ -20,30 +20,30 @@ |
||
20 | 20 | $this->_title=$title; |
21 | 21 | } |
22 | 22 | |
23 | - public function setTitle($title){ |
|
23 | + public function setTitle($title) { |
|
24 | 24 | $this->_title=$title; |
25 | 25 | } |
26 | 26 | |
27 | - public function setIcon($icon){ |
|
27 | + public function setIcon($icon) { |
|
28 | 28 | $this->_icon=$icon; |
29 | 29 | } |
30 | 30 | |
31 | - protected function createTitleElement(){ |
|
32 | - $element=new HtmlSemDoubleElement("title-".$this->identifier,"div","title"); |
|
33 | - $element->setContent(array(new HtmlIcon("", $this->_icon),$this->_title)); |
|
34 | - if($this->_active===true) |
|
31 | + protected function createTitleElement() { |
|
32 | + $element=new HtmlSemDoubleElement("title-".$this->identifier, "div", "title"); |
|
33 | + $element->setContent(array(new HtmlIcon("", $this->_icon), $this->_title)); |
|
34 | + if ($this->_active===true) |
|
35 | 35 | $element->addToProperty("class", "active"); |
36 | 36 | return $element; |
37 | 37 | } |
38 | 38 | |
39 | - public function compile(JsUtils $js=NULL, &$view=NULL){ |
|
39 | + public function compile(JsUtils $js=NULL, &$view=NULL) { |
|
40 | 40 | $this->titleElement=$this->createTitleElement(); |
41 | - return parent::compile($js,$view); |
|
41 | + return parent::compile($js, $view); |
|
42 | 42 | } |
43 | 43 | |
44 | - public function setActive($value=true){ |
|
44 | + public function setActive($value=true) { |
|
45 | 45 | $this->_active=$value; |
46 | - if($value===true) |
|
46 | + if ($value===true) |
|
47 | 47 | $this->addToPropertyCtrl("class", "active", array("active")); |
48 | 48 | else |
49 | 49 | $this->removePropertyValue("class", "active"); |
@@ -15,16 +15,16 @@ discard block |
||
15 | 15 | |
16 | 16 | private function addElement($content, $baseClass) { |
17 | 17 | $count=\sizeof($this->content); |
18 | - $result=new HtmlSemDoubleElement("element-" . $count . "-" . $this->identifier, "div", $baseClass, $content); |
|
18 | + $result=new HtmlSemDoubleElement("element-".$count."-".$this->identifier, "div", $baseClass, $content); |
|
19 | 19 | $this->addContent($result); |
20 | 20 | return $result; |
21 | 21 | } |
22 | 22 | |
23 | 23 | public function addMeta($value, $direction=Direction::LEFT) { |
24 | - if (\array_key_exists("meta", $this->content) === false) { |
|
25 | - $this->content["meta"]=new HtmlSemDoubleElement("meta-" . $this->identifier, "div", "meta", array ()); |
|
24 | + if (\array_key_exists("meta", $this->content)===false) { |
|
25 | + $this->content["meta"]=new HtmlSemDoubleElement("meta-".$this->identifier, "div", "meta", array()); |
|
26 | 26 | } |
27 | - if ($direction === Direction::RIGHT) { |
|
27 | + if ($direction===Direction::RIGHT) { |
|
28 | 28 | $value=new HtmlSemDoubleElement("", "span", "", $value); |
29 | 29 | $value->setFloated($direction); |
30 | 30 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function addMetas($metas) { |
44 | 44 | if (\is_array($metas)) { |
45 | - foreach ( $metas as $meta ) { |
|
45 | + foreach ($metas as $meta) { |
|
46 | 46 | $this->addMeta($meta); |
47 | 47 | } |
48 | 48 | } else |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | public function addContentIcon($icon, $caption=NULL, $direction=Direction::LEFT) { |
54 | - if ($direction === Direction::RIGHT) { |
|
54 | + if ($direction===Direction::RIGHT) { |
|
55 | 55 | if (isset($caption)) { |
56 | 56 | $result=new HtmlSemDoubleElement("", "span", "", $caption); |
57 | 57 | $result->addIcon($icon); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | public function addContentText($caption, $direction=Direction::LEFT) { |
72 | - if ($direction === Direction::RIGHT) { |
|
72 | + if ($direction===Direction::RIGHT) { |
|
73 | 73 | $result=new HtmlSemDoubleElement("", "span", "", $caption); |
74 | 74 | $this->addContent($result); |
75 | 75 | $result->setFloated($direction); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | public function addContentIcons($icons, $direction=Direction::LEFT) { |
82 | - foreach ( $icons as $icon ) { |
|
82 | + foreach ($icons as $icon) { |
|
83 | 83 | $this->addContentIcon($icon, NULL, $direction); |
84 | 84 | } |
85 | 85 | return $this; |