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