-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopbar.php
76 lines (52 loc) · 1.48 KB
/
topbar.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
<?php
function generate_topbar() {
echo <<<TOPBAR
<div class="topbar">
<topitem class="header"><img src="
TOPBAR;
echo logo;
echo <<<TOPBAR
" style="height: 24px; vertical-align: baseline;">
TOPBAR;
echo title;
echo <<<TOPBAR
</topitem>
<topitem class="label"><span>
TOPBAR;
echo subtitle;
echo <<<TOPBAR
</span></topitem>
TOPBAR;
echo new_topbar_link("Work", "/images/fa/edit.svg", "/main.php");
echo new_topbar_link("Conferences", "/images/fa/video.svg", "/conferences.php");
echo <<<TOPBAR
<topitem class="user-dropdown">
<form method="post" action="set_user.php">
<input type="hidden" name="origin" value="
TOPBAR;
echo $_SERVER['PHP_SELF'];
echo <<<TOPBAR
">
<div><img src="/images/fa/user-circle.svg" style="height: 24px; vertical-align: middle;">
<select name="user" title="Select user" onchange="this.form.submit()">
<option value="all"> Students </option>
TOPBAR;
echo build_userdropdown(); // this function must be included from userlist_build.php
echo <<<TOPBAR
</select></div>
<noscript> <input type="submit" value="✓" title="Submit"> </noscript>
</form>
</topitem>
</div>
TOPBAR;
}
function new_topbar_link($title, $img, $href) {
if ($_SESSION['origin'] == $href) {
$current_class = " current";
}
else {
$current_class = "";
}
echo '<topitem class="page'.$current_class.'"><a href="'.$href.'"> <img src="'.$img.'"> <span> '.$title.' </span> </a></topitem>';
}
?>