@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Size extends BaseEnum { |
5 | - const MASSIVE="massive",HUGE="huge",BIG="big",LARGE="large",MEDIUM="",SMALL="small",MINI="mini",TINY="tiny"; |
|
5 | + const MASSIVE="massive", HUGE="huge", BIG="big", LARGE="large", MEDIUM="", SMALL="small", MINI="mini", TINY="tiny"; |
|
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 Variation extends BaseEnum { |
8 | - const ANIMATED="animated",AVATAR="avatar",COMPACT="compact",INVERTED="inverted",PADDED="padded"; |
|
8 | + const ANIMATED="animated", AVATAR="avatar", COMPACT="compact", INVERTED="inverted", PADDED="padded"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -9,20 +9,20 @@ discard block |
||
9 | 9 | protected $_states=[]; |
10 | 10 | protected $_baseClass; |
11 | 11 | |
12 | - public function addVariation($variation){ |
|
12 | + public function addVariation($variation) { |
|
13 | 13 | return $this->addToPropertyCtrl("class", $variation, $this->_variations); |
14 | 14 | } |
15 | 15 | |
16 | - public function addState($state){ |
|
16 | + public function addState($state) { |
|
17 | 17 | return $this->addToPropertyCtrl("class", $state, $this->_states); |
18 | 18 | } |
19 | 19 | |
20 | - public function setVariation($variation){ |
|
20 | + public function setVariation($variation) { |
|
21 | 21 | $this->setPropertyCtrl("class", $variation, $this->_variations); |
22 | 22 | return $this->addToProperty("class", $this->_baseClass); |
23 | 23 | } |
24 | 24 | |
25 | - public function setState($state){ |
|
25 | + public function setState($state) { |
|
26 | 26 | $this->setPropertyCtrl("class", $state, $this->_states); |
27 | 27 | return $this->addToProperty("class", $this->_baseClass); |
28 | 28 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * {@inheritDoc} |
32 | 32 | * @see \Ajax\common\html\HtmlSingleElement::setSize() |
33 | 33 | */ |
34 | - public function setSize($size){ |
|
34 | + public function setSize($size) { |
|
35 | 35 | return $this->addToPropertyCtrl("class", $size, Size::getConstants()); |
36 | 36 | } |
37 | 37 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * show it is currently unable to be interacted with |
40 | 40 | * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement |
41 | 41 | */ |
42 | - public function setDisabled(){ |
|
42 | + public function setDisabled() { |
|
43 | 43 | return $this->addToProperty("class", "disabled"); |
44 | 44 | } |
45 | 45 | |
@@ -47,18 +47,18 @@ discard block |
||
47 | 47 | * @param string $color |
48 | 48 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
49 | 49 | */ |
50 | - public function setColor($color){ |
|
51 | - return $this->addToPropertyCtrl("class", $color,Color::getConstants()); |
|
50 | + public function setColor($color) { |
|
51 | + return $this->addToPropertyCtrl("class", $color, Color::getConstants()); |
|
52 | 52 | } |
53 | 53 | |
54 | - public function setFluid(){ |
|
54 | + public function setFluid() { |
|
55 | 55 | $this->addToProperty("class", "fluid"); |
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | 59 | * can be formatted to appear on dark backgrounds |
60 | 60 | */ |
61 | - public function setInverted(){ |
|
61 | + public function setInverted() { |
|
62 | 62 | $this->addToProperty("class", "inverted"); |
63 | 63 | } |
64 | 64 | } |
65 | 65 | \ No newline at end of file |
@@ -10,7 +10,7 @@ |
||
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 | 17 | \ No newline at end of file |
@@ -5,13 +5,13 @@ |
||
5 | 5 | use Ajax\service\JString; |
6 | 6 | use Ajax\semantic\html\base\HtmlSemDoubleElement; |
7 | 7 | |
8 | -class HtmlInput extends HtmlSemDoubleElement{ |
|
8 | +class HtmlInput extends HtmlSemDoubleElement { |
|
9 | 9 | |
10 | - public function __construct($identifier,$value="",$type="text",$placeholder=""){ |
|
11 | - parent::__construct("div-".$identifier,"div","ui input"); |
|
12 | - $this->content=new \Ajax\common\html\html5\HtmlInput($identifier,$type); |
|
10 | + public function __construct($identifier, $value="", $type="text", $placeholder="") { |
|
11 | + parent::__construct("div-".$identifier, "div", "ui input"); |
|
12 | + $this->content=new \Ajax\common\html\html5\HtmlInput($identifier, $type); |
|
13 | 13 | $this->content->setProperty("value", $value); |
14 | - if(JString::isNotNull($placeholder)) |
|
14 | + if (JString::isNotNull($placeholder)) |
|
15 | 15 | $this->content->setProperty("placeholder", $placeholder); |
16 | 16 | } |
17 | 17 | } |
18 | 18 | \ No newline at end of file |
@@ -11,7 +11,8 @@ |
||
11 | 11 | parent::__construct("div-".$identifier,"div","ui input"); |
12 | 12 | $this->content=new \Ajax\common\html\html5\HtmlInput($identifier,$type); |
13 | 13 | $this->content->setProperty("value", $value); |
14 | - if(JString::isNotNull($placeholder)) |
|
15 | - $this->content->setProperty("placeholder", $placeholder); |
|
14 | + if(JString::isNotNull($placeholder)) { |
|
15 | + $this->content->setProperty("placeholder", $placeholder); |
|
16 | + } |
|
16 | 17 | } |
17 | 18 | } |
18 | 19 | \ No newline at end of file |
@@ -14,13 +14,13 @@ |
||
14 | 14 | $this->setClass($this->_baseClass); |
15 | 15 | } |
16 | 16 | |
17 | - public function setCircular(){ |
|
17 | + public function setCircular() { |
|
18 | 18 | return $this->addToProperty("class", "circular"); |
19 | 19 | } |
20 | 20 | |
21 | - public function asAvatar($caption=NULL){ |
|
22 | - if(isset($caption)) |
|
23 | - $this->wrap("",$caption); |
|
21 | + public function asAvatar($caption=NULL) { |
|
22 | + if (isset($caption)) |
|
23 | + $this->wrap("", $caption); |
|
24 | 24 | return $this->addToProperty("class", "avatar"); |
25 | 25 | } |
26 | 26 | } |
27 | 27 | \ No newline at end of file |
@@ -19,8 +19,9 @@ |
||
19 | 19 | } |
20 | 20 | |
21 | 21 | public function asAvatar($caption=NULL){ |
22 | - if(isset($caption)) |
|
23 | - $this->wrap("",$caption); |
|
22 | + if(isset($caption)) { |
|
23 | + $this->wrap("",$caption); |
|
24 | + } |
|
24 | 25 | return $this->addToProperty("class", "avatar"); |
25 | 26 | } |
26 | 27 | } |
27 | 28 | \ No newline at end of file |
@@ -6,17 +6,17 @@ discard block |
||
6 | 6 | use Ajax\semantic\html\base\HtmlSemCollection; |
7 | 7 | use Ajax\semantic\html\base\constants\Sens; |
8 | 8 | |
9 | -class HtmlSegmentGroups extends HtmlSemCollection{ |
|
9 | +class HtmlSegmentGroups extends HtmlSemCollection { |
|
10 | 10 | |
11 | 11 | |
12 | - public function __construct( $identifier, $items=array()){ |
|
13 | - parent::__construct( $identifier, "div","ui segments"); |
|
12 | + public function __construct($identifier, $items=array()) { |
|
13 | + parent::__construct($identifier, "div", "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,16 +24,16 @@ 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=Sens::VERTICAL){ |
|
31 | + public function setSens($sens=Sens::VERTICAL) { |
|
32 | 32 | return $this->addToPropertyCtrl("class", $sens, Sens::getConstants()); |
33 | 33 | } |
34 | 34 | |
35 | - public static function group($identifier,$items=array(),$type="",$sens=Sens::VERTICAL){ |
|
36 | - $group=new HtmlSegmentGroups($identifier,$items); |
|
35 | + public static function group($identifier, $items=array(), $type="", $sens=Sens::VERTICAL) { |
|
36 | + $group=new HtmlSegmentGroups($identifier, $items); |
|
37 | 37 | $group->setSens($sens); |
38 | 38 | return $group->setType($type); |
39 | 39 | } |
@@ -11,21 +11,21 @@ |
||
11 | 11 | */ |
12 | 12 | class HtmlIconGroups extends HtmlSemDoubleElement { |
13 | 13 | |
14 | - public function __construct($identifier,$size="") { |
|
15 | - parent::__construct($identifier, "i","icons"); |
|
14 | + public function __construct($identifier, $size="") { |
|
15 | + parent::__construct($identifier, "i", "icons"); |
|
16 | 16 | $this->setSize($size); |
17 | 17 | } |
18 | 18 | |
19 | - public function add($icon,$size=""){ |
|
19 | + public function add($icon, $size="") { |
|
20 | 20 | $iconO=$icon; |
21 | - if(\is_string($icon)){ |
|
21 | + if (\is_string($icon)) { |
|
22 | 22 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
23 | 23 | $iconO->setSize($size); |
24 | 24 | } |
25 | 25 | $this->addContent($iconO); |
26 | 26 | } |
27 | 27 | |
28 | - public function getIcon($index){ |
|
28 | + public function getIcon($index) { |
|
29 | 29 | return $this->content[$index]; |
30 | 30 | } |
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | * @version 1.001 |
18 | 18 | */ |
19 | 19 | class HtmlSegment extends HtmlSemDoubleElement { |
20 | - use AttachedTrait,TextAlignmentTrait; |
|
20 | + use AttachedTrait, TextAlignmentTrait; |
|
21 | 21 | public function __construct($identifier, $content="") { |
22 | - parent::__construct($identifier, "div","ui segment"); |
|
23 | - $this->_variations=\array_merge($this->_variations,[Variation::PADDED,Variation::COMPACT]); |
|
24 | - $this->_states=\array_merge($this->_states,[State::LOADING]); |
|
22 | + parent::__construct($identifier, "div", "ui segment"); |
|
23 | + $this->_variations=\array_merge($this->_variations, [Variation::PADDED, Variation::COMPACT]); |
|
24 | + $this->_states=\array_merge($this->_states, [State::LOADING]); |
|
25 | 25 | $this->content=$content; |
26 | 26 | } |
27 | 27 | |
@@ -30,36 +30,36 @@ discard block |
||
30 | 30 | * @param string $type one of "raised","stacked","piled" default : "" |
31 | 31 | * @return \Ajax\semantic\html\elements\HtmlSegment |
32 | 32 | */ |
33 | - public function setType($type){ |
|
33 | + public function setType($type) { |
|
34 | 34 | return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); |
35 | 35 | } |
36 | 36 | |
37 | - public function setSens($sens="vertical"){ |
|
38 | - return $this->addToPropertyCtrl("class", $sens, array("vertical","horizontal")); |
|
37 | + public function setSens($sens="vertical") { |
|
38 | + return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal")); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | - public function setEmphasis($value=Emphasis::SECONDARY){ |
|
42 | + public function setEmphasis($value=Emphasis::SECONDARY) { |
|
43 | 43 | return $this->addToPropertyCtrl("class", $value, Emphasis::getConstants()); |
44 | 44 | } |
45 | 45 | |
46 | - public function setCircular(){ |
|
46 | + public function setCircular() { |
|
47 | 47 | return $this->addToProperty("class", "circular"); |
48 | 48 | } |
49 | 49 | |
50 | - public function clear(){ |
|
50 | + public function clear() { |
|
51 | 51 | return $this->addToProperty("class", "clearing"); |
52 | 52 | } |
53 | 53 | |
54 | - public function setFloating($value="left"){ |
|
55 | - return $this->addToPropertyCtrl("class", "floated ".$value,array("floated right","floated left")); |
|
54 | + public function setFloating($value="left") { |
|
55 | + return $this->addToPropertyCtrl("class", "floated ".$value, array("floated right", "floated left")); |
|
56 | 56 | } |
57 | 57 | |
58 | - public function setCompact(){ |
|
58 | + public function setCompact() { |
|
59 | 59 | return $this->addToProperty("class", "compact"); |
60 | 60 | } |
61 | 61 | |
62 | - public function setBasic(){ |
|
62 | + public function setBasic() { |
|
63 | 63 | return $this->setProperty("class", "ui basic segment"); |
64 | 64 | } |
65 | 65 |