diff options
Diffstat (limited to 'code/nav.inc.php')
-rw-r--r-- | code/nav.inc.php | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/code/nav.inc.php b/code/nav.inc.php index e7617d1..06ce84d 100644 --- a/code/nav.inc.php +++ b/code/nav.inc.php @@ -29,6 +29,31 @@ return $ret; } + + function ParseLink($text, $link) { + if(!$link) return $text; + + switch($link[0]) { + case ':': + $ret = $GLOBALS['links']->GetNeonLink(substr($link, 1)); + + if($ret) + return '<a href="' . $ret . '">' . $text . '</a>'; + + return $text; + case '@': + return '<a href="' . $GLOBALS['links']->GetMailtoLink(substr($link, 1)) . '">' . $text . '</a>'; + case '!': + $ret = $GLOBALS['links']->GetNavPage(substr($link, 1)); + + if($ret) + return $ret; + + return $text; + default: + return '<a href="' . $GLOBALS['links']->GetExternalLink($link) . '">' . $text . '</a>'; + } + } } class NavEntry { @@ -49,7 +74,7 @@ $ccount = 0; $ret = '<li>'; - $a = $GLOBALS['links']->ParseNavLink($this->text, $this->link); + $a = $GLOBALS['nav']->ParseLink($this->text, $this->link); $ret .= $a; |