| @@ 106-117 (lines=12) @@ | ||
| 103 | * @param string $icon |
|
| 104 | * @return \Ajax\semantic\html\elements\HtmlLabel |
|
| 105 | */ |
|
| 106 | public function addLabel($label, $before=false, $icon=NULL) { |
|
| 107 | $this->tagName="div"; |
|
| 108 | $this->addToProperty("class", "labeled"); |
|
| 109 | $this->content=new HtmlButton("button-" . $this->identifier, $this->content); |
|
| 110 | $this->content->setTagName("div"); |
|
| 111 | $label=new HtmlLabel("label-" . $this->identifier, $label, "a"); |
|
| 112 | if(isset($icon)) |
|
| 113 | $label->addIcon($icon); |
|
| 114 | $label->setBasic(); |
|
| 115 | $this->addContent($label, $before); |
|
| 116 | return $label; |
|
| 117 | } |
|
| 118 | ||
| 119 | /* |
|
| 120 | * (non-PHPdoc) |
|
| @@ 51-66 (lines=16) @@ | ||
| 48 | return $this->asTitle($title, $subHeader); |
|
| 49 | } |
|
| 50 | ||
| 51 | public function asTitle($title, $subHeader=NULL) { |
|
| 52 | if (!\is_object($title)) { |
|
| 53 | $this->content=new HtmlDoubleElement("content-" . $this->identifier, "div"); |
|
| 54 | $this->content->setContent($title); |
|
| 55 | } else { |
|
| 56 | $this->content=$title; |
|
| 57 | } |
|
| 58 | $this->content->setClass("content"); |
|
| 59 | if (isset($subHeader)) { |
|
| 60 | $sub=new HtmlDoubleElement("subheader-" . $this->identifier, "div"); |
|
| 61 | $sub->setClass("sub header"); |
|
| 62 | $sub->setContent($subHeader); |
|
| 63 | $this->content->addContent($sub); |
|
| 64 | } |
|
| 65 | return $this; |
|
| 66 | } |
|
| 67 | ||
| 68 | public function getImage() { |
|
| 69 | return $this->image; |
|