-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathnavigation.php
68 lines (64 loc) · 3.25 KB
/
navigation.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
<nav id="navbar1" class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid" style="display: flex;justify-content: center;">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">Raisepon</a>
</div>
<?php if (isset($user_class) && $user_class >= "1") { ?>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li <?=echoActiveClassIfRequestMatches("index")?>><a href="index.php">Home</a></li>
<?php if ($user_class >= "6") { ?>
<li <?=echoActiveClassIfRequestMatches("customers")?>><a href="customers.php">Customers</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="xpon" role="button" aria-haspopup="true" aria-expanded="false">xPON<span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header">xPON</li>
<li role="separator" class="divider"></li>
<li <?=echoActiveClassIfRequestMatches("olt")?>><a href="olt.php">OLT</a></li>
<li <?=echoActiveClassIfRequestMatches("pon")?>><a href="pon.php">PON</a></li>
<li <?=echoActiveClassIfRequestMatches("ip_pool")?>><a href="ip_pool.php">IP Pools</a></li>
<li <?=echoActiveClassIfRequestMatches("backup")?>><a href="backup.php">Backup</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="profiles" role="button" aria-haspopup="true" aria-expanded="false">Profiles <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Profiles</li>
<li role="separator" class="divider"></li>
<li <?=echoActiveClassIfRequestMatches("line_profile")?>><a href="line_profile.php">Line Profiles</a></li>
<li <?=echoActiveClassIfRequestMatches("service_profile")?>><a href="service_profile.php">Service Profiles</a></li>
<li <?=echoActiveClassIfRequestMatches("services")?>><a href="services.php">Services</a></li>
</ul>
</li>
<?php } ?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="tools" role="button" aria-haspopup="true" aria-expanded="false">Tools <span class="caret"></span></a>
<ul class="dropdown-menu">
<li <?=echoActiveClassIfRequestMatches("graphs")?>><a href="graphs.php">Graphs</a></li>
<li <?=echoActiveClassIfRequestMatches("logs")?>><a href="logs.php">Logs</a></li>
<li <?=echoActiveClassIfRequestMatches("mac_trace")?>><a href="mac_trace.php">Trace</a></li>
</ul>
</li>
<?php if ($user_class == "9") { ?>
<li><a href="accounts.php">Accounts</a></li>
<?php } ?>
</ul>
<a class="navbar-btn btn btn-default" href="logout.php">Logout</a>
</div><!--/.nav-collapse -->
<?php } ?>
</div>
</nav>
<?php
function echoActiveClassIfRequestMatches($requestUri)
{
$current_file_name = basename($_SERVER['PHP_SELF'], ".php");
if ($current_file_name == $requestUri)
echo 'class="active"';
}
?>