コード例 #1
0
 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);
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 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;
 }
コード例 #7
0
ファイル: HtmlButton.php プロジェクト: jcheron/phalcon-jquery
 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;
 }
コード例 #8
0
 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);
 }
コード例 #9
0
ファイル: HtmlMenu.php プロジェクト: jcheron/phalcon-jquery
 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;
 }
コード例 #10
0
 /**
  *
  * {@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;
 }
コード例 #11
0
 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;
 }
コード例 #12
0
ファイル: HtmlLabel.php プロジェクト: jcheron/phalcon-jquery
 /**
  *
  * @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;
 }