From ecb8233cd7e9fbacd7614028115161565e841d87 Mon Sep 17 00:00:00 2001 From: neoraider Date: Thu, 12 Jan 2006 22:18:03 +0000 Subject: Die Navigationsleiste ist jetzt eingebaut. Viele Bugs wurden gel?st und einiges ?berarbeitet. --- code/nav.inc.php | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 code/nav.inc.php (limited to 'code/nav.inc.php') diff --git a/code/nav.inc.php b/code/nav.inc.php new file mode 100644 index 0000000..f6f0782 --- /dev/null +++ b/code/nav.inc.php @@ -0,0 +1,92 @@ +EOF) { + $this->entries[$res->fields[0]] = new NavEntry($res->fields[1], $res->fields[2], $res->fields[3]); + + $res->MoveNext(); + } + + foreach($this->entries as $entry) + if($entry->GetParentId() != 0) + $this->entries[$entry->GetParentId()]->Add($entry); + } + + function ParseEntries() { + $ret = ''; + + return $ret; + } + } + + class NavEntry { + var $parent, $text, $link; + var $children = array(); + + function NavEntry($parent, $text, $link) { + $this->parent = $parent; + $this->text = $text; + $this->link = $link; + } + + function Add($entry) { + array_push($this->children, $entry); + } + + function GetChildren() { + return $this->children; + } + + function GetParentId() { + return $this->parent; + } + + function GetText() { + return $this->text; + } + + function GetLink() { + return $this->link; + } + + function Parse() { + $ret = '
  • '; + + $link = $GLOBALS['links']->ParseNavLink($this->link); + + if($link) + $ret .= '' . $this->text . ''; + else + $ret .= $this->text; + + if(count($this->children) > 0) { + $ret .= ''; + } + + return $ret . '
  • '; + } + } + + $nav = new Nav; + } +?> -- cgit v1.2.3