@@ -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 |
@@ -24,38 +24,38 @@ discard block |
||
24 | 24 | $this->setContent($content); |
25 | 25 | } |
26 | 26 | |
27 | - public function addHeader($header){ |
|
27 | + public function addHeader($header) { |
|
28 | 28 | $headerO=$header; |
29 | - if(\is_string($header)){ |
|
30 | - $headerO=new HtmlSemDoubleElement("header-".$this->identifier,"div"); |
|
29 | + if (\is_string($header)) { |
|
30 | + $headerO=new HtmlSemDoubleElement("header-".$this->identifier, "div"); |
|
31 | 31 | $headerO->setClass("header"); |
32 | 32 | $headerO->setContent($header); |
33 | 33 | } |
34 | - return $this->addContent($headerO,true); |
|
34 | + return $this->addContent($headerO, true); |
|
35 | 35 | } |
36 | 36 | |
37 | - public function addList($elements,$ordered=false){ |
|
38 | - $list=new HtmlList("list-".$this->identifier,$elements); |
|
37 | + public function addList($elements, $ordered=false) { |
|
38 | + $list=new HtmlList("list-".$this->identifier, $elements); |
|
39 | 39 | $list->setOrdered($ordered); |
40 | 40 | $list->setClass("ui list"); |
41 | 41 | $this->addContent($list); |
42 | 42 | } |
43 | 43 | |
44 | - public function setIcon($icon){ |
|
44 | + public function setIcon($icon) { |
|
45 | 45 | $this->addToProperty("class", "icon"); |
46 | - $this->wrapContent("<div class='content'>","</div>"); |
|
46 | + $this->wrapContent("<div class='content'>", "</div>"); |
|
47 | 47 | $this->icon=new HtmlIcon("icon-".$this->identifier, $icon); |
48 | 48 | return $this; |
49 | 49 | } |
50 | 50 | |
51 | - public function addLoader($loaderIcon="notched circle"){ |
|
51 | + public function addLoader($loaderIcon="notched circle") { |
|
52 | 52 | $this->setIcon($loaderIcon); |
53 | 53 | $this->icon->addToIcon("loading"); |
54 | 54 | return $this; |
55 | 55 | } |
56 | 56 | |
57 | - public function setDismissable($dismiss=true){ |
|
58 | - if($dismiss===true) |
|
57 | + public function setDismissable($dismiss=true) { |
|
58 | + if ($dismiss===true) |
|
59 | 59 | $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
60 | 60 | else |
61 | 61 | $this->close=NULL; |
@@ -66,28 +66,28 @@ discard block |
||
66 | 66 | * {@inheritDoc} |
67 | 67 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
68 | 68 | */ |
69 | - public function run(JsUtils $js){ |
|
69 | + public function run(JsUtils $js) { |
|
70 | 70 | parent::run($js); |
71 | - if(isset($this->close)){ |
|
71 | + if (isset($this->close)) { |
|
72 | 72 | $js->execOn("click", "#".$this->identifier." .close", "$(this).closest('.message').transition('fade')"); |
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | - public function setState($visible=true){ |
|
77 | - $visible=($visible===true)?"visible":"hidden"; |
|
78 | - return $this->addToPropertyCtrl("class", $visible, array("visible","hidden")); |
|
76 | + public function setState($visible=true) { |
|
77 | + $visible=($visible===true) ? "visible" : "hidden"; |
|
78 | + return $this->addToPropertyCtrl("class", $visible, array("visible", "hidden")); |
|
79 | 79 | } |
80 | 80 | |
81 | - public function setVariation($value="floating"){ |
|
82 | - return $this->addToPropertyCtrl("class", $value, array("floating","compact")); |
|
81 | + public function setVariation($value="floating") { |
|
82 | + return $this->addToPropertyCtrl("class", $value, array("floating", "compact")); |
|
83 | 83 | } |
84 | 84 | |
85 | - public function setStyle($style){ |
|
85 | + public function setStyle($style) { |
|
86 | 86 | return $this->addToPropertyCtrl("class", $style, Style::getConstants()); |
87 | 87 | } |
88 | 88 | |
89 | - public function setAttached(HtmlDoubleElement $toElement=NULL){ |
|
90 | - if(isset($toElement)){ |
|
89 | + public function setAttached(HtmlDoubleElement $toElement=NULL) { |
|
90 | + if (isset($toElement)) { |
|
91 | 91 | $toElement->addToProperty("class", "attached"); |
92 | 92 | } |
93 | 93 | return $this->addToProperty("class", "attached"); |
@@ -55,10 +55,11 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | public function setDismissable($dismiss=true){ |
58 | - if($dismiss===true) |
|
59 | - $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
60 | - else |
|
61 | - $this->close=NULL; |
|
58 | + if($dismiss===true) { |
|
59 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
60 | + } else { |
|
61 | + $this->close=NULL; |
|
62 | + } |
|
62 | 63 | return $this; |
63 | 64 | } |
64 | 65 |
@@ -5,23 +5,23 @@ discard block |
||
5 | 5 | use Ajax\common\html\HtmlDoubleElement; |
6 | 6 | |
7 | 7 | abstract class HtmlCollection extends HtmlDoubleElement { |
8 | - public function __construct($identifier,$tagName="div"){ |
|
9 | - parent::__construct($identifier,$tagName); |
|
8 | + public function __construct($identifier, $tagName="div") { |
|
9 | + parent::__construct($identifier, $tagName); |
|
10 | 10 | $this->content=array(); |
11 | 11 | } |
12 | 12 | |
13 | - public function addItems($items){ |
|
14 | - foreach ($items as $item){ |
|
13 | + public function addItems($items) { |
|
14 | + foreach ($items as $item) { |
|
15 | 15 | $this->addItem($item); |
16 | 16 | } |
17 | 17 | } |
18 | 18 | |
19 | - public function setItems($items){ |
|
19 | + public function setItems($items) { |
|
20 | 20 | $this->content=$items; |
21 | 21 | return $this; |
22 | 22 | } |
23 | 23 | |
24 | - public function getItems(){ |
|
24 | + public function getItems() { |
|
25 | 25 | return $this->content; |
26 | 26 | } |
27 | 27 | |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | * @param HtmlDoubleElement|string $item |
31 | 31 | * @return \Ajax\common\html\HtmlDoubleElement |
32 | 32 | */ |
33 | - public function addItem($item){ |
|
33 | + public function addItem($item) { |
|
34 | 34 | $itemO=$item; |
35 | - if(\is_string($item)){ |
|
35 | + if (\is_string($item)) { |
|
36 | 36 | $itemO=$this->createItem($item); |
37 | 37 | } |
38 | 38 | $this->addContent($itemO); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | return $this; |
59 | 59 | } |
60 | 60 | |
61 | - public function count(){ |
|
61 | + public function count() { |
|
62 | 62 | return \sizeof($this->content); |
63 | 63 | } |
64 | 64 | /** |
@@ -45,9 +45,9 @@ |
||
45 | 45 | * @return \Ajax\common\html\HtmlDoubleElement |
46 | 46 | */ |
47 | 47 | public function getItem($index) { |
48 | - if (is_int($index)) |
|
49 | - return $this->content[$index]; |
|
50 | - else { |
|
48 | + if (is_int($index)) { |
|
49 | + return $this->content[$index]; |
|
50 | + } else { |
|
51 | 51 | $elm=$this->getElementById($index, $this->content); |
52 | 52 | return $elm; |
53 | 53 | } |
@@ -13,8 +13,8 @@ |
||
13 | 13 | parent::__construct($identifier, "ul"); |
14 | 14 | $this->addItems($items); |
15 | 15 | } |
16 | - public function setOrdered($ordered=true){ |
|
17 | - $this->tagName=($ordered===true)?"ol":"ul"; |
|
16 | + public function setOrdered($ordered=true) { |
|
17 | + $this->tagName=($ordered===true) ? "ol" : "ul"; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -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 |
@@ -5,18 +5,18 @@ discard block |
||
5 | 5 | use Ajax\common\html\html5\HtmlCollection; |
6 | 6 | use Ajax\semantic\html\base\SegmentType; |
7 | 7 | |
8 | -class HtmlSegmentGroups extends HtmlCollection{ |
|
8 | +class HtmlSegmentGroups extends HtmlCollection { |
|
9 | 9 | |
10 | 10 | |
11 | - public function __construct( $identifier, $items=array()){ |
|
12 | - parent::__construct( $identifier, "div"); |
|
11 | + public function __construct($identifier, $items=array()) { |
|
12 | + parent::__construct($identifier, "div"); |
|
13 | 13 | $this->setClass("ui segments"); |
14 | 14 | $this->addItems($items); |
15 | 15 | } |
16 | 16 | |
17 | 17 | |
18 | - protected function createItem($value){ |
|
19 | - return new HtmlSegment("segment-".$this->count(),$value); |
|
18 | + protected function createItem($value) { |
|
19 | + return new HtmlSegment("segment-".$this->count(), $value); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -24,17 +24,17 @@ discard block |
||
24 | 24 | * @param string $type one of "raised","stacked","piled" default : "" |
25 | 25 | * @return \Ajax\semantic\html\elements\HtmlSegmentGroups |
26 | 26 | */ |
27 | - public function setType($type){ |
|
27 | + public function setType($type) { |
|
28 | 28 | return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); |
29 | 29 | } |
30 | 30 | |
31 | - public function setSens($sens="vertical"){ |
|
32 | - return $this->addToPropertyCtrl("class", $sens, array("vertical","horizontal")); |
|
31 | + public function setSens($sens="vertical") { |
|
32 | + return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal")); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | - public static function group($identifier,$items=array(),$type="",$sens="vertical"){ |
|
37 | - $group=new HtmlSegmentGroups($identifier,$items); |
|
36 | + public static function group($identifier, $items=array(), $type="", $sens="vertical") { |
|
37 | + $group=new HtmlSegmentGroups($identifier, $items); |
|
38 | 38 | $group->setSens($sens); |
39 | 39 | return $group->setType($type); |
40 | 40 | } |
@@ -24,47 +24,47 @@ |
||
24 | 24 | * @param string $type one of "raised","stacked","piled" default : "" |
25 | 25 | * @return \Ajax\semantic\html\elements\HtmlSegment |
26 | 26 | */ |
27 | - public function setType($type){ |
|
27 | + public function setType($type) { |
|
28 | 28 | return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); |
29 | 29 | } |
30 | 30 | |
31 | - public function setSens($sens="vertical"){ |
|
32 | - return $this->addToPropertyCtrl("class", $sens, array("vertical","horizontal")); |
|
31 | + public function setSens($sens="vertical") { |
|
32 | + return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal")); |
|
33 | 33 | } |
34 | 34 | |
35 | - public function setInverted(){ |
|
35 | + public function setInverted() { |
|
36 | 36 | return $this->addToProperty("class", "inverted"); |
37 | 37 | } |
38 | 38 | |
39 | - public function setAttached(){ |
|
39 | + public function setAttached() { |
|
40 | 40 | return $this->addToProperty("class", "attached"); |
41 | 41 | } |
42 | 42 | |
43 | - public function setEmphasis($value="secondary"){ |
|
44 | - return $this->addToPropertyCtrl("class", $value, array("secondary","tertiary","")); |
|
43 | + public function setEmphasis($value="secondary") { |
|
44 | + return $this->addToPropertyCtrl("class", $value, array("secondary", "tertiary", "")); |
|
45 | 45 | } |
46 | 46 | |
47 | - public function setCircular(){ |
|
47 | + public function setCircular() { |
|
48 | 48 | return $this->addToProperty("class", "circular"); |
49 | 49 | } |
50 | 50 | |
51 | - public function clear(){ |
|
51 | + public function clear() { |
|
52 | 52 | return $this->addToProperty("class", "clearing"); |
53 | 53 | } |
54 | 54 | |
55 | - public function setFloating($value="left"){ |
|
56 | - return $this->addToPropertyCtrl("class", "floated ".$value,array("floated right","floated left")); |
|
55 | + public function setFloating($value="left") { |
|
56 | + return $this->addToPropertyCtrl("class", "floated ".$value, array("floated right", "floated left")); |
|
57 | 57 | } |
58 | 58 | |
59 | - public function setTextAlignment($value="left"){ |
|
60 | - return $this->addToPropertyCtrl("class", "aligned ".$value,array("aligned right","aligned left","aligned center")); |
|
59 | + public function setTextAlignment($value="left") { |
|
60 | + return $this->addToPropertyCtrl("class", "aligned ".$value, array("aligned right", "aligned left", "aligned center")); |
|
61 | 61 | } |
62 | 62 | |
63 | - public function setCompact(){ |
|
63 | + public function setCompact() { |
|
64 | 64 | return $this->addToProperty("class", "compact"); |
65 | 65 | } |
66 | 66 | |
67 | - public function setBasic(){ |
|
67 | + public function setBasic() { |
|
68 | 68 | return $this->setProperty("class", "ui basic segment"); |
69 | 69 | } |
70 | 70 |
@@ -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%"; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | public function __construct($identifier, $items=array()) { |
16 | 16 | parent::__construct($identifier, "div"); |
17 | 17 | $this->setClass("ui menu"); |
18 | - foreach ($items as $item){ |
|
18 | + foreach ($items as $item) { |
|
19 | 19 | $this->addItem($item); |
20 | 20 | } |
21 | 21 | } |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | * @param string $type one of text,item |
26 | 26 | * @return \Ajax\semantic\html\collections\HtmlMenu |
27 | 27 | */ |
28 | - public function setType($type=""){ |
|
29 | - return $this->addToPropertyCtrl("class", $type, array("","item","text")); |
|
28 | + public function setType($type="") { |
|
29 | + return $this->addToPropertyCtrl("class", $type, array("", "item", "text")); |
|
30 | 30 | } |
31 | 31 | |
32 | - public function setActiveItem($index){ |
|
32 | + public function setActiveItem($index) { |
|
33 | 33 | $item=$this->getItem($index); |
34 | - if($item!==null){ |
|
34 | + if ($item!==null) { |
|
35 | 35 | $item->addToProperty("class", "active"); |
36 | 36 | } |
37 | 37 | return $this; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * {@inheritDoc} |
42 | 42 | * @see \Ajax\common\html\html5\HtmlCollection::addItem() |
43 | 43 | */ |
44 | - public function addItem($item){ |
|
44 | + public function addItem($item) { |
|
45 | 45 | $item=parent::addItem($item); |
46 | 46 | $item->addToProperty("class", "item"); |
47 | 47 | } |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | * @see \Ajax\common\html\html5\HtmlCollection::createItem() |
51 | 51 | */ |
52 | 52 | protected function createItem($value) { |
53 | - $itemO=new HtmlLink("item-".\sizeof($this->content),"",$value); |
|
53 | + $itemO=new HtmlLink("item-".\sizeof($this->content), "", $value); |
|
54 | 54 | return $itemO->setClass("item"); |
55 | 55 | } |
56 | 56 | |
57 | - public function setInverted(){ |
|
57 | + public function setInverted() { |
|
58 | 58 | return $this->addToProperty("class", "inverted"); |
59 | 59 | } |
60 | 60 | } |
61 | 61 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | class HtmlPopup extends HtmlSemDoubleElement { |
11 | 11 | private $params; |
12 | 12 | private $_container; |
13 | - public function __construct(BaseHtml $container,$identifier, $content="") { |
|
13 | + public function __construct(BaseHtml $container, $identifier, $content="") { |
|
14 | 14 | parent::__construct($identifier, "div"); |
15 | 15 | $this->_container=$container; |
16 | 16 | $this->setClass("ui popup"); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $this->params=array("on"=>"click"); |
19 | 19 | } |
20 | 20 | |
21 | - public function setFlowing(){ |
|
21 | + public function setFlowing() { |
|
22 | 22 | $this->addToProperty("class", "flowing"); |
23 | 23 | } |
24 | 24 | |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | * {@inheritDoc} |
27 | 27 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
28 | 28 | */ |
29 | - public function run(JsUtils $js){ |
|
29 | + public function run(JsUtils $js) { |
|
30 | 30 | $this->params["popup"]="#".$this->identifier; |
31 | - $js->semantic()->popup("#".$this->_container->getIdentifier(),$this->params); |
|
31 | + $js->semantic()->popup("#".$this->_container->getIdentifier(), $this->params); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | \ No newline at end of file |