forked from resnostyle/mediafrontpage
-
Notifications
You must be signed in to change notification settings - Fork 8
/
nav.php
executable file
·114 lines (107 loc) · 3.24 KB
/
nav.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
<?php
//Authentication check
require_once('config.php');
if ($authsecured && (!isset($_SESSION['loggedin']) || !$_SESSION['loggedin'])) {
header('Location: login.php');
exit;
}
?>
<?php
include "config.php";
echo "<html>";
echo "<head>";
echo "<title>Navigation</title>";
echo "<link rel='stylesheet' type='text/css' href='css/nav.css'>";
echo "<script type=\"text/javascript\" language=\"javascript\">";
echo 'function logout(){
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
if(xmlhttp.responseText)
{
window.top.document.location.href = "login.php";
alert("Logout successful");
}
}
}
xmlhttp.open("GET","logout.php",true);
xmlhttp.send();
}';
echo "</script>";
echo "</head>";
echo "<body>";
echo "<div id='header'>";
echo "<div id='home'>";
echo "<a href='./mediafrontpage.php' target='main'></a>";
echo "</div>";
echo "<div id='nav-menu'>";
echo "<ul>";
if(!empty($navlink)){
foreach( $navlink as $navlinklabel => $navlinkpath) {
echo "<li><a href='".$navlinkpath."' target='main'>".$navlinklabel."</a></li>";
}
}
if(!empty($navlink_blank)){
foreach( $navlink_blank as $navlinklabel => $navlinkpath) {
echo "<li><a href='".$navlinkpath."' target='_blank'>".$navlinklabel."</a></li>";
}
}
if(!empty($navselect)){
echo "<select onchange=\"top.frames['main'].location.href = this.value;\">";
echo "<option value='mediafrontpage.php' selected>MFP</option>";
foreach($navselect as $navselectlabel => $navselectpath){
echo "<option value='".$navselectpath."'>".$navselectlabel."</option>";
}
echo "</select>";
}
echo "<div id='nav-menu2' style='text-decoration: none; font-size:small; position:absolute; top:0; right:0;'>";
echo "<ul><li><a href='settings.php' target='main'><img src='./media/settings.png' height='15px;'/></a></li></ul>";
//<--START LOGOUT -->
require_once('config.php');
if ($authsecured) {
echo "<ul><li><a href='#' onclick=\"logout();\"/>Logout</a></li></ul>";
}
//<--END LOGOUT-->
echo '</div>';
echo "</ul>";
echo "</div>";
echo "</div>";
if(!empty($subnavlink)||!empty($subnavlink_blank)||!empty($subnavselect)){
echo "<div id='nav-menu2'>";
//echo "<br> ";
echo "<ul>";
if(!empty($subnavlink)){
foreach( $subnavlink as $navlinklabel => $navlinkpath) {
echo "<li><a href='".$navlinkpath."' target='main'>".$navlinklabel."</a></li>";
}
}
if(!empty($subnavlink_blank)){
foreach( $subnavlink_blank as $navlinklabel => $navlinkpath) {
echo "<li><a href='".$navlinkpath."' target='_blank'>".$navlinklabel."</a></li>";
}
}
/*
if(!empty($subnavselect)){
echo "<li><select onchange=\"top.frames['main'].location.href = this.value;\">";
echo "<option value='mediafrontpage.php' selected></option>";
foreach($subnavselect as $navselectlabel => $navselectpath){
echo "<option value='$navselectpath'>".$navselectlabel."</option>";
}
echo "</select></li>";
}
*/
echo "</ul>";
echo "</div>";
echo "</div>";
}
echo "</body>";
echo "</html>";
?>