forked from I2P_Developers/i2p.www
rolled back to 1.4 (mods didn't quite work)
This commit is contained in:
76
menu.php
76
menu.php
@@ -1,48 +1,46 @@
|
|||||||
<?php
|
<?php
|
||||||
function getpagetitle($page) {
|
function getpagetitle($page) {
|
||||||
global $site_structure;
|
global $site_structure;
|
||||||
if (isset($site_structure[$page]['title'])) {
|
if (isset($site_structure[$page]['title'])) {
|
||||||
return $site_structure[$page]['title'];
|
return $site_structure[$page]['title'];
|
||||||
}
|
}
|
||||||
$title = str_replace ('_', ' ', $page);
|
$title = str_replace ('_', ' ', $page);
|
||||||
return ucfirst($title);
|
return ucfirst($title);
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildmenu() {
|
function buildmenu() {
|
||||||
global $site_structure;
|
global $site_structure;
|
||||||
foreach ($site_structure as $page=>$page_config) {
|
foreach ($site_structure as $page=>$page_config) {
|
||||||
if (isset($page_config['depth'])) {
|
if (isset($page_config['depth'])) {
|
||||||
$title = getpagetitle($page);
|
$title = getpagetitle($page);
|
||||||
$link = '';
|
$link = '';
|
||||||
$uri = '';
|
$uri = '';
|
||||||
if (isset($page_config['link'])) {
|
if (isset($page_config['link'])) {
|
||||||
$uri = $page_config['link'];
|
$uri = $page_config['link'];
|
||||||
} else {
|
} else {
|
||||||
$uri = $page;
|
$uri = $page;
|
||||||
}
|
}
|
||||||
if (isset($page_config['nolink'])) {
|
if (isset($page_config['nolink'])) {
|
||||||
$link = $title;
|
$link = $title;
|
||||||
} else {
|
} else {
|
||||||
if(preg_match("/^(http:\/\/|\/)/", $title))
|
$link = "<a href=\"$uri\">$title</a>";
|
||||||
$link = "<a href=\"$uri\">$title</a>";
|
}
|
||||||
else
|
|
||||||
$link = "<a href=\"/$uri\">$title</a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($page_config['depth']) {
|
switch ($page_config['depth']) {
|
||||||
case 1:
|
case 1:
|
||||||
print "<br /><b>$link</b><br />\n";
|
print "<br /><b>$link</b><br />\n";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
print "- $link<br />\n";
|
print "- $link<br />\n";
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
print " ⋅ $link<br />\n";
|
print " ⋅ $link<br />\n";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user