phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
HtmlSemNavElement.php
Go to the documentation of this file.
1 <?php
3 
6 
13 abstract class HtmlSemNavElement extends HtmlSemCollection {
14  use NavElementTrait;
15 
20  protected $root;
21 
26  protected $attr;
27 
32  protected $_contentSeparator = "";
33 
34  public function __construct($identifier, $tagName, $baseClass) {
35  parent::__construct($identifier, $tagName, $baseClass);
36  $this->root = "";
37  $this->attr = "data-ajax";
38  }
39 
47  public function autoGetOnClick($targetSelector) {
48  return $this->getOnClick($this->root, $targetSelector, array(
49  "attr" => $this->attr
50  ));
51  }
52 
53  public function contentAsString() {
54  return JArray::implode($this->_contentSeparator, $this->content);
55  }
56 
57  public function setContentDivider($divider, $index = NULL) {
58  $divider = "<div class='divider'> {$divider} </div>";
59  return $this->setDivider($divider, $index);
60  }
61 
62  public function setIconContentDivider($iconContentDivider, $index = NULL) {
63  $contentDivider = "<i class='" . $iconContentDivider . " icon divider'></i>";
64  return $this->setDivider($contentDivider, $index);
65  }
66 
67  protected function setDivider($divider, $index) {
68  if (isset($index)) {
69  if (! \is_array($this->_contentSeparator))
70  $this->_contentSeparator = array_fill(0, $this->count() - 1, $this->_contentSeparator);
71  $this->_contentSeparator[$index] = $divider;
72  } else {
73  $this->_contentSeparator = $divider;
74  }
75  return $this;
76  }
77 
78  protected function getContentDivider($index) {
79  if (\is_array($this->_contentSeparator)) {
80  return @$this->_contentSeparator[$index];
81  }
83  }
84 }
Sem class for navigation elements : Breadcrumbs and Pagination.
static implode($glue, $pieces)
Definition: JArray.php:41
__construct($identifier, $tagName, $baseClass)
autoGetOnClick($targetSelector)
Associate an ajax get to the elements, displayed in $targetSelector.
Base class for Semantic Html collections.
getOnClick($url, $responseElement="", $parameters=array())
Performs a get to $url on the click event on $element and display it in $responseElement.
setIconContentDivider($iconContentDivider, $index=NULL)
attr($element='this', $attributeName='id', $value="", $immediatly=false)
Get or set the value of an attribute for the first element in the set of matched elements or set one ...