@@ -15,8 +15,9 @@ discard block |
||
| 15 | 15 | if(isset($type)){ |
| 16 | 16 | if($type=="page"){ |
| 17 | 17 | $this->asPageHeader($niveau); |
| 18 | - }else |
|
| 19 | - $this->asContentHeader($niveau); |
|
| 18 | + } else { |
|
| 19 | + $this->asContentHeader($niveau); |
|
| 20 | + } |
|
| 20 | 21 | } |
| 21 | 22 | $this->content=$content; |
| 22 | 23 | } |
@@ -48,7 +49,7 @@ discard block |
||
| 48 | 49 | if(!\is_object($title)){ |
| 49 | 50 | $this->content=new HtmlDoubleElement("content-".$this->identifier,"div"); |
| 50 | 51 | $this->content->setContent($title); |
| 51 | - }else{ |
|
| 52 | + } else{ |
|
| 52 | 53 | $this->content=$title; |
| 53 | 54 | } |
| 54 | 55 | $this->content->setClass("content"); |
@@ -8,11 +8,11 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | class HtmlHeader extends HtmlSemDoubleElement { |
| 10 | 10 | protected $image; |
| 11 | - public function __construct($identifier, $niveau=1,$content=NULL,$type="page") { |
|
| 12 | - parent::__construct($identifier, "div","ui header"); |
|
| 11 | + public function __construct($identifier, $niveau=1, $content=NULL, $type="page") { |
|
| 12 | + parent::__construct($identifier, "div", "ui header"); |
|
| 13 | 13 | $this->_template="<%tagName% %properties%>%image%%content%</%tagName%>"; |
| 14 | - if(isset($type)){ |
|
| 15 | - if($type=="page"){ |
|
| 14 | + if (isset($type)) { |
|
| 15 | + if ($type=="page") { |
|
| 16 | 16 | $this->asPageHeader($niveau); |
| 17 | 17 | }else |
| 18 | 18 | $this->asContentHeader($niveau); |
@@ -20,39 +20,39 @@ discard block |
||
| 20 | 20 | $this->content=$content; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function asPageHeader($niveau){ |
|
| 23 | + public function asPageHeader($niveau) { |
|
| 24 | 24 | $this->tagName="h".$niveau; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function asContentHeader($niveau){ |
|
| 27 | + public function asContentHeader($niveau) { |
|
| 28 | 28 | $this->tagName="div"; |
| 29 | - if(\is_int($niveau)){ |
|
| 29 | + if (\is_int($niveau)) { |
|
| 30 | 30 | $niveau=Size::getConstantValues()[$niveau]; |
| 31 | 31 | } |
| 32 | 32 | $this->setSize($niveau); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public function asIcon($icon,$title,$subHeader=NULL){ |
|
| 35 | + public function asIcon($icon, $title, $subHeader=NULL) { |
|
| 36 | 36 | $this->addToProperty("class", "icon"); |
| 37 | 37 | $this->image=new HtmlIcon("icon-".$this->identifier, $icon); |
| 38 | - return $this->asTitle($title,$subHeader); |
|
| 38 | + return $this->asTitle($title, $subHeader); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function asImage($src,$title,$subHeader=NULL){ |
|
| 42 | - $this->image=new HtmlImage("img-".$this->identifier, $src,$title); |
|
| 43 | - return $this->asTitle($title,$subHeader); |
|
| 41 | + public function asImage($src, $title, $subHeader=NULL) { |
|
| 42 | + $this->image=new HtmlImage("img-".$this->identifier, $src, $title); |
|
| 43 | + return $this->asTitle($title, $subHeader); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - public function asTitle($title,$subHeader=NULL){ |
|
| 47 | - if(!\is_object($title)){ |
|
| 48 | - $this->content=new HtmlDoubleElement("content-".$this->identifier,"div"); |
|
| 46 | + public function asTitle($title, $subHeader=NULL) { |
|
| 47 | + if (!\is_object($title)) { |
|
| 48 | + $this->content=new HtmlDoubleElement("content-".$this->identifier, "div"); |
|
| 49 | 49 | $this->content->setContent($title); |
| 50 | - }else{ |
|
| 50 | + }else { |
|
| 51 | 51 | $this->content=$title; |
| 52 | 52 | } |
| 53 | 53 | $this->content->setClass("content"); |
| 54 | - if(isset($subHeader)){ |
|
| 55 | - $sub=new HtmlDoubleElement("subheader-".$this->identifier,"div"); |
|
| 54 | + if (isset($subHeader)) { |
|
| 55 | + $sub=new HtmlDoubleElement("subheader-".$this->identifier, "div"); |
|
| 56 | 56 | $sub->setClass("sub header"); |
| 57 | 57 | $sub->setContent($subHeader); |
| 58 | 58 | $this->content->addContent($sub); |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | use Ajax\semantic\html\base\constants\Side; |
| 5 | 5 | trait AttachedTrait { |
| 6 | 6 | /** |
| 7 | - * @param string $side |
|
| 8 | 7 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
| 9 | 8 | */ |
| 10 | 9 | public function setAttachment($value=Side::BOTH){ |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | * @param string $side |
| 8 | 8 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
| 9 | 9 | */ |
| 10 | - public function setAttachment($value=Side::BOTH){ |
|
| 11 | - return $this->addToPropertyCtrl("class",$value." attached",Side::getConstantValues("attached")); |
|
| 10 | + public function setAttachment($value=Side::BOTH) { |
|
| 11 | + return $this->addToPropertyCtrl("class", $value." attached", Side::getConstantValues("attached")); |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | \ No newline at end of file |
@@ -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%"; |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | class HtmlDivider extends HtmlDoubleElement { |
| 13 | 13 | |
| 14 | - public function __construct($identifier, $content="",$tagName="div") { |
|
| 15 | - parent::__construct($identifier, $tagName,"ui divider"); |
|
| 14 | + public function __construct($identifier, $content="", $tagName="div") { |
|
| 15 | + parent::__construct($identifier, $tagName, "ui divider"); |
|
| 16 | 16 | $this->content=$content; |
| 17 | 17 | } |
| 18 | 18 | |
@@ -20,23 +20,23 @@ discard block |
||
| 20 | 20 | * vertical divider |
| 21 | 21 | * @return \Ajax\semantic\html\elements\HtmlDivider |
| 22 | 22 | */ |
| 23 | - public function setVertical(){ |
|
| 24 | - return $this->addToPropertyUnique("class", "vertical", array("vertical","horizontal")); |
|
| 23 | + public function setVertical() { |
|
| 24 | + return $this->addToPropertyUnique("class", "vertical", array("vertical", "horizontal")); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * horizontal divider |
| 29 | 29 | * @return \Ajax\semantic\html\elements\HtmlDivider |
| 30 | 30 | */ |
| 31 | - public function setHorizontal(){ |
|
| 32 | - return $this->addToPropertyUnique("class", "horizontal", array("vertical","horizontal")); |
|
| 31 | + public function setHorizontal() { |
|
| 32 | + return $this->addToPropertyUnique("class", "horizontal", array("vertical", "horizontal")); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * hide the divider |
| 37 | 37 | * @return \Ajax\semantic\html\elements\HtmlDivider |
| 38 | 38 | */ |
| 39 | - public function setHidden(){ |
|
| 39 | + public function setHidden() { |
|
| 40 | 40 | return $this->addToProperty("class", "hidden"); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -44,14 +44,14 @@ discard block |
||
| 44 | 44 | * fitted, without any space above or below it |
| 45 | 45 | * @return \Ajax\semantic\html\elements\HtmlDivider |
| 46 | 46 | */ |
| 47 | - public function setFitted(){ |
|
| 47 | + public function setFitted() { |
|
| 48 | 48 | return $this->addToProperty("class", "fitted"); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * @return \Ajax\semantic\html\elements\HtmlDivider |
| 53 | 53 | */ |
| 54 | - public function asHeader(){ |
|
| 54 | + public function asHeader() { |
|
| 55 | 55 | return $this->addToProperty("class", "header"); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * inverts the divider colors |
| 60 | 60 | * @return \Ajax\semantic\html\elements\HtmlDivider |
| 61 | 61 | */ |
| 62 | - public function setInverted(){ |
|
| 62 | + public function setInverted() { |
|
| 63 | 63 | return $this->addToProperty("class", "inverted"); |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | \ No newline at end of file |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | public static function getConstants() { |
| 15 | 15 | if (self::$constCacheArray==NULL) { |
| 16 | - self::$constCacheArray=[ ]; |
|
| 16 | + self::$constCacheArray=[]; |
|
| 17 | 17 | } |
| 18 | 18 | $calledClass=get_called_class(); |
| 19 | 19 | if (!array_key_exists($calledClass, self::$constCacheArray)) { |
@@ -23,11 +23,11 @@ discard block |
||
| 23 | 23 | return self::$constCacheArray [$calledClass]; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - public static function getConstantValues($postFix=""){ |
|
| 27 | - if($postFix!=="") |
|
| 26 | + public static function getConstantValues($postFix="") { |
|
| 27 | + if ($postFix!=="") |
|
| 28 | 28 | return \array_values(self::getConstants()); |
| 29 | - else{ |
|
| 30 | - return \array_map(function ($elem) use ($postFix) {return $elem." ".$postFix;},\array_values(self::getConstants())); |
|
| 29 | + else { |
|
| 30 | + return \array_map(function($elem) use ($postFix) {return $elem." ".$postFix; },\array_values(self::getConstants())); |
|
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
@@ -24,9 +24,9 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public static function getConstantValues($postFix=""){ |
| 27 | - if($postFix!=="") |
|
| 28 | - return \array_values(self::getConstants()); |
|
| 29 | - else{ |
|
| 27 | + if($postFix!=="") { |
|
| 28 | + return \array_values(self::getConstants()); |
|
| 29 | + } else{ |
|
| 30 | 30 | return \array_map(function ($elem) use ($postFix) {return $elem." ".$postFix;},\array_values(self::getConstants())); |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -9,10 +9,10 @@ |
||
| 9 | 9 | * @author jc |
| 10 | 10 | * @version 1.001 |
| 11 | 11 | */ |
| 12 | -abstract class HtmlSemCollection extends HtmlCollection{ |
|
| 12 | +abstract class HtmlSemCollection extends HtmlCollection { |
|
| 13 | 13 | use BaseTrait; |
| 14 | - public function __construct( $identifier, $tagName="div",$baseClass="ui"){ |
|
| 15 | - parent::__construct( $identifier, $tagName="div"); |
|
| 14 | + public function __construct($identifier, $tagName="div", $baseClass="ui") { |
|
| 15 | + parent::__construct($identifier, $tagName="div"); |
|
| 16 | 16 | $this->_baseClass=$baseClass; |
| 17 | 17 | $this->setClass($baseClass); |
| 18 | 18 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | class HtmlSemSingleElement extends HtmlSingleElement { |
| 15 | 15 | use BaseTrait; |
| 16 | - public function __construct($identifier, $tagName="br",$baseClass="ui") { |
|
| 16 | + public function __construct($identifier, $tagName="br", $baseClass="ui") { |
|
| 17 | 17 | parent::__construct($identifier, $tagName); |
| 18 | 18 | $this->_baseClass=$baseClass; |
| 19 | 19 | $this->setClass($baseClass); |
@@ -5,5 +5,5 @@ |
||
| 5 | 5 | use Ajax\common\BaseEnum; |
| 6 | 6 | |
| 7 | 7 | class TextAlignment extends BaseEnum { |
| 8 | - const LEFT="left aligned",CENTER="center aligned",RIGHT="right aligned",JUSTIFIED="justified"; |
|
| 8 | + const LEFT="left aligned", CENTER="center aligned", RIGHT="right aligned", JUSTIFIED="justified"; |
|
| 9 | 9 | } |
| 10 | 10 | \ No newline at end of file |
@@ -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",NONE=""; |
|
| 5 | + const RIGHT="right", LEFT="left", NONE=""; |
|
| 6 | 6 | } |
| 7 | 7 | \ No newline at end of file |
@@ -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 |