public function getMenuTabs($domaines)
 {
     $jquery = $this->controller->jquery;
     $translateEngine = $this->controller->getTranslateEngine();
     $tabs = new HtmlTabs("tabs");
     $tabs->setTabstype("pills");
     $tabs->fromDatabaseObjects($domaines, function ($domaine) use($translateEngine) {
         if (count($domaine->getDomaines()) > 0) {
             $libelle = $translateEngine->translate($domaine->getId(), "domaine.libelle", $domaine->getLibelle());
             $dd = new HtmlDropdown("tab-" . $domaine->getId(), $libelle);
             $dd->setTagName("button");
             $dd->setStyle("btn-primary");
             $dd->fromDatabaseObjects($domaine->getDomaines(), function ($sousDomaine) use($translateEngine) {
                 $ddItem = new HtmlDropdownItem("ddItem-" . $sousDomaine->getId());
                 $libelle = $translateEngine->translate($sousDomaine->getId(), "domaine.libelle", $sousDomaine->getLibelle());
                 $ddItem->setCaption($libelle);
                 return $ddItem;
             });
             return $dd;
         } else {
             $libelle = $translateEngine->translate($domaine->getId(), "domaine.libelle", $domaine->getLibelle());
             return new HtmlTabItem("tab-" . $domaine->getId(), $libelle);
         }
     });
     $tabs->setStacked();
     $jquery->getOnClick("ul.nav-stacked a", "index/content/", "#response");
     return $tabs;
 }
 public function addItems($items)
 {
     $iid = $this->getItemsCount() + 1;
     if (is_array($items)) {
         foreach ($items as $item) {
             if (is_string($item)) {
                 $this->addItem($item);
             } else {
                 if (is_array($item)) {
                     $dropDownItem = new HtmlDropdownItem($this->identifier . "-dropdown-item-" . $iid);
                     $dropDownItem->fromArray($item);
                     $this->items[] = $dropDownItem;
                 } else {
                     if ($item instanceof HtmlDropdownItem) {
                         $this->items[] = $item;
                     }
                 }
             }
         }
     }
     return $this;
 }
 public function menuAction($id)
 {
     $id = $this->int($id);
     $domaines = Domaine::find(array("idParent = " . $id, "order" => "ordre"));
     $tabs = new HtmlTabs("tabs");
     $tabs->setTabstype("pills");
     $tabs->fromDatabaseObjects($domaines, function ($domaine) {
         if (count($domaine->getDomaines()) > 0) {
             $dd = new HtmlDropdown("tab-" . $domaine->getId(), $domaine->getLibelle());
             $dd->setTagName("button");
             $dd->setStyle("btn-primary");
             $dd->fromDatabaseObjects($domaine->getDomaines(), function ($sousDomaine) {
                 $ddItem = new HtmlDropdownItem("ddItem-" . $sousDomaine->getId());
                 $ddItem->setCaption($sousDomaine->getLibelle());
                 return $ddItem;
             });
             return $dd;
         } else {
             return new HtmlTabItem("tab-" . $domaine->getId(), $domaine->getLibelle());
         }
     });
     $tabs->setStacked();
     echo $tabs->compile($this->jquery);
     $this->jquery->getOnClick("ul.nav-stacked a", "index/content/", "#response");
     echo $this->jquery->compile();
     $this->view->disable();
 }