summaryrefslogtreecommitdiffstats
path: root/code/links.inc.php
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2006-01-14 03:14:01 +0100
committerneoraider <devnull@localhost>2006-01-14 03:14:01 +0100
commitc630a2d50349c57660cfc98eb13ec71444b27610 (patch)
tree4fa7ad9b755a4d8ae9045062cb4fefab248187e4 /code/links.inc.php
parent8b89c8c8a9001c5f5b38465ceb58306fc6f0659e (diff)
downloadneon-c630a2d50349c57660cfc98eb13ec71444b27610.tar
neon-c630a2d50349c57660cfc98eb13ec71444b27610.zip
Login implementiert. Puh... Und dabei auch den Handler phpexec und die Nav-Pages eingebaut.
Diffstat (limited to 'code/links.inc.php')
-rw-r--r--code/links.inc.php44
1 files changed, 35 insertions, 9 deletions
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 '<a href="' . $ret . '">' . $text . '</a>';
+
+ return $text;
case '@':
- return $this->GetMailtoLink(substr($link, 1));
+ return '<a href="' . $this->GetMailtoLink(substr($link, 1)) . '">' . $text . '</a>';
case '!':
- return '';
+ $ret = $this->GetNavPage(substr($link, 1));
+
+ if($ret)
+ return $ret;
+
+ return $text;
default:
- return $this->GetExternalLink($link);
+ return '<a href="' . $this->GetExternalLink($link) . '">' . $text . '</a>';
}
}
}