/
controlBar.php
executable file
·140 lines (114 loc) · 3.42 KB
/
controlBar.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
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="stylesheet" type="text/css" href="bcnet.css" title="style" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Network Database</title>
<script type='text/javascript' src='js/jquery-ui/js/jquery-1.5.1.min.js'></script>
<script type='text/javascript' src='js/jquery-ui/js/jquery-ui-1.8.11.custom.min.js'></script>
<script type='text/javascript' src='js/mouseClicks.js'></script>
<script type='text/javascript' src='js/Ajax.js'></script>
<script type='text/javascript'>
function checkAll(checkname, exby) {
for (i = 0; i < checkname.length; i++)
checkname[i].checked = exby.checked? true:false
}
</script>
<?
include_once "classes/Plugins.php";
$allPlugins = Plugins::get_plugins();
echo "<style>";
foreach ($allPlugins as $id => $value)
{
$curPlugin = new Plugins($id);
$iconPath = $curPlugin->get_icon_path();
$iconPath = str_replace(" ", "%20", $iconPath);
echo "[icon^=\"plugIcon".$id."\"]{
background:transparent url(".$iconPath.") no-repeat center left;
}";
}
echo "</style>";
?>
</head>
<body>
<div id="container">
<div id="banner">
<ul id="status">
<?
if ($access==100)
{echo "<li><a href='configurations.php'><u>Configurations</u></a></li>";}
?>
<li><u>Help</u></li>
<li><u>FAQs</u></li>
<li><a href='login.php?action=logout'><u>logout</u></a></li>
<?
$name = $_SESSION['fullname'];
echo "<li><a href='userSettings.php'>Welcome <b><u>".$name."</u></b></a></li>";
?>
</ul>
</div>
<div id="menu">
<div id="searchBox">
<form method='get' action='results.php'>
<input name='keyword' id="searchText" type="text"/>
<input name='search' id="searchButton" type="submit" value="Search" icon="search"/>
</form>
</div>
<?
$allTabs = array("index.php"=>"Home",
"services.php"=>"Services",
"devices.php"=>"Devices",
"location.php"=>"Locations",
"contacts.php"=>"Contacts",
"statistics.php"=>"Statistics",
"monitor.php"=>"Events",
"plugins.php"=>"Plugins"
);
//After knowing their active status, put them on
echo "<div id='controlBar'>";
foreach ($allTabs as $link => $tName)
{
echo "<ul>";
echo "<a href='".$link."'>";
if(preg_match("/".$link."/", $_SERVER['REQUEST_URI']))
{echo "<li id='active'>";}
else
{echo "<li>";}
echo "<font class='topMenu' icon='".strtolower($tName)."'>".$tName."</font>";
$name = checkPlugin(strtolower($tName));
if (!empty($name))
{
echo "<ul>";
foreach ($name as $id => $value)
{
$curPlugin = new Plugins($id);
$className = $curPlugin->get_class_name();
echo "<a href='pluginTemplate.php?tab=".$link."&pluginID=".$id."&className=".$className."'><li class='topMenuItem'><font class='subTopMenu' icon='plugIcon".$id."'>".$value."</font></li></a>";
}
echo "</ul>";
}
echo "</li></a>
</ul>";
}
echo "</div>";
?>
</div>
<?
function checkPlugin($location)
{
$allPlugins = Plugins::get_plugins();
$location = strtolower($location);
$pluginNames = array();
$pluginHeadings = array("All Plugins");
foreach ($allPlugins as $id => $value)
{
$curPlugin = new Plugins($id);
$plugLocation = strtolower($curPlugin->get_location());
if($plugLocation == $location && $curPlugin->get_enabled() == true)
{
$pluginNames[$id] = $curPlugin->get_name();
}
}
return $pluginNames;
}
?>