summaryrefslogtreecommitdiffstats
path: root/application/views/helpers/Breadcrumb.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/views/helpers/Breadcrumb.php')
-rw-r--r--application/views/helpers/Breadcrumb.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/application/views/helpers/Breadcrumb.php b/application/views/helpers/Breadcrumb.php
new file mode 100644
index 0000000..3263712
--- /dev/null
+++ b/application/views/helpers/Breadcrumb.php
@@ -0,0 +1,32 @@
+<?php
+/* Icinga Web 2 | (c) 2016 Icinga Development Team | GPLv2+ */
+
+use Icinga\Module\Toplevelview\Tree\TLVTreeNode;
+
+class Zend_View_Helper_Breadcrumb extends Zend_View_Helper_Abstract
+{
+ /** @var \Icinga\Web\View */
+ public $view;
+
+ /**
+ * @param TLVTreeNode[] $breadcrumb
+ *
+ * @return string
+ */
+ public function breadcrumb($breadcrumb, $config_name)
+ {
+ $htm = '<ul class="breadcrumb">';
+ foreach ($breadcrumb as $crumb) {
+ $htm .= '<li>' . $this->view->qlink(
+ $crumb->getTitle(),
+ 'toplevelview/show/tree',
+ array(
+ 'name' => $config_name,
+ 'id' => $crumb->getFullId()
+ )
+ ) . '</li>';
+ }
+ $htm .= '</ul>';
+ return $htm;
+ }
+}