From 09139e0eab6f6b7003ab855dbd7527bb42284327 Mon Sep 17 00:00:00 2001 From: duck Date: Mon, 12 Jul 2004 19:17:49 +0000 Subject: [PATCH] read navigation from menu.ini (duck) --- index.php | 3 +- menu.ini | 155 ++++++++++++++++++++++++++++++++++++++++++++++ menu.php | 65 ++++++++++--------- pages/header.html | 2 +- pages/menu.html | 60 ------------------ 5 files changed, 189 insertions(+), 96 deletions(-) create mode 100644 menu.ini delete mode 100644 pages/menu.html diff --git a/index.php b/index.php index 3e94ffdb..7d16e581 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,7 @@ 'News', - 'about' => 'About I2P', - 'getinvolved' => 'Get involved', - 'halloffame' => 'Hall of Fame', - 'myi2p' => 'MyI2P', - 'minwww' => 'MinWWW', - 'i2ptunnel' => 'I2PTunnel', - 'i2ptunnel_services' => 'Setting up services', - 'i2ptunnel_tuning' => 'Tuning', - 'i2ptunnel_lan' => 'LAN setup', - 'jvm' => 'JVM', - 'api' => 'API', - 'sam' => 'SAM', - 'i2cp' => 'I2CP', - 'how' => 'How does it work?', - 'how_intro' => 'Intro', - 'how_threatmodel' => 'Threat model', - 'how_tunnelrouting' => 'Tunnel routing', - 'how_garlicrouting' => 'Garlic routing', - 'how_networkdatabase' => 'Network database', - 'how_peerselection' => 'Peer selection', - 'how_cryptography' => 'Cryptography', - 'how_elgamalaes' => 'ElGamal/AES+SessionTag', - 'how_networkcomparisons' => 'Network comparisons', - 'faq' => 'FAQ', - 'cvs' => 'CVS'); - function getpagetitle($page) { - global $pagetitles; - if (isset($pagetitles[$page])) { - return $pagetitles[$page]; + global $site_structure; + if (isset($site_structure[$page]['title'])) { + return $site_structure[$page]['title']; } $title = str_replace ('_', ' ', $page); return ucfirst($title); } + +function buildmenu() { + global $site_structure; + foreach ($site_structure as $page=>$page_config) { + if (isset($page_config['depth'])) { + $title = getpagetitle($page); + $link = ''; + if (isset($page_config['link'])) { + $link = $page_config['link']; + } else { + $link = $page; + } + switch ($page_config['depth']) { + case 1: + print "
$title
\n"; + break; + case 2: + print "- $title
\n"; + break; + case 3: + print "  * $title
\n"; + break; + default: + } + + } + } +} ?> diff --git a/pages/header.html b/pages/header.html index f1de52f9..20831f58 100644 --- a/pages/header.html +++ b/pages/header.html @@ -20,7 +20,7 @@ echo "\n";

I2P -

diff --git a/pages/menu.html b/pages/menu.html deleted file mode 100644 index 5ec3dab0..00000000 --- a/pages/menu.html +++ /dev/null @@ -1,60 +0,0 @@ -News[ ]
-- Roadmap
-
-About I2P[ ]
-- Bounties
-- Donate
-- Get involved
-- Hall of Fame
-- Team
-
-Download
-
-Documentation[ ]
-- Installation[ ]
-- Applications
-  * MyI2P[ ]
-  * MinWWW
-  * I2PTunnel[.]
- -- Performance
-  * jbigi
-  * JVM[ ]
-  * Config tweaks[ ]
-- API[.]
- -- How does it work?[.]
- -
-FAQ
-
-Development[ ]
-- Implementation[ ]
-- Bugzilla
-- Licenses
-- Mailinglist
-- Meetings
-- CVS
-
-Forum
-
-Links