diff options
Diffstat (limited to 'code/links.inc.php')
-rw-r--r-- | code/links.inc.php | 104 |
1 files changed, 50 insertions, 54 deletions
diff --git a/code/links.inc.php b/code/links.inc.php index c207945..e118160 100644 --- a/code/links.inc.php +++ b/code/links.inc.php @@ -1,64 +1,60 @@ <?PHP - if(!defined('LINKS_INC')) { - define('LINKS_INC', 1); - - require_once('code/user.inc.php'); - - class Links { - function GetNeonLink($page) { - if($GLOBALS['pages']->HasAccess($page, 'c')) { - if($GLOBALS['user']->GetLoginType() == 'url') - return 'index.php?page=' . $page . '&login=' . $GLOBALS['user']->GetLoginKey(); + require_once('code/user.inc.php'); + + class Links { + function GetNeonLink($page) { + if($GLOBALS['pages']->HasAccess($page, 'c')) { + if($GLOBALS['user']->GetLoginType() == 'url') + return 'index.php?page=' . $page . '&login=' . $GLOBALS['user']->GetLoginKey(); - return 'index.php?page=' . $page; - } - - return ''; + return 'index.php?page=' . $page; } - - function GetExternalLink($link) { - return $link; - } - - function GetMailtoLink($address) { - return 'mailto:' . $address; - } - - function GetNavPage($page) { - if($GLOBALS['pages']->HasAccess($page, 'n')) { - $page = $GLOBALS['pages']->Get($page, 'n'); - return $page['content']; - } - return ''; + return ''; + } + + function GetExternalLink($link) { + return $link; + } + + function GetMailtoLink($address) { + return 'mailto:' . $address; + } + + function GetNavPage($page) { + if($GLOBALS['pages']->HasAccess($page, 'n')) { + $page = $GLOBALS['pages']->Get($page, 'n'); + return $page['content']; } - function ParseNavLink($text, $link) { - if(!$link) return $text; - - switch($link[0]) { - case ':': - $ret = $this->GetNeonLink(substr($link, 1)); - - if($ret) - return '<a href="' . $ret . '">' . $text . '</a>'; - - return $text; - case '@': - return '<a href="' . $this->GetMailtoLink(substr($link, 1)) . '">' . $text . '</a>'; - case '!': - $ret = $this->GetNavPage(substr($link, 1)); - - if($ret) - return $ret; - - return $text; - default: - return '<a href="' . $this->GetExternalLink($link) . '">' . $text . '</a>'; - } - } + return ''; } - $links = new Links; + function ParseNavLink($text, $link) { + if(!$link) return $text; + + switch($link[0]) { + case ':': + $ret = $this->GetNeonLink(substr($link, 1)); + + if($ret) + return '<a href="' . $ret . '">' . $text . '</a>'; + + return $text; + case '@': + return '<a href="' . $this->GetMailtoLink(substr($link, 1)) . '">' . $text . '</a>'; + case '!': + $ret = $this->GetNavPage(substr($link, 1)); + + if($ret) + return $ret; + + return $text; + default: + return '<a href="' . $this->GetExternalLink($link) . '">' . $text . '</a>'; + } + } } + + $GLOBALS['links'] = new Links; ?> |