2004-07-12 17:22:55 +00:00
|
|
|
<?php
|
2004-07-23 04:44:45 +00:00
|
|
|
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
2004-07-12 17:22:55 +00:00
|
|
|
function getpagetitle($page) {
|
2004-07-23 04:15:19 +00:00
|
|
|
global $site_structure;
|
|
|
|
if (isset($site_structure[$page]['title'])) {
|
|
|
|
return $site_structure[$page]['title'];
|
|
|
|
}
|
|
|
|
$title = str_replace ('_', ' ', $page);
|
|
|
|
return ucfirst($title);
|
2004-07-12 17:22:55 +00:00
|
|
|
}
|
2004-07-12 19:17:49 +00:00
|
|
|
|
|
|
|
function buildmenu() {
|
2004-07-23 04:15:19 +00:00
|
|
|
global $site_structure;
|
|
|
|
foreach ($site_structure as $page=>$page_config) {
|
|
|
|
if (isset($page_config['depth'])) {
|
|
|
|
$title = getpagetitle($page);
|
|
|
|
$link = '';
|
|
|
|
$uri = '';
|
|
|
|
if (isset($page_config['link'])) {
|
|
|
|
$uri = $page_config['link'];
|
|
|
|
} else {
|
|
|
|
$uri = $page;
|
|
|
|
}
|
|
|
|
if (isset($page_config['nolink'])) {
|
|
|
|
$link = $title;
|
|
|
|
} else {
|
2004-08-03 12:54:23 +00:00
|
|
|
$link = "<a href=\"$uri\">$title</a>";
|
|
|
|
}
|
2004-07-21 02:55:55 +00:00
|
|
|
|
2004-07-23 04:15:19 +00:00
|
|
|
switch ($page_config['depth']) {
|
|
|
|
case 1:
|
|
|
|
print "<br /><b>$link</b><br />\n";
|
|
|
|
break;
|
|
|
|
case 2:
|
2004-08-06 11:21:18 +00:00
|
|
|
print "• $link<br />\n";
|
2004-07-23 04:15:19 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2004-08-06 11:21:18 +00:00
|
|
|
print " - $link<br />\n";
|
2004-07-23 04:15:19 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
}
|
2004-07-12 19:17:49 +00:00
|
|
|
|
2004-07-23 04:15:19 +00:00
|
|
|
}
|
|
|
|
}
|
2004-07-12 19:17:49 +00:00
|
|
|
}
|
2004-08-03 12:54:23 +00:00
|
|
|
?>
|