/
directory.php
93 lines (86 loc) · 2.93 KB
/
directory.php
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
<?
// Copyright 2002 Brian Ronald. All rights reserved.
// Portable PHP/MySQL Corporate Intranet System
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//////////////////////////////////////////////////////////////////////////////
// This file is a module which builds the second layer directory menu
// and includes other files in order to fulfill the functions
// selected from that menu.
require("head.inc");
if($userid==0)
{
print("<h1>".$lang['need_logged_in_directory']."</h1>");
require("tail.inc");
die("");
}
// Build the second layer menu
unset($module);
$module[$lang['internal_directory']]="directorylist.inc";
$module[$lang['external_directory']]="extdirlist.inc";
$module[$lang['website_directory']]="webdirectory.inc";
if(!(isset($callmodule)))
$callmodule=$lang['internal_directory'];
?>
<table>
<tr>
<?
$mod_percent=100 / count($module);
foreach($module as $mod_tag=>$mod_file) // Render the second layer menu
{
if($callmodule==$mod_tag)
{
$valid=true;
print("<th class=\"module_selected\" width=\"$mod_percent%\">");
}
else
{
print("<th class=\"module\" width=\"$mod_percent%\">");
}
print("<a class=\"module\" href=\"$PHP_SELF?callmodule=".rawurlencode($mod_tag)."\">$mod_tag</a></th>\n");
}
?>
</tr>
</table>
<?
switch ($callmodule) // Include the correct file depending on the menu selection
{
case $lang['internal_directory']:
if(isset($showuserid))
{
require("directorydetail.inc");
}
else
{
require($module[$lang['internal_directory']]);
}
break;
case $lang['website_directory']:
require($module[$lang['website_directory']]);
break;
default:
if(isset($showuserid))
{
require("extdirdetail.inc");
}
else
{
require($module[$lang['external_directory']]);
}
}
?>
<?
require("tail.inc");
?>