diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:30:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:30:50 +0000 |
commit | d5f222b7ebf4d2c2d47d20a25adcc9aadf67fbd5 (patch) | |
tree | da9b32212bf99154450a7668f61a75f65617a9fa /application/views/helpers/Breadcrumb.php | |
parent | Initial commit. (diff) | |
download | icingaweb2-module-toplevelview-upstream.tar.xz icingaweb2-module-toplevelview-upstream.zip |
Adding upstream version 0.3.3.upstream/0.3.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/views/helpers/Breadcrumb.php')
-rw-r--r-- | application/views/helpers/Breadcrumb.php | 32 |
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; + } +} |