@@ -2,5 +2,5 @@ |
||
| 2 | 2 | namespace Ajax\semantic\html\base\constants; |
| 3 | 3 | use Ajax\common\BaseEnum; |
| 4 | 4 | abstract class Direction extends BaseEnum { |
| 5 | - const RIGHT="right", LEFT="left",DOWN="down",UP="up",NONE="",BELOW="below"; |
|
| 5 | + const RIGHT="right", LEFT="left", DOWN="down", UP="up", NONE="", BELOW="below"; |
|
| 6 | 6 | } |
@@ -5,5 +5,5 @@ |
||
| 5 | 5 | use Ajax\common\BaseEnum; |
| 6 | 6 | |
| 7 | 7 | abstract class CheckboxType extends BaseEnum { |
| 8 | - const STANDARD="",TOGGLE="toggle",SLIDER="slider"; |
|
| 8 | + const STANDARD="", TOGGLE="toggle", SLIDER="slider"; |
|
| 9 | 9 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $state=\explode(" ", $state); |
| 14 | 14 | } |
| 15 | 15 | if (\is_array($elements)) { |
| 16 | - foreach ( $elements as $element ) { |
|
| 16 | + foreach ($elements as $element) { |
|
| 17 | 17 | if ($element instanceof BaseHtml) { |
| 18 | 18 | self::_add($state, $element); |
| 19 | 19 | } |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | private static function _add($states, $element) { |
| 25 | - foreach ( $states as $state ) { |
|
| 26 | - $element->addToPropertyCtrl("class", $state, array ($state )); |
|
| 25 | + foreach ($states as $state) { |
|
| 26 | + $element->addToPropertyCtrl("class", $state, array($state)); |
|
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -2,5 +2,5 @@ |
||
| 2 | 2 | namespace Ajax\semantic\html\base\constants; |
| 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",TINY="tiny",MINI="mini"; |
|
| 5 | + const MASSIVE="massive", HUGE="huge", BIG="big", LARGE="large", MEDIUM="", SMALL="small", TINY="tiny", MINI="mini"; |
|
| 6 | 6 | } |
@@ -5,5 +5,5 @@ |
||
| 5 | 5 | use Ajax\common\BaseEnum; |
| 6 | 6 | |
| 7 | 7 | abstract class StepStatus extends BaseEnum { |
| 8 | - const ACTIVE="active",COMPLETED="completed",DISABLED="disabled",NONE=""; |
|
| 8 | + const ACTIVE="active", COMPLETED="completed", DISABLED="disabled", NONE=""; |
|
| 9 | 9 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | trait LabeledIconTrait { |
| 14 | 14 | |
| 15 | 15 | abstract public function addToProperty($name, $value, $separator=" "); |
| 16 | - abstract public function addContent($content,$before=false); |
|
| 16 | + abstract public function addContent($content, $before=false); |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Adds an icon before or after |
@@ -22,17 +22,17 @@ discard block |
||
| 22 | 22 | * @param boolean $labeled |
| 23 | 23 | * @return \Ajax\semantic\html\elements\HtmlIcon |
| 24 | 24 | */ |
| 25 | - public function addIcon($icon,$before=true,$labeled=false){ |
|
| 25 | + public function addIcon($icon, $before=true, $labeled=false) { |
|
| 26 | 26 | $iconO=$icon; |
| 27 | - if(\is_string($icon)){ |
|
| 27 | + if (\is_string($icon)) { |
|
| 28 | 28 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
| 29 | 29 | } |
| 30 | - if($labeled!==false){ |
|
| 31 | - $direction=($before===true)?Direction::LEFT:Direction::RIGHT; |
|
| 30 | + if ($labeled!==false) { |
|
| 31 | + $direction=($before===true) ? Direction::LEFT : Direction::RIGHT; |
|
| 32 | 32 | $this->addToProperty("class", $direction." labeled icon"); |
| 33 | 33 | $this->tagName="div"; |
| 34 | 34 | } |
| 35 | - $this->addContent($iconO,$before); |
|
| 35 | + $this->addContent($iconO, $before); |
|
| 36 | 36 | return $iconO; |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -19,16 +19,16 @@ discard block |
||
| 19 | 19 | abstract public function setClass($classNames); |
| 20 | 20 | abstract public function addIcon($icon, $before=true); |
| 21 | 21 | |
| 22 | - public function setContent($content){ |
|
| 23 | - if($content==="-"){ |
|
| 22 | + public function setContent($content) { |
|
| 23 | + if ($content==="-") { |
|
| 24 | 24 | $this->asDivider(); |
| 25 | - }elseif($content==="-search-"){ |
|
| 26 | - $values=\explode(",",$content,-1); |
|
| 27 | - $this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search")); |
|
| 28 | - }elseif(JString::startswith($content, "-")){ |
|
| 29 | - $content=\ltrim($content,"-"); |
|
| 25 | + }elseif ($content==="-search-") { |
|
| 26 | + $values=\explode(",", $content, -1); |
|
| 27 | + $this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."), JArray::getDefaultValue($values, 1, "search")); |
|
| 28 | + }elseif (JString::startswith($content, "-")) { |
|
| 29 | + $content=\ltrim($content, "-"); |
|
| 30 | 30 | $this->asHeader($content); |
| 31 | - }else |
|
| 31 | + } else |
|
| 32 | 32 | parent::setContent($content); |
| 33 | 33 | return $this; |
| 34 | 34 | } |
@@ -38,13 +38,13 @@ discard block |
||
| 38 | 38 | * @param string $icon |
| 39 | 39 | * @return HtmlDropdownItem|HtmlMenuItem |
| 40 | 40 | */ |
| 41 | - public function asSearchInput($placeholder=NULL,$icon=NULL){ |
|
| 41 | + public function asSearchInput($placeholder=NULL, $icon=NULL) { |
|
| 42 | 42 | $this->setClass("ui icon search input"); |
| 43 | 43 | $input=new HtmlInput("search-".$this->identifier); |
| 44 | - if(isset($placeholder)) |
|
| 44 | + if (isset($placeholder)) |
|
| 45 | 45 | $input->setProperty("placeholder", $placeholder); |
| 46 | 46 | $this->content=$input; |
| 47 | - if(isset($icon)) |
|
| 47 | + if (isset($icon)) |
|
| 48 | 48 | $this->addIcon($icon); |
| 49 | 49 | return $this; |
| 50 | 50 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * @return HtmlDropdownItem|HtmlMenuItem |
| 54 | 54 | */ |
| 55 | - public function asDivider(){ |
|
| 55 | + public function asDivider() { |
|
| 56 | 56 | $this->content=NULL; |
| 57 | 57 | $this->tagName="div"; |
| 58 | 58 | $this->setClass("divider"); |
@@ -64,16 +64,16 @@ discard block |
||
| 64 | 64 | * @param string $icon |
| 65 | 65 | * @return HtmlDropdownItem|HtmlMenuItem |
| 66 | 66 | */ |
| 67 | - public function asHeader($caption=NULL,$icon=NULL){ |
|
| 67 | + public function asHeader($caption=NULL, $icon=NULL) { |
|
| 68 | 68 | $this->setClass("header"); |
| 69 | 69 | $this->tagName="div"; |
| 70 | 70 | $this->content=$caption; |
| 71 | - if(isset($icon)) |
|
| 72 | - $this->addIcon($icon,Direction::LEFT); |
|
| 71 | + if (isset($icon)) |
|
| 72 | + $this->addIcon($icon, Direction::LEFT); |
|
| 73 | 73 | return $this; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - public function setPosition($direction){ |
|
| 77 | - $this->addToProperty("class",$direction); |
|
| 76 | + public function setPosition($direction) { |
|
| 77 | + $this->addToProperty("class", $direction); |
|
| 78 | 78 | } |
| 79 | 79 | } |
@@ -12,23 +12,23 @@ |
||
| 12 | 12 | * @param string $value |
| 13 | 13 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
| 14 | 14 | */ |
| 15 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
| 16 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
| 15 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
| 16 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - public function textCenterAligned(){ |
|
| 19 | + public function textCenterAligned() { |
|
| 20 | 20 | return $this->setTextAlignment(TextAlignment::CENTER); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function textJustified(){ |
|
| 23 | + public function textJustified() { |
|
| 24 | 24 | return $this->setTextAlignment(TextAlignment::JUSTIFIED); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function textRightAligned(){ |
|
| 27 | + public function textRightAligned() { |
|
| 28 | 28 | return $this->setTextAlignment(TextAlignment::RIGHT); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - public function textLeftAligned(){ |
|
| 31 | + public function textLeftAligned() { |
|
| 32 | 32 | return $this->setTextAlignment(); |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -16,6 +16,6 @@ |
||
| 16 | 16 | if (isset($toElement)) { |
| 17 | 17 | $toElement->setAttached(true); |
| 18 | 18 | } |
| 19 | - return $this->addToPropertyCtrl("class", $side . " attached", Side::getConstantValues("attached")); |
|
| 19 | + return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached")); |
|
| 20 | 20 | } |
| 21 | 21 | } |