diff options
Diffstat (limited to 'code/links.inc.php')
-rw-r--r-- | code/links.inc.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/code/links.inc.php b/code/links.inc.php new file mode 100644 index 0000000..ab3b786 --- /dev/null +++ b/code/links.inc.php @@ -0,0 +1,36 @@ +<?PHP + if(!defined('LINKS_INC')) { + define('LINKS_INC', 1); + + class Links { + function GetNeonLink($page) { + return 'index.php?page=' . $page; + } + + function GetExternalLink($link) { + return $link; + } + + function GetMailtoLink($address) { + return 'mailto:' . $address; + } + + function ParseNavLink($link) { + if(!$link) return ''; + + switch($link[0]) { + case ':': + return $this->GetNeonLink(substr($link, 1)); + case '@': + return $this->GetMailtoLink(substr($link, 1)); + case '!': + return ''; + default: + return $this->GetExternalLink($link); + } + } + } + + $links = new Links; + } +?> |