public function addFooter($content)
 {
     $footer = new HtmlDoubleElement("footer-" . $this->identifier);
     $footer->setTagName("div");
     $footer->setClass("panel-footer");
     $footer->setContent($content);
     $this->footer = $footer;
     return $this;
 }
 public function setActive($index = null)
 {
     if (!isset($index)) {
         $index = sizeof($this->content) - 1;
     }
     $li = new HtmlDoubleElement("", "li");
     $li->setClass("active");
     $li->setContent($this->content[$index]->getContent());
     $this->content[$index] = $li;
 }
 public function createCollapsedZone($content = "", $attachTo = NULL)
 {
     if (isset($attachTo)) {
         $this->attachTo($attachTo);
     }
     $collapsedZone = new HtmlDoubleElement($this->getAttachedZone());
     $collapsedZone->setProperty("class", "collapse");
     $collapsedZone->setContent($content);
     return $collapsedZone;
 }
 public function createSpan($text, $position = "left")
 {
     $id = $position . "-" . $this->identifier;
     $span = new HtmlDoubleElement($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;
 }
 public function compile(JsUtils $js = NULL, View $view = NULL)
 {
     foreach ($this->cols as $col) {
         $this->addContent($col);
     }
     return parent::compile($js, $view);
 }
 public function __construct($identifier, $tagName = "div")
 {
     parent::__construct($identifier, $tagName);
     $this->setProperty("class", "tab-content");
     $this->content = array();
     // HtmlTabContentItem
 }
 public function __construct($identifier, $caption, $style = "label-default")
 {
     parent::__construct($identifier, "span");
     $this->content = $caption;
     $this->setProperty("class", "label");
     $this->setStyle($style);
 }
 public function run(JsUtils $js)
 {
     parent::run($js);
     $this->_bsComponent = $js->bootstrap()->generic("#" . $this->identifier);
     $this->addEventsOnRun($js);
     return $this->_bsComponent;
 }
 public function setIdentifier($identifier)
 {
     parent::setIdentifier($identifier);
     if ($this->content instanceof HtmlLink) {
         $this->content->setIdentifier("link-" . $identifier);
     }
 }
 public function compile(JsUtils $js = NULL, View $view = NULL)
 {
     if ($this->closeable && $this->button === "") {
         $this->addCloseButton();
     }
     return parent::compile($js, $view);
 }
 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();
 }
 public function __construct($identifier, $caption, $value = "")
 {
     parent::__construct($identifier, "option");
     $this->_template = '<option id="%identifier%" value="%value%" %selected% %properties%>%content%</option>';
     $this->content = $caption;
     $this->value = $value;
     $this->selected = "";
 }
 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 HtmlDoubleElement("", "h" . $niveau);
     $elementHeader->setContent($title);
     $elementHeader->setClass("list-group-item-heading");
     $element = new HtmlDoubleElement("", "p");
     $element->setContent($content);
     $element->setClass("list-group-item-text");
     $this->element->setContent(array($elementHeader, $element));
     return $this->element;
 }
 private function createElement($num, $content, $disabled = false, $current = false)
 {
     $count = sizeof($this->content) + 1;
     $elem = new HtmlDoubleElement("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;
 }
 public function addItem($text = "")
 {
     if (is_object($text)) {
         $element = $text;
     } else {
         switch ($this->tagName) {
             case "ul":
                 $element = new HtmlDoubleElement("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;
 }
 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);
     }
 }
 private function createIndicator()
 {
     $indicator = new HtmlDoubleElement("indicator-" . $this->identifier);
     $indicator->setProperty("data-target", "#" . $this->identifier);
     $indicator->setProperty("data-slide-to", sizeof($this->indicators));
     $indicator->setTagName("li");
     $this->indicators[] = $indicator;
 }
 public function compile(JsUtils $js = NULL, View $view = NULL)
 {
     $this->setProperty("class", "nav nav-" . $this->_tabsType . " " . $this->stacked);
     return parent::compile($js, $view);
 }
Beispiel #19
0
 public function addLink($caption, $href = "#")
 {
     $iid = $this->getElementsCount() + 1;
     $li = new HtmlDoubleElement($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);
 }
 public function __construct($identifier, $href = "#", $content = "Link")
 {
     parent::__construct($identifier, "a");
     $this->setHref($href);
     $this->content = $content;
 }
 public function compile(JsUtils $js = NULL, View $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);
 }
 public function addGroup($identifier = "")
 {
     if ($identifier === "") {
         $identifier = "form-" . $this->identifier;
     }
     $group = new HtmlDoubleElement($identifier);
     $group->setTagName("div");
     $group->setClass("form-group");
     $this->formGroups[] = $group;
     return $group;
 }
 /**
  * /* 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);
 }
 public function fromArray($array)
 {
     $array = parent::fromArray($array);
     foreach ($array as $key => $value) {
         $this->setProperty($key, $value);
     }
     return $array;
 }
 public function compile(JsUtils $js = NULL, View $view = NULL)
 {
     $this->setProperty("class", $this->_generateClass());
     return parent::compile($js, $view);
 }
 public function __construct($identifier, $caption = "")
 {
     parent::__construct($identifier, "span");
     $this->content = $caption;
     $this->setProperty("class", "badge");
 }
 public function __construct($identifier, $tagName)
 {
     parent::__construct($identifier, $tagName);
     $this->root = "";
     $this->attr = "data-ajax";
 }
 public function compile(JsUtils $js = NULL, View $view = NULL)
 {
     $this->_template = str_replace("%caption%", $this->caption, $this->_template);
     if ($this->getIsStacked() === false) {
         $this->wrap('<div class="progress">', '</div>');
     }
     return parent::compile($js, $view);
 }
 public function __construct($identifier, $tagName = "div")
 {
     parent::__construct($identifier, $tagName);
     $this->setProperty("role", "tabpanel");
     $this->setProperty("class", "tab-pane");
 }