Esempio n. 1
0
 public function addFooter($content)
 {
     $footer = new HtmlBsDoubleElement("footer-" . $this->identifier);
     $footer->setTagName("div");
     $footer->setClass("panel-footer");
     $footer->setContent($content);
     $this->footer = $footer;
     return $this;
 }
Esempio n. 2
0
 public function createCollapsedZone($content = "", $attachTo = NULL)
 {
     if (isset($attachTo)) {
         $this->attachTo($attachTo);
     }
     $collapsedZone = new HtmlBsDoubleElement($this->getAttachedZone());
     $collapsedZone->setProperty("class", "collapse");
     $collapsedZone->setContent($content);
     return $collapsedZone;
 }
Esempio n. 3
0
 public function createSpan($text, $position = "left")
 {
     $id = $position . "-" . $this->identifier;
     $span = new HtmlBsDoubleElement($id);
     $span->setTagName("span");
     $this->setProperty("aria-describedby", $id);
     $span->setContent($text);
     $span->setClass("input-group-addon");
     if (strtolower($position) === "left") {
         $this->addonLeft = $span;
     } else {
         $this->addonRight = $span;
     }
     return $span;
 }
Esempio n. 4
0
 public function __construct($identifier, $caption, $style = "label-default")
 {
     parent::__construct($identifier, "span");
     $this->content = $caption;
     $this->setProperty("class", "label");
     $this->setStyle($style);
 }
Esempio n. 5
0
 public function compile(JsUtils $js = NULL, &$view = NULL)
 {
     foreach ($this->cols as $col) {
         $this->addContent($col);
     }
     return parent::compile($js, $view);
 }
Esempio n. 6
0
 public function __construct($identifier, $tagName = "div")
 {
     parent::__construct($identifier, $tagName);
     $this->setProperty("class", "tab-content");
     $this->content = array();
     // HtmlTabContentItem
 }
Esempio n. 7
0
 public function compile(JsUtils $js = NULL, &$view = NULL)
 {
     if ($this->closeable && $this->button === "") {
         $this->addCloseButton();
     }
     return parent::compile($js, $view);
 }
Esempio n. 8
0
 public function setIdentifier($identifier)
 {
     parent::setIdentifier($identifier);
     if ($this->content instanceof HtmlLink) {
         $this->content->setIdentifier("link-" . $identifier);
     }
 }
 public function setHeadingAndContent($title, $content = "", $niveau = "1")
 {
     if (is_array($title)) {
         $array = $title;
         $title = JArray::getValue($array, "title", 0);
         $content = JArray::getValue($array, "content", 1);
         $niveau = JArray::getValue($array, "niveau", 2);
     }
     $elementHeader = new HtmlBsDoubleElement("", "h" . $niveau);
     $elementHeader->setContent($title);
     $elementHeader->setClass("list-group-item-heading");
     $element = new HtmlBsDoubleElement("", "p");
     $element->setContent($content);
     $element->setClass("list-group-item-text");
     $this->element->setContent(array($elementHeader, $element));
     return $this->element;
 }
Esempio n. 10
0
 public function __construct($identifier, $tagName = "div")
 {
     parent::__construct($identifier, $tagName);
     $this->setClass("panel-group");
     $this->setRole("tablist");
     $this->setProperty("aria-multiselectable", "true");
     $this->content = array();
 }
Esempio n. 11
0
 private function createElement($num, $content, $disabled = false, $current = false)
 {
     $count = sizeof($this->content) + 1;
     $elem = new HtmlBsDoubleElement("li-" . $this->identifier . "-" . $count, "li");
     if ($disabled) {
         $elem->setProperty("class", "disabled");
     }
     if ($current) {
         $content .= "<span class='sr-only'>(current)</span>";
         $elem->setProperty("class", "active");
     }
     if (!$disabled) {
         $url = $this->getUrl($num);
         $href = new HtmlLink("a-" . $this->identifier . "-" . $count, $url, $content);
         $href->setProperty($this->attr, $url);
         $elem->setContent($href);
     } else {
         $elem->setContent($content);
     }
     $this->content[] = $elem;
     return $this;
 }
Esempio n. 12
0
 public function __construct($identifier, $elements = array(), $cssStyle = NULL, $size = NULL, $tagName = "div")
 {
     parent::__construct($identifier, $tagName);
     $this->_template = "<%tagName% id='%identifier%' %properties%>%elements%</%tagName%>";
     $this->setProperty("class", "btn-group");
     $this->setRole("group");
     $this->addElements($elements);
     if (isset($cssStyle)) {
         $this->setStyle($cssStyle);
     }
     if (isset($size)) {
         $this->setSize($size);
     }
 }
Esempio n. 13
0
 public function addItem($text = "")
 {
     if (is_object($text)) {
         $element = $text;
     } else {
         switch ($this->tagName) {
             case "ul":
                 $element = new HtmlBsDoubleElement("list-gi-" . $this->identifier);
                 $element->setTagName("li");
                 break;
             default:
                 $element = new HtmlLink("list-gi-" . $this->identifier);
                 break;
         }
         $element->setContent($text);
     }
     $item = new HtmlListgroupItem($element);
     if (is_array($text) === true) {
         $item->setHeadingAndContent($text);
     }
     $this->content[] = $item;
     return $item;
 }
Esempio n. 14
0
 public function compile(JsUtils $js = NULL, $view = NULL)
 {
     $this->setProperty("class", "nav nav-" . $this->_tabsType . " " . $this->stacked);
     return parent::compile($js, $view);
 }
Esempio n. 15
0
 public function addGroup($identifier = "")
 {
     if ($identifier === "") {
         $identifier = "form-" . $this->identifier;
     }
     $group = new HtmlBsDoubleElement($identifier);
     $group->setTagName("div");
     $group->setClass("form-group");
     $this->formGroups[] = $group;
     return $group;
 }
 public function compile(JsUtils $js = NULL, $view = NULL)
 {
     foreach ($this->rows as $row) {
         $this->addContent($row);
     }
     return parent::compile($js, $view);
 }
 public function __construct($identifier, $tagName = "div")
 {
     parent::__construct($identifier, $tagName);
     $this->setProperty("role", "tabpanel");
     $this->setProperty("class", "tab-pane");
 }
 public function run(JsUtils $js)
 {
     $this->element->run($js);
 }
Esempio n. 19
0
 public function __construct($identifier, $caption = "")
 {
     parent::__construct($identifier, "span");
     $this->content = $caption;
     $this->setProperty("class", "badge");
 }
Esempio n. 20
0
 public function compile(JsUtils $js = NULL, &$view = NULL)
 {
     $this->setProperty("class", $this->_generateClass());
     return parent::compile($js, $view);
 }
Esempio n. 21
0
 private function createIndicator()
 {
     $indicator = new HtmlBsDoubleElement("indicator-" . $this->identifier);
     $indicator->setProperty("data-target", "#" . $this->identifier);
     $indicator->setProperty("data-slide-to", sizeof($this->indicators));
     $indicator->setTagName("li");
     $this->indicators[] = $indicator;
 }
Esempio n. 22
0
 public function __construct($identifier, $tagName)
 {
     parent::__construct($identifier, $tagName);
     $this->root = "";
     $this->attr = "data-ajax";
 }
Esempio n. 23
0
 public function fromArray($array)
 {
     $array = parent::fromArray($array);
     foreach ($array as $key => $value) {
         $this->setProperty($key, $value);
     }
     return $array;
 }
Esempio n. 24
0
 public function setActive($index = null)
 {
     if (!isset($index)) {
         $index = sizeof($this->content) - 1;
     }
     $li = new HtmlBsDoubleElement("", "li");
     $li->setClass("active");
     $li->setContent($this->content[$index]->getContent());
     $this->content[$index] = $li;
 }
Esempio n. 25
0
 public function __construct($identifier, $href = "#", $content = "Link")
 {
     parent::__construct($identifier, "a");
     $this->setHref($href);
     $this->content = $content;
 }
Esempio n. 26
0
 public function compile(JsUtils $js = NULL, &$view = NULL)
 {
     $actualStyle = $this->style;
     if (isset($this->styleLimits) && JArray::isAssociative($this->styleLimits)) {
         foreach ($this->styleLimits as $k => $v) {
             $actualStyle = $k;
             if ($v > $this->value) {
                 break;
             }
         }
     }
     $this->style = $actualStyle;
     $this->_template = str_replace("%caption%", $this->caption, $this->_template);
     if ($this->getIsStacked() === false) {
         $this->wrap('<div class="progress">', '</div>');
     }
     return parent::compile($js, $view);
 }
Esempio n. 27
0
 /**
  * /* Initialise l'objet à partir d'un tableau associatif
  * array("identifier"=>"id","caption"=>"","class"=>"","href"=>"","role"=>"")
  * @see BaseHtml::addProperties()
  */
 public function fromArray($array)
 {
     return parent::fromArray($array);
 }
Esempio n. 28
0
 public function addLink($caption, $href = "#")
 {
     $iid = $this->getElementsCount() + 1;
     $li = new HtmlBsDoubleElement($this->identifier . "-li-" . $iid, "li");
     if ($caption instanceof HtmlLink) {
         $link = $caption;
     } else {
         $link = new HtmlLink($this->identifier . "-link-" . $iid, $href, $caption);
     }
     $li->setContent($link);
     $this->addElement($li);
 }