@@ -8,12 +8,12 @@ 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") { |
|
11 | + public function __construct($identifier, $niveau=1, $content=NULL, $type="page") { |
|
12 | 12 | parent::__construct($identifier, "div"); |
13 | 13 | $this->_template="<%tagName% %properties%>%image%%content%</%tagName%>"; |
14 | 14 | $this->setClass("ui header"); |
15 | - if(isset($type)){ |
|
16 | - if($type=="page"){ |
|
15 | + if (isset($type)) { |
|
16 | + if ($type=="page") { |
|
17 | 17 | $this->asPageHeader($niveau); |
18 | 18 | }else |
19 | 19 | $this->asContentHeader($niveau); |
@@ -21,39 +21,39 @@ discard block |
||
21 | 21 | $this->content=$content; |
22 | 22 | } |
23 | 23 | |
24 | - public function asPageHeader($niveau){ |
|
24 | + public function asPageHeader($niveau) { |
|
25 | 25 | $this->tagName="h".$niveau; |
26 | 26 | } |
27 | 27 | |
28 | - public function asContentHeader($niveau){ |
|
28 | + public function asContentHeader($niveau) { |
|
29 | 29 | $this->tagName="div"; |
30 | - if(\is_int($niveau)){ |
|
30 | + if (\is_int($niveau)) { |
|
31 | 31 | $niveau=Size::getConstantValues()[$niveau]; |
32 | 32 | } |
33 | 33 | $this->setSize($niveau); |
34 | 34 | } |
35 | 35 | |
36 | - public function asIcon($icon,$title,$subHeader=NULL){ |
|
36 | + public function asIcon($icon, $title, $subHeader=NULL) { |
|
37 | 37 | $this->addToProperty("class", "icon"); |
38 | 38 | $this->image=new HtmlIcon("icon-".$this->identifier, $icon); |
39 | - return $this->asTitle($title,$subHeader); |
|
39 | + return $this->asTitle($title, $subHeader); |
|
40 | 40 | } |
41 | 41 | |
42 | - public function asImage($src,$title,$subHeader=NULL){ |
|
43 | - $this->image=new HtmlImage("img-".$this->identifier, $src,$title); |
|
44 | - return $this->asTitle($title,$subHeader); |
|
42 | + public function asImage($src, $title, $subHeader=NULL) { |
|
43 | + $this->image=new HtmlImage("img-".$this->identifier, $src, $title); |
|
44 | + return $this->asTitle($title, $subHeader); |
|
45 | 45 | } |
46 | 46 | |
47 | - public function asTitle($title,$subHeader=NULL){ |
|
48 | - if(!\is_object($title)){ |
|
49 | - $this->content=new HtmlDoubleElement("content-".$this->identifier,"div"); |
|
47 | + public function asTitle($title, $subHeader=NULL) { |
|
48 | + if (!\is_object($title)) { |
|
49 | + $this->content=new HtmlDoubleElement("content-".$this->identifier, "div"); |
|
50 | 50 | $this->content->setContent($title); |
51 | - }else{ |
|
51 | + }else { |
|
52 | 52 | $this->content=$title; |
53 | 53 | } |
54 | 54 | $this->content->setClass("content"); |
55 | - if(isset($subHeader)){ |
|
56 | - $sub=new HtmlDoubleElement("subheader-".$this->identifier,"div"); |
|
55 | + if (isset($subHeader)) { |
|
56 | + $sub=new HtmlDoubleElement("subheader-".$this->identifier, "div"); |
|
57 | 57 | $sub->setClass("sub header"); |
58 | 58 | $sub->setContent($subHeader); |
59 | 59 | $this->content->addContent($sub); |
@@ -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"); |