forked from mrsthl/TicSys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
88 lines (78 loc) · 2.09 KB
/
index.php
File metadata and controls
88 lines (78 loc) · 2.09 KB
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
<!DOCTYPE html>
<?php
include_once 'config/config.php';
?>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="There's a lot to do.">
<meta name="author" content="Mauro">
<link rel="stylesheet" href="/style.css">
<title>Hello World</title>
</head>
<body>
<a href="<?php echo URI_KONTAKT ?>"><img id="feedbackimg" src="/images/feedback.png"></a>
<div id="wrapper">
<header>
<img src="/images/logo-black.png">
</header>
<nav>
<ul class="navUl">
<?php
$navigation = getMenu();
foreach ($navigation as $href => $title) {
$liContent = $title;
if ($href != strtolower($_SERVER['REQUEST_URI'])) {
$liContent = "<a href=\"$href\">$title</a>";
}
echo "<li class=\"navLi\">$liContent</li>\n";
}
?>
</ul>
</nav>
<div id="content" class="content">
<?php
switch (getSelectedMenuPoint()){
case URI_EVENTS:
include_once 'controller/eventscontroller.php';
break;
case URI_KONTAKT:
include_once 'controller/contactcontroller.php';
break;
}
?>
</div>
<footer>
<p>Copyright © 2012 -
<?php echo date('Y') ?> TicSys</p>
</footer>
</div>
</body>
<?php
function getMenu(){
$navigation = array(
URI_HOME => 'Home',
URI_EVENTS => 'Events',
URI_FAQ => 'FAQ',
URI_KONTAKT => 'Kontakt'
);
return $navigation;
}
/**
* returns the current 1th Folder.
*
* @author Mauro Stehle
*
* @since 1.0
*
*
*/
function getSelectedMenuPoint(){
$url_array = parse_url($_SERVER['REQUEST_URI']);
preg_match('@/(?<path>[^/]+)@', $url_array['path'], $m);
$url_folder = $m['path'];
return "/" . $url_folder;
}
?>
</html>