public function getAnchorsDropDown($anchors)
 {
     $ddAnchors = new HtmlDropdown("anchors", $this->controller->getTranslateEngine()->translate(1, "index.menu", "Quick access"));
     $ddAnchors->asButton()->setColor(Color::ORANGE);
     foreach ($anchors as $titre => $vAnchors) {
         $ddAnchors->addItem(HtmlDropdownItem::header($titre));
         foreach ($vAnchors as $kAnchor => $vAnchor) {
             $item = $ddAnchors->addItem($vAnchor, $vAnchor);
             $item->setProperty("href", "#" . $kAnchor);
         }
     }
     if ($ddAnchors->count() > 8) {
         // $ddAnchors->insertItem(HtmlDropdownItem::searchInput("Search..."));
         $ddAnchors->setFullTextSearch(true);
         $ddAnchors->asSearch();
         $ddAnchors->addIcon("search", true, true);
     }
     return $ddAnchors;
 }
 public function getMainMenu()
 {
     $url = $this->controller->url;
     $translateEngine = $this->controller->getTranslateEngine();
     $jquery = $this->controller->jquery;
     $menu = $jquery->semantic()->htmlMenu("navbarJS");
     $menu->addItem($translateEngine->translate(1, "index.home", "home"));
     $domaines = \Domaine::find("isNull(idParent)");
     $menu->fromDatabaseObjects($domaines, function ($domaine) use($url, $translateEngine) {
         $libelle = $translateEngine->translate($domaine->getId(), "domaine.libelle", $domaine->getLibelle());
         $item = new HtmlSemDoubleElement("menu-" . $libelle, "a", "item");
         $item->setContent($libelle);
         if (!$domaine->getSemantic()) {
             $item->setProperty("href", $url->get("Index/bootstrap/" . $domaine->getId()));
         } else {
             $item->getOnClick("Index/content/main/" . $domaine->getId(), "#response");
         }
         return $item;
     });
     $menu->getItem(0)->addToProperty("class", "navbar-brand")->setProperty("href", $url->get("index"));
     $menu->setInverted()->setSize(Size::LARGE);
     $input = new HtmlInput("search", "search", "", $translateEngine->translate(1, "index.search", "Search..."));
     $input->addIcon("search", Direction::RIGHT)->asLink();
     $jquery->postOnClick("#div-search i", "Index/search", '{"text":$("#search").val()}', "#response");
     $ddLang = new \Ajax\semantic\html\modules\HtmlDropdown("idLang");
     foreach (TranslateEngine::$languages as $keyLang => $valueLang) {
         $item = $ddLang->addItem($valueLang, $url->get("Index/index/" . $keyLang));
         $item->setProperty("href", $url->get("Index/index/" . $keyLang));
         // $item->getOnClick("Index/index/".$keyLang,"body");
         if (JString::startsWith($translateEngine->getLanguage(), $keyLang, true)) {
             $ddLang->setValue($valueLang . " : " . $keyLang);
         }
     }
     $ddLang->asButton();
     $menu2 = $jquery->semantic()->htmlMenu("menu2", array($input, $ddLang));
     $menu2->setPosition("right");
     $menu2->setInverted();
     $menu->addItem($menu2);
     return $menu;
 }