示例#1
0
 public static function outline($identifier, $icon, $value = "", $placeholder = "")
 {
     $result = new HtmlInput($identifier, "text", $value, $placeholder);
     $result->addToProperty("class", "transparent");
     $result->addIcon($icon)->setOutline();
     return $result;
 }
示例#2
0
 private function createField($placeholder = NULL, $icon = NULL)
 {
     $field = new HtmlInput($this->identifier);
     if (isset($placeholder) === true) {
         $field->setPlaceholder($placeholder);
     }
     if (isset($icon) === true) {
         $field->addIcon($icon, Direction::RIGHT);
     }
     $field->getField()->setClass("prompt");
     $this->content["field"] = $field;
     return $field;
 }
 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;
 }