From c630a2d50349c57660cfc98eb13ec71444b27610 Mon Sep 17 00:00:00 2001 From: neoraider Date: Sat, 14 Jan 2006 02:14:01 +0000 Subject: Login implementiert. Puh... Und dabei auch den Handler phpexec und die Nav-Pages eingebaut. --- code/links.inc.php | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) (limited to 'code/links.inc.php') diff --git a/code/links.inc.php b/code/links.inc.php index 39a1ae2..2e8d551 100644 --- a/code/links.inc.php +++ b/code/links.inc.php @@ -2,33 +2,59 @@ if(!defined('LINKS_INC')) { define('LINKS_INC', 1); + include('code/user.inc.php'); + class Links { function GetNeonLink($page) { - if($GLOBALS['pages']->HasAccess($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 ''; } function GetExternalLink($link) { - return $link; + return $link; } function GetMailtoLink($address) { - return 'mailto:' . $address; + return 'mailto:' . $address; + } + + function GetNavPage($page) { + if($GLOBALS['pages']->HasAccess($page, 'n')) { + $page = $GLOBALS['pages']->Get($page, 'n'); + return $page['content']; + } + + return ''; } - function ParseNavLink($link) { - if(!$link) return ''; + function ParseNavLink($text, $link) { + if(!$link) return $text; switch($link[0]) { case ':': - return $this->GetNeonLink(substr($link, 1)); + $ret = $this->GetNeonLink(substr($link, 1)); + + if($ret) + return '' . $text . ''; + + return $text; case '@': - return $this->GetMailtoLink(substr($link, 1)); + return '' . $text . ''; case '!': - return ''; + $ret = $this->GetNavPage(substr($link, 1)); + + if($ret) + return $ret; + + return $text; default: - return $this->GetExternalLink($link); + return '' . $text . ''; } } } -- cgit v1.2.3