/** * * @param string $side * @return \Ajax\semantic\html\base\HtmlSemDoubleElement */ public function setAttachment(HtmlSemDoubleElement $toElement, $value = Side::BOTH) { if (isset($toElement)) { $toElement->addToPropertyCtrl("class", "attached", array("attached")); } return $this->addToPropertyCtrl("class", $value . " attached", Side::getConstantValues("attached")); }
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); }
public function insertOr($aferIndex = 0, $or = "or") { $orElement = new HtmlSemDoubleElement("or-" . $this->identifier, "div", "or"); $orElement->setProperty("data-text", $or); array_splice($this->content, $aferIndex + 1, 0, array($orElement)); return $this; }
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 __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); }
private function setElement($index, $content) { if (!$content instanceof HtmlSingleElement) { $content = new HtmlLabel("", $content); } if ($content instanceof HtmlSemDoubleElement) { $content = new HtmlSemDoubleElement($this->identifier . "-" . $index, "div", "", $content); } elseif ($content instanceof HtmlImg) { $this->addToPropertyCtrl("class", "image", array("image")); } $content->addToProperty("class", ($index === 0 ? "visible" : "hidden") . " content"); $this->content[$index] = $content; return $this; }
public function run(JsUtils $js) { if ($this->_container instanceof HtmlSingleElement) { $this->_bsComponent = $js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); } return parent::run($js); }
public function __construct($identifier, $type = "text", $value = "", $placeholder = "") { parent::__construct("div-" . $identifier, "div", "ui input"); $this->content = ["field" => new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder)]; $this->_states = [State::DISABLED, State::FOCUS, State::ERROR]; $this->_variations = [Variation::TRANSPARENT]; }
/** * * {@inheritDoc} * * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() */ public function compile(JsUtils $js = NULL, &$view = NULL) { if (\is_array($this->content)) { $this->content = JArray::sortAssociative($this->content, ["icon", "image", "content"]); } return parent::compile($js, $view); }
/** * {@inheritDoc} * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() */ public function run(JsUtils $js) { parent::run($js); if (isset($this->close)) { $js->execOn("click", "#" . $this->identifier . " .close", "\$(this).closest('.message').transition('fade')"); } }
public function __construct($identifier, $placeholder = NULL, $icon = NULL) { parent::__construct("search-" . $identifier, "div", "ui search", array()); $this->createField($placeholder, $icon); $this->createResult(); $this->_params["type"] = "standard"; }
public function __construct($identifier, $content = "") { parent::__construct($identifier, "div", "ui segment"); $this->_variations = \array_merge($this->_variations, [Variation::PADDED, Variation::COMPACT]); $this->_states = \array_merge($this->_states, [State::LOADING]); $this->content = $content; }
public function __construct(BaseHtml $container, $identifier, $content = "") { parent::__construct($identifier, "div"); $this->_container = $container; $this->setClass("ui popup"); $this->content = $content; $this->_params = array("on" => "hover"); }
public function __construct($identifier, $width = NULL) { parent::__construct($identifier, "div"); $this->setClass("column"); if (isset($width)) { $this->setWidth($width); } }
public function addContentIcon($icon, $caption = NULL, $direction = Direction::LEFT) { if ($direction === Direction::RIGHT) { if (isset($caption)) { $result = new HtmlSemDoubleElement("", "span", "", $caption); $result->addIcon($icon); $this->addContent($result); } else { $result = new HtmlIcon("", $icon); $this->addContent($result); } $result->setFloated($direction); } else { $this->addIcon($icon); $result = $this->addContent($caption); } return $result; }
public function __construct($identifier, $src = "", $alt = "", $size = NULL) { $image = new HtmlImg("img-", $src, $alt); $image->setClass(""); parent::__construct($identifier, "div", "ui image", $image); if (isset($size)) { $this->setSize($size); } }
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 __construct($identifier, $niveau = 1, $content = NULL, $type = "page") { parent::__construct($identifier, "div", "ui header"); $this->_template = "<%tagName% %properties%>%image%%content%</%tagName%>"; if (isset($type)) { if ($type == "page") { $this->asPageHeader($niveau); } else { $this->asContentHeader($niveau); } } $this->content = $content; }
public function __construct($identifier, $content = NULL) { parent::__construct($identifier, "div", "ui loader", $content); }
public function __construct($identifier, $content = "", $tagName = "div") { parent::__construct($identifier, $tagName, "ui divider"); $this->content = $content; }
/** * * {@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; }
/** * * {@inheritDoc} * * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() */ public function compile(JsUtils $js = NULL, &$view = NULL) { $this->content = JArray::sortAssociative($this->content, ["bar", "label"]); return parent::compile($js, $view); }
public function addPopupAsItem($value, $identifier, $content = "") { $value = new HtmlSemDoubleElement($identifier, "a", "browse item", $value); $value->addContent(new HtmlIcon("", "dropdown")); $value = $this->addItem($value); $popup = new HtmlPopup($value, "popup-" . $this->identifier . "-" . $this->count(), $content); $popup->setFlowing()->setPosition("bottom left")->setOn("click"); $this->wrap("", $popup); return $popup; }
public function compile(JsUtils $js = NULL, $view = NULL) { $this->titleElement = $this->createTitleElement(); return parent::compile($js, $view); }
/** * * {@inheritDoc} * * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() */ public function compile(JsUtils $js = NULL, &$view = NULL) { $this->content = JArray::sortAssociative($this->content, ["thead", "tbody", "tfoot"]); if ($this->propertyContains("class", "sortable")) { $this->addEvent("execute", "\$('#" . $this->identifier . "').tablesort();"); } return parent::compile($js, $view); }
/** * {@inheritDoc} * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() */ public function run(JsUtils $js) { parent::run($js); return $js->semantic()->sticky("#" . $this->identifier, $this->_params); }
public function fromArray($array) { $array = parent::fromArray($array); foreach ($array as $key => $value) { $this->setProperty($key, $value); } return $array; }
/** * * {@inheritDoc} * * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() */ public function compile(JsUtils $js = NULL, $view = NULL) { $this->content = JArray::sortAssociative($this->content, ["header", "image", "content", "extra-content"]); return parent::compile($js, $view); }
public function __construct($identifier, $icon) { parent::__construct($identifier, "i", "icon", NULL); $this->setIcon($icon); }