summaryrefslogtreecommitdiff
path: root/htdocs/navigation.php
blob: f3dfd4cce0543da6783a1a3efc19277229606800 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?php
// navigation.php handles the sidebar navigation for vim online
require_once("$BASE_DIR/include/menu.inc");

// menu setup
$home = new Menu('Home',$BASE.'/index.php');
$search = new Menu('Advanced search',$BASE.'/search.php');

$about = new Menu('About Vim',$BASE.'/about.php');
$about->addSubMenu(new Menu('in 6 Kbyte',$BASE.'/6kbyte.php'));
$about->addSubMenu(new Menu('for Vi users',$BASE.'/viusers.php'));
$about->addSubMenu(new Menu('for Vim 5 users',$BASE.'/vim5users.php'));
$about->addSubMenu(new Menu('for others',$BASE.'/others.php'));

$community = new Menu('Community',$BASE.'/community.php');
$community->addSubMenu(new Menu('Mailing Lists',$BASE.'/maillist.php'));
$community->addSubMenu(new Menu('Web Pages',$BASE.'/web.php'));
$community->addSubMenu(new Menu('Credits',$BASE.'/thanks.php'));

$docs = new Menu('Documentation',$BASE.'/docs.php');
$docs->addSubMenu(new Menu('help files online &gt;&gt;','http://vimdoc.sourceforge.net/htmldoc/usr_toc.html'));
$docs->addSubMenu(new Menu('the book &gt;&gt;','http://iccf-holland.org/click5.html'));
$docs->addSubMenu(new Menu('Vimdoc site &gt;&gt;','http://vimdoc.sourceforge.net/'));
$docs->addSubMenu(new Menu('the FAQ &gt;&gt;','http://vimdoc.sourceforge.net/htmldoc/vimfaq.html'));

$download = new Menu('Download',$BASE.'/download.php');
$download->addSubMenu(new Menu('List of Mirrors',$BASE.'/mirrors.php'));
$download->addSubMenu(new Menu('Sources',$BASE.'/sources.php'));
$download->addSubMenu(new Menu('Vim from Mercurial',$BASE.'/mercurial.php'));
$download->addSubMenu(new Menu('Vim from CVS',$BASE.'/cvs.php'));
$download->addSubMenu(new Menu('Vim from SVN',$BASE.'/subversion.php'));
$download->addSubMenu(new Menu('Patches',$BASE.'/patches.php'));
$download->addSubMenu(new Menu('Development',$BASE.'/develop.php'));
$download->addSubMenu(new Menu('Runtime files',$BASE.'/runtime.php'));
$download->addSubMenu(new Menu('Script links',$BASE.'/vimscriptlinks.php'));
$download->addSubMenu(new Menu('Translations',$BASE.'/translations.php'));

$news = new Menu('News',$BASE.'/news/news.php');

$sponsor = new Menu('Sponsoring',$BASE.'/sponsor/index.php');
$sponsor->addSubMenu(new Menu('Sponsor FAQ',$BASE.'/sponsor/faq.php'));
$sponsor->addSubMenu(new Menu('Subscribe',$BASE.'/sponsor/subscribe.php'));
$sponsor->addSubMenu(new Menu('Hall of honour',$BASE.'/sponsor/hall_of_honour.php'));
$sponsor->addSubMenu(new Menu('My votes',$BASE.'/sponsor/vote.php'));
$sponsor->addSubMenu(new Menu('Voting results',$BASE.'/sponsor/vote_results.php'));

$scripts = new Menu('Scripts',$BASE.'/scripts/index.php');
$scripts->addSubMenu(new Menu('Browse all',$BASE.'/scripts/script_search_results.php'));
$scripts->addSubMenu(new Menu('Add Script',$BASE.'/scripts/add_script.php'));
$scripts->addSubMenu(new Menu('Karma',$BASE.'/karma.php'));

$tips = new Menu('Tips',$BASE.'/tips/index.php');

$account = new Menu('My Account',$BASE.'/account/index.php');

$trivia = new Menu('Trivia',$BASE.'/trivia.php');
$trivia->addSubMenu(new Menu('Logos',$BASE.'/logos.php'));
$trivia->addSubMenu(new Menu('Buttons',$BASE.'/buttons.php'));
$trivia->addSubMenu(new Menu('Weird stuff',$BASE.'/weird.php'));
$trivia->addSubMenu(new Menu('Posters',$BASE.'/posters.php'));

$help = new Menu('Site Help',$BASE.'/huh.php');

$sep = new Menu('Sep','Sep');
$sep->setSeparator();

// construct the top level main menus
$mainMenus = array(
        $home,
        $search,
        $sep,
        $about,
        $community,
        $news,
        $sponsor,
        $trivia,
        $docs,
        $download,
        $sep,
        $scripts,
        $tips,
        $account,
        $sep,
        $help
    );
// paint the login status and the menus
?>
<table width="100%" cellpadding="0" cellspacing="0" border="0" bordercolor="red">
    <tr>
<?php
if(isSessionValid()){
    $user = getSessionUser();
?>
        <td><small>welcome <?=escapeForHTMLNoBreaks($user->getFirstName())?> (<a href="<?=$BASE?>/logout.php">logout</a>)</small></td>
<?php
} else {
?>
        <td><small>not logged in (<a href="<?=$BASE?>/login.php">login</a>)</small></td>
<?php
} 
?>
    </tr>
    <tr><td>
<small>&nbsp;</small>
<form action="http://www.google.com/cse" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-3005259998294962:bvyni59kjr1" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="20" />
    <br>
    <input type="submit" name="sa" value="Search" />
  </div>
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script>
    </td></tr>
    <tr>
        <td><img src="<?=$IMAGES?>/spacer.gif" alt="" border="0" width="1" height="1"></td>
    </tr>
    <tr>
        <td class="darkbg"><img src="<?=$IMAGES?>/spacer.gif" alt='' border="0" height="3"></td>
    </tr>
    <tr>
        <td><img src="<?=$IMAGES?>/spacer.gif" alt="" border="0" width="1" height="2"></td>
    </tr>
<?php
// draw the menus
foreach($mainMenus as $menu){
    if($menu->isSeparator()){
?>
    <tr>
        <td><img src="<?=$IMAGES?>/spacer.gif" alt="" border="0" width="1" height="7"></td>
    </tr>
    <tr>
        <td class="checker"><img src="<?=$IMAGES?>/spacer.gif" alt='' border="0" height="1"></td>
    </tr>
    <tr>
        <td><img src="<?=$IMAGES?>/spacer.gif" alt="" border="0" width="1" height="7"></td>
    </tr>
<?php
    } else if($menu->isSelected($_SERVER['REQUEST_URI'])){
        // we are in this nav main
?>
        <tr>
            <td class="sidebarheader"><?=$menu->getName()?></td>
        </tr>
<?php
    } else {
?>
        <tr>
            <td class="sidebarheader"><a href="<?=$menu->getLink()?>"><?=$menu->getName()?></a></td>
        </tr>
<?php
    }
    if($menu->isOpen($_SERVER['REQUEST_URI'])){
        foreach($menu->getSubMenus() as $subMenu){
            if($subMenu->isSelected($_SERVER['REQUEST_URI'])){
?>
        <tr>
            <td class="sidebarheader">
                &nbsp;&nbsp;&nbsp;&nbsp;<?=$subMenu->getName()?>
            </td>
        </tr>
<?php
            } else {
?>
        <tr>
            <td class="sidebarheader">
                &nbsp;&nbsp;&nbsp;&nbsp;<a href="<?=$subMenu->getLink()?>"><?=$subMenu->getName()?></a>
            </td>
        </tr>
<?php
            }           
        }
    }
}
?>
</table>