summaryrefslogtreecommitdiffstats
path: root/code/links.inc.php
blob: ab3b7862760d49807564935da4c2c700b28f7aa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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;
  }
?>