@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 | |
@@ -10,13 +10,16 @@ |
||
| 10 | 10 | |
| 11 | 11 | class HtmlLabel extends HtmlSemDoubleElement { |
| 12 | 12 | use LabeledIconTrait; |
| 13 | + |
|
| 14 | + /** |
|
| 15 | + * @param string $identifier |
|
| 16 | + */ |
|
| 13 | 17 | public function __construct($identifier,$caption="",$tagName="div") { |
| 14 | 18 | parent::__construct($identifier,$tagName,"ui label"); |
| 15 | 19 | $this->content=$caption; |
| 16 | 20 | } |
| 17 | 21 | |
| 18 | 22 | /** |
| 19 | - * @param string $side |
|
| 20 | 23 | * @return \Ajax\semantic\html\elements\HtmlLabel |
| 21 | 24 | */ |
| 22 | 25 | public function setPointing($value=Direction::NONE){ |
@@ -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); |
@@ -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 |