mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
git-subtree-dir: community_server git-subtree-mainline: ff11f6efe35bba180260fe84077bcd94298895c1 git-subtree-split: b6544b9e69fb85d4da100934675323c3e8c8ef67
50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
namespace Model\Navigation;
|
|
|
|
/**
|
|
* Navigation Hierarchy
|
|
*
|
|
* Meant for the center page navigation, where you want to show the full
|
|
* hierarchy of pages, resp. navigation links.
|
|
*
|
|
* @author Christine Slotty <christine.slotty@software-labor.de>
|
|
*/
|
|
class NaviHierarchy implements \Countable
|
|
{
|
|
private $hierarchy = [];
|
|
|
|
public function add($entry)
|
|
{
|
|
array_push($this->hierarchy, $entry);
|
|
return $this;
|
|
}
|
|
public function getHierarchy()
|
|
{
|
|
return $this->hierarchy;
|
|
}
|
|
public function count()
|
|
{
|
|
return count($this->hierarchy);
|
|
}
|
|
public function __toString()
|
|
{
|
|
$html = "<ul class='nav-content-list'>";
|
|
$count = count($this->hierarchy);
|
|
foreach ($this->hierarchy as $i => $e) {
|
|
$html .= $e;
|
|
if ($i < $count - 1) {
|
|
$html .= "<li class='nav-content-separator'>-</li>";
|
|
}
|
|
}
|
|
$html .= "</ul>";
|
|
return $html;
|
|
}
|
|
}
|