blob: badb47953aabaee1fc83b19d2c323d21022da9e8 (
plain)
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
|
<?php
# Lifter010: TODO
/*
* CalendarNavigation.php - navigation for calendar
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* @author Elmar Ludwig
* @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
* @category Stud.IP
*/
class CalendarNavigation extends Navigation
{
/**
* Initialize a new Navigation instance.
*/
public function __construct()
{
global $perm;
parent::__construct(_('Planer'));
if (!$perm->have_perm('admin') && Config::get()->SCHEDULE_ENABLE) {
$planerinfo = _('Stundenplan');
} else {
$planerinfo = _('Termine');
}
$this->setImage(Icon::create('schedule', 'navigation', ["title" => $planerinfo]));
}
/**
* Initialize the subnavigation of this item. This method
* is called once before the first item is added or removed.
*/
public function initSubNavigation()
{
global $perm, $atime;
parent::initSubNavigation();
// schedule
if (!$perm->have_perm('admin') && Config::get()->SCHEDULE_ENABLE) {
$navigation = new Navigation(_('Stundenplan'), 'dispatch.php/calendar/schedule');
$this->addSubNavigation('schedule', $navigation);
}
// calendar
$atime = $atime ? intval($atime) : Request::int($atime);
if (Config::get()->CALENDAR_ENABLE) {
$navigation = new Navigation(_('Terminkalender'), 'dispatch.php/calendar/single', ['self' => 1]);
$this->addSubNavigation('calendar', $navigation);
}
}
}
|