-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhub.php
34 lines (27 loc) · 921 Bytes
/
hub.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
<?php
$meta = array();
$meta['blog'] = 'Blog';
$meta['404'] = 'Erreur 404';
$meta['profil'] = 'Consultant Web - Développeur PHP';
$meta['competences'] = 'Compétences';
$meta['realisations'] = 'Réalisations';
$meta['timeline'] = 'Timeline';
$meta['contact'] = 'Contact';
$page['blog'] = 'blog';
$page['404'] = 'errors/404';
$page['profil'] = 'profile';
$page['competences'] = 'skills';
$page['realisations'] = 'projects';
$page['timeline'] = 'timeline';
$page['contact'] = 'contact';
$menu = (!isset($_GET['p'])) ? 'profil' : $_GET['p'];
if (!array_key_exists($menu, $meta)) header("location:http://$_SERVER[HTTP_HOST]");
define('CURRENT_MENU', $menu);
define('CURRENT_META', $meta[$menu]);
define('CURRENT_PAGE', $page[$menu]);
function isMenuActive($_menu) {
return (CURRENT_MENU == $_menu) ? ' class="active" ' : '';
}
function isNavActive($_menu) {
return (CURRENT_MENU == $_menu) ? ' selected="" ' : '';
}