-
Notifications
You must be signed in to change notification settings - Fork 5
/
nav.php
executable file
·49 lines (44 loc) · 1.79 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
<?php
$OUTPUT->bodyStart();
$R = $CFG->apphome . '/';
$T = $CFG->wwwroot . '/';
$adminmenu = isset($_COOKIE['adminmenu']) && $_COOKIE['adminmenu'] == "true";
$set = new \Tsugi\UI\MenuSet();
// $set->setHome('<img style="top: -5px; width:4em; padding: 4px; border-radius: 4px; background-color:white;" src="'. $CFG->staticroot . '/img/logos/tsugi-logo.png' .'">', $CFG->apphome."#index");
$set->setHome('TSUGI', $CFG->apphome."#index");
$set->addLeft('Documentation', $R .'#docs');
if ( isset($CFG->lessons) ) {
$set->addLeft('Tutorials', $R.'lessons');
}
$set->addLeft('GitHub', $R.'docs/repos');
$set->addLeft('Discuss', 'https://developers.tsugi.org');
if ( isset($_SESSION['id']) ) {
$submenu = new \Tsugi\UI\Menu();
$submenu->addLink('Profile', $R.'profile');
if ( isset($CFG->google_map_api_key) && $adminmenu ) {
$submenu->addLink('Map', $R.'map');
}
if ( isset($_SESSION['id']) ) {
$submenu->addLink('Assignments', $R.'assignments');
}
$submenu->addLink('Tsugi App Store', 'https://www.tsugicloud.org');
if ( $CFG->providekeys ) {
$submenu->addLink('Use this Service', $T . 'settings');
}
if ( isset($_COOKIE['adminmenu']) && $_COOKIE['adminmenu'] == "true" ) {
$submenu->addLink('Administer', $T . 'admin/');
}
$submenu->addLink('Logout', $R.'logout');
if ( isset($_SESSION['avatar']) ) {
$set->addRight('<img src="'.$_SESSION['avatar'].'" title="'.htmlentities(__('User Profile Menu - Includes logout')).'" style="height: 2em;"/>', $submenu);
} else {
$set->addRight(htmlentities($_SESSION['displayname']), $submenu);
}
} else {
$set->addRight('Login', $R.'login');
}
$set->addRight('About', $R.'#about');
// Set the topNav for the session
$OUTPUT->topNavSession($set);
$OUTPUT->topNav();
$OUTPUT->flashMessages();