Ejemplo n.º 1
0
 public function addPanel($title, $content)
 {
     $nb = sizeof($this->content) + 1;
     $panel = new HtmlPanel("panel-" . $this->identifier . "-" . $nb);
     $link = new HtmlLink("lnk-panel-" . $this->identifier . "-" . $nb);
     $link->setProperty("data-toggle", "collapse");
     $link->setProperty("data-parent", "#" . $this->identifier);
     $link->setHref("#collapse-panel-" . $this->identifier . "-" . $nb);
     $link->setContent($title);
     $panel->addHeader($link);
     $panel->setContent($content);
     $panel->setCollapsable(true);
     $this->content[] = $panel;
     return $panel;
 }
Ejemplo n.º 2
0
 public function addItem($text = "")
 {
     if (is_object($text)) {
         $element = $text;
     } else {
         switch ($this->tagName) {
             case "ul":
                 $element = new HtmlDoubleElement("list-gi-" . $this->identifier);
                 $element->setTagName("li");
                 break;
             default:
                 $element = new HtmlLink("list-gi-" . $this->identifier);
                 break;
         }
         $element->setContent($text);
     }
     $item = new HtmlListgroupItem($element);
     if (is_array($text) === true) {
         $item->setHeadingAndContent($text);
     }
     $this->content[] = $item;
     return $item;
 }
Ejemplo n.º 3
0
 public function setCollapsable($_collapsable)
 {
     $this->_collapsable = $_collapsable;
     if ($_collapsable) {
         $this->header->setRole("tab");
         $lnk = new HtmlLink("lnk-" . $this->identifier);
         $lnk->setHref("#collapse-" . $this->identifier);
         $lnk->setContent($this->header->getContent());
         $this->header->setContent($lnk);
         $this->collapseBegin = '<div id="collapse-' . $this->identifier . '" class="panel-collapse collapse" role="tabpanel" aria-labelledby="header-' . $this->identifier . '">';
         $this->collapseEnd = "</div>";
     } else {
         $this->collapseBegin = "";
         $this->collapseEnd = "";
     }
     return $this;
 }