1 | <?php |
||
16 | class HtmlBreadcrumbs extends HtmlNavElement { |
||
1 ignored issue
–
show
|
|||
17 | /** |
||
18 | * @var boolean $autoActive sets the last element's class to <b>active</b> if true |
||
19 | */ |
||
20 | protected $autoActive; |
||
21 | |||
22 | /** |
||
23 | * @var boolean if set to true, the path of the elements is absolute |
||
24 | */ |
||
25 | protected $absolutePaths; |
||
26 | |||
27 | /** |
||
28 | * @var function the function who generates the href elements. default : function($e){return $e->getContent()} |
||
29 | */ |
||
30 | protected $_hrefFunction; |
||
1 ignored issue
–
show
|
|||
31 | |||
32 | /** |
||
33 | * @param string $identifier |
||
34 | * @param array $elements |
||
35 | * @param boolean $autoActive sets the last element's class to <b>active</b> if true |
||
36 | * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()} |
||
37 | */ |
||
38 | public function __construct($identifier,$elements=array(),$autoActive=true,$hrefFunction=NULL){ |
||
50 | |||
51 | /** |
||
52 | * @param mixed $element |
||
53 | * @param string $href |
||
54 | * @return \Ajax\bootstrap\html\HtmlLink |
||
55 | */ |
||
56 | public function addElement($element,$href="",$glyph=NULL){ |
||
74 | |||
75 | public function setActive($index=null){ |
||
84 | |||
85 | public function addElements($elements){ |
||
91 | |||
92 | public function fromArray($array){ |
||
97 | |||
98 | /** |
||
99 | * Return the url of the element at $index or the breadcrumbs url if $index is ommited |
||
100 | * @param int $index |
||
101 | * @param string $separator |
||
102 | * @return string |
||
103 | */ |
||
104 | public function getHref($index=null,$separator="/"){ |
||
114 | |||
115 | /* |
||
116 | * (non-PHPdoc) |
||
117 | * @see \Ajax\bootstrap\html\BaseHtml::compile() |
||
118 | */ |
||
119 | public function compile(JsUtils $js=NULL, View $view=NULL) { |
||
125 | |||
126 | /* (non-PHPdoc) |
||
127 | * @see \Ajax\bootstrap\html\base\BaseHtml::fromDatabaseObject() |
||
128 | */ |
||
129 | public function fromDatabaseObject($object, $function) { |
||
132 | |||
133 | /* |
||
134 | * (non-PHPdoc) |
||
135 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
||
136 | */ |
||
137 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
||
143 | |||
144 | public function setAutoActive($autoActive) { |
||
148 | |||
149 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
||
155 | |||
156 | /** |
||
157 | * Associate an ajax get to the breadcrumbs elements, displayed in $targetSelector |
||
158 | * $attr member is used to build each element url |
||
159 | * @param string $targetSelector the target of the get |
||
160 | * @param string $attr the html attribute used to build the elements url |
||
161 | * @return HtmlBreadcrumbs |
||
162 | */ |
||
163 | public function autoGetOnClick($targetSelector){ |
||
166 | |||
167 | public function contentAsString(){ |
||
173 | |||
174 | public function getElement($index){ |
||
177 | |||
178 | /** |
||
179 | * Add a glyphicon to the element at index $index |
||
180 | * @param mixed $glyph |
||
181 | * @param int $index |
||
182 | */ |
||
183 | public function addGlyph($glyph,$index){ |
||
187 | |||
188 | /** |
||
189 | * Add new elements in breadcrumbs corresponding to request dispatcher : controllerName, actionName, parameters |
||
190 | * @param Dispatcher $dispatcher the request dispatcher |
||
191 | * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
||
192 | */ |
||
193 | public function fromDispatcher($dispatcher){ |
||
198 | |||
199 | |||
200 | /** |
||
201 | * sets the function who generates the href elements. default : function($element){return $element->getContent()} |
||
202 | * @param function $_hrefFunction |
||
203 | * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
||
204 | */ |
||
205 | public function setHrefFunction($_hrefFunction) { |
||
209 | |||
210 | } |
||
1 ignored issue
–
show
|