-
Notifications
You must be signed in to change notification settings - Fork 0
/
nav_bar.php
55 lines (45 loc) · 2.04 KB
/
nav_bar.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
<?php
require "includes/helper.php";
function print_nav_list(){
echo '<a class="mdl-navigation__link mdl-js-ripple-effect" href="'.getRoot().'result.php">賽果</a>';
if(!isLogin()){
echo '<a class="mdl-navigation__link mdl-js-ripple-effect" href="'.getRoot().'login">登入</a>';
}
else{
if(isThirdAuth()){
echo '
<a class="mdl-navigation__link mdl-js-ripple-effect" href="'.getRoot().'vote">評分</a>
<a class="mdl-navigation__link mdl-js-ripple-effect" href="'.getRoot().'submit">投稿</a>
<a class="mdl-navigation__link mdl-js-ripple-effect" href="'.getRoot().'profile">個人檔案</a>';
if(isAdmin()){
echo '
<a class="mdl-navigation__link mdl-js-ripple-effect" href="'.getRoot().'publish">公開</a>
<a class="mdl-navigation__link mdl-js-ripple-effect" href="'.getRoot().'control_panel.php">控制台</a>
';
}
}
else{
echo '<a class="mdl-navigation__link mdl-js-ripple-effect" href="'.getRoot().'login/auth.php">驗証</a>';
}
echo '<a class="mdl-navigation__link mdl-js-ripple-effect" href="'.getRoot().'logout.php">登出</a>';
}
}
?>
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.teal-red.min.css">
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<header class="mdl-layout__header mdl-shadow--8dp">
<div class="mdl-layout__header-row">
<a class="mdl-layout-title mdl-navigation__link" href="<?php echo getRoot();?>index.php">300容量挑戰賽</a>
<div class="mdl-layout-spacer"></div>
<div class="mdl-navigation mdl-layout--large-screen-only">
<?php print_nav_list()?>
</div>
</div>
</header>
<div class="mdl-layout__drawer mdl-layout--small-screen-only">
<span class="mdl-layout-title">300容量挑戰賽</span>
<div class="mdl-navigation">
<?php print_nav_list()?>
</div>
</div>