public function indexAction($lang = NULL) { $this->view->setMainView("index2"); if (isset($lang)) { $this->translateEngine->setLanguage($lang, $this->session); } $expr = array(); $expr[] = $this->translateEngine->translate(1, "index.header", "jQuery, jQuery UI and Twitter Bootstrap library for phalcon MVC Framework"); $expr[] = $this->translateEngine->translate(2, "index.header", "Phalcon-jQuery is a Phalcon® library for generating scripts or rich components (Bootstrap, jQueryUI) on server side."); $expr[] = $this->translateEngine->translate(1, "index.download", "Download"); $expr[] = $this->translateEngine->translate(1, "index.install", "<p>Or</p><p class='lead'>Install with Composer</p><p>Create the file composer.json</p>"); $expr[] = $this->translateEngine->translate(2, "index.install", "Enter in the console"); $this->view->setVars(array("expr" => $expr, "lang" => $this->translateEngine->getLanguage())); $menu = $this->jquery->semantic()->htmlMenu("navbarJS"); $menu->addItem("home"); $domaines = Domaine::find("isNull(idParent)"); $menu->fromDatabaseObjects($domaines, function ($domaine) { $libelle = $this->translateEngine->translate($domaine->getId(), "domaine.libelle", $domaine->getLibelle()); $item = new HtmlSemDoubleElement("menu-" . $libelle, "a", "item"); $item->setContent($libelle); $item->setProperty("href", $this->url->get("Index/bootstrap/" . $domaine->getId())); //$item->getOnClick("Index/content/main/".$domaine->getId(),"#response"); return $item; }); $menu->getItem(0)->setTagName("div")->addToProperty("class", "navbar-brand"); $menu->setInverted(); $this->jquery->compile($this->view); }
protected function createTitleElement() { $element = new HtmlSemDoubleElement("title-" . $this->identifier, "div", "title"); $element->setContent(array(new HtmlIcon("", $this->_icon), $this->_title)); if ($this->_active === true) { $element->addToProperty("class", "active"); } return $element; }
public function addHeader($header) { $headerO = $header; if (\is_string($header)) { $headerO = new HtmlSemDoubleElement("header-" . $this->identifier, "div"); $headerO->setClass("header"); $headerO->setContent($header); } return $this->addContent($headerO, true); }
public function setLabel($label) { $labelO = $label; if (\is_string($label)) { $labelO = new HtmlSemDoubleElement("", "label", ""); $labelO->setContent($label); $labelO->setProperty("for", \str_replace("field-", "", $this->identifier)); } $this->content["label"] = $labelO; }
public function setLabel($label) { $labelO = $label; if (\is_string($label)) { $labelO = new HtmlSemDoubleElement("", "label", ""); $labelO->setContent($label); $labelO->setProperty("for", $this->getField()->getIdentifier()); } $this->content["label"] = $labelO; }
public function setContent($content) { if ($content === "-") { $this->asDivider(); } elseif ($content === "-search-") { $values = \explode(",", $content, -1); $this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."), JArray::getDefaultValue($values, 1, "search")); } else { parent::setContent($content); } return $this; }
public function setAnimated($content, $animation = "") { $this->setTagName("div"); $this->addToProperty("class", "animated " . $animation); $visible = new HtmlSemDoubleElement("visible-" . $this->identifier, "div"); $visible->setClass("visible content"); $visible->setContent($this->content); $hidden = new HtmlSemDoubleElement("hidden-" . $this->identifier, "div"); $hidden->setClass("hidden content"); $hidden->setContent($content); $this->content = array($visible, $hidden); return $hidden; }
public function __construct($identifier, $value = "", $items = array()) { parent::__construct($identifier, "div"); $this->_template = (include dirname(__FILE__) . '/../templates/tplDropdown.php'); $this->setProperty("class", "ui dropdown"); $content = new HtmlSemDoubleElement("text-" . $this->identifier, "div"); $content->setClass("text"); $content->setContent($value); $content->wrap("", new HtmlIcon("", "dropdown")); $this->content = array($content); $this->tagName = "div"; $this->addItems($items); }
public function generateMenuAsItem($menu, $header = null) { $count = $this->count(); $item = new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "div"); if (isset($header)) { $headerItem = new HtmlSemDoubleElement("item-header-" . $this->identifier . "-" . $count, "div", "header"); $headerItem->setContent($header); $item->addContent($headerItem); $this->_itemHeader = $headerItem; } $menu->setClass("menu"); $item->addContent($menu); return $item; }
/** * * {@inheritDoc} * * @see \Ajax\common\html\HtmlCollection::createItem() */ protected function createItem($value) { $count = $this->count(); $itemO = new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "a", "section"); if (\is_array($value)) { $itemO->fromArray($value); } else { $itemO->setContent($value); $itemO->setProperty($this->attr, $this->getHref($count)); } return $itemO; }
public function getBreadcrumbs($domaines) { $jquery = $this->controller->jquery; $bc = $jquery->semantic()->htmlBreadcrumb("bc", array(array("content" => "Index", "href" => $this->controller->url->get("index"))), true, 0, function ($e) { return $e->getProperty("data-ajax"); }); $bc->setContentDivider("<i class='right angle icon divider'></i>"); $bc->addIconAt("home", 0); $bc->fromDatabaseObjects($domaines, function ($domaine) { $lnk = new HtmlSemDoubleElement("bc-" . $domaine->getLibelle(), "a", "section"); $lnk->setContent($domaine->getLibelle()); $lnk->setProperty("data-ajax", "Index/content/" . $domaine->getId()); return $lnk; }); $bc->autoGetOnClick("#response"); $bc->wrap("<div class='semantic-bread'>", "</div>"); return $bc; }
/** * * @param string $detail * @return \Ajax\common\html\HtmlDoubleElement */ public function addDetail($detail) { $div = new HtmlSemDoubleElement("detail-" . $this->identifier, $this->tagName, "detail"); $div->setContent($detail); $this->addContent($div); return $div; }