コード例 #1
0
 /**
  *
  * @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"));
 }
コード例 #2
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);
 }
コード例 #3
0
 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;
 }
コード例 #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 __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);
 }
コード例 #7
0
ファイル: HtmlReveal.php プロジェクト: jcheron/phalcon-jquery
 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;
 }
コード例 #8
0
ファイル: HtmlDimmer.php プロジェクト: jcheron/phalcon-jquery
 public function run(JsUtils $js)
 {
     if ($this->_container instanceof HtmlSingleElement) {
         $this->_bsComponent = $js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params);
     }
     return parent::run($js);
 }
コード例 #9
0
ファイル: HtmlInput.php プロジェクト: jcheron/phalcon-jquery
 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];
 }
コード例 #10
0
 /**
  *
  * {@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);
 }
コード例 #11
0
 /**
  * {@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')");
     }
 }
コード例 #12
0
ファイル: HtmlSearch.php プロジェクト: jcheron/phalcon-jquery
 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";
 }
コード例 #13
0
 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;
 }
コード例 #14
0
ファイル: HtmlPopup.php プロジェクト: jcheron/phalcon-jquery
 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");
 }
コード例 #15
0
 public function __construct($identifier, $width = NULL)
 {
     parent::__construct($identifier, "div");
     $this->setClass("column");
     if (isset($width)) {
         $this->setWidth($width);
     }
 }
コード例 #16
0
 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;
 }
コード例 #17
0
ファイル: HtmlImage.php プロジェクト: jcheron/phalcon-jquery
 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);
     }
 }
コード例 #18
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;
 }
コード例 #19
0
ファイル: HtmlHeader.php プロジェクト: jcheron/phalcon-jquery
 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;
 }
コード例 #20
0
ファイル: HtmlLoader.php プロジェクト: jcheron/phalcon-jquery
 public function __construct($identifier, $content = NULL)
 {
     parent::__construct($identifier, "div", "ui loader", $content);
 }
コード例 #21
0
 public function __construct($identifier, $content = "", $tagName = "div")
 {
     parent::__construct($identifier, $tagName, "ui divider");
     $this->content = $content;
 }
コード例 #22
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;
 }
コード例 #23
0
 /**
  *
  * {@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);
 }
コード例 #24
0
ファイル: HtmlMenu.php プロジェクト: jcheron/phalcon-jquery
 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;
 }
コード例 #25
0
 public function compile(JsUtils $js = NULL, $view = NULL)
 {
     $this->titleElement = $this->createTitleElement();
     return parent::compile($js, $view);
 }
コード例 #26
0
ファイル: HtmlTable.php プロジェクト: jcheron/phalcon-jquery
 /**
  *
  * {@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);
 }
コード例 #27
0
ファイル: HtmlSticky.php プロジェクト: jcheron/phalcon-jquery
 /**
  * {@inheritDoc}
  * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
  */
 public function run(JsUtils $js)
 {
     parent::run($js);
     return $js->semantic()->sticky("#" . $this->identifier, $this->_params);
 }
コード例 #28
0
ファイル: HtmlButton.php プロジェクト: jcheron/phalcon-jquery
 public function fromArray($array)
 {
     $array = parent::fromArray($array);
     foreach ($array as $key => $value) {
         $this->setProperty($key, $value);
     }
     return $array;
 }
コード例 #29
0
 /**
  *
  * {@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);
 }
コード例 #30
0
ファイル: HtmlIcon.php プロジェクト: jcheron/phalcon-jquery
 public function __construct($identifier, $icon)
 {
     parent::__construct($identifier, "i", "icon", NULL);
     $this->setIcon($icon);
 }