Select Git revision
CalendarNavigation.php
Forked from
Stud.IP / Stud.IP
Source project has a limited visibility.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
CalendarNavigation.php 1.77 KiB
<?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()
{
$title = _('Planer');
$main_url = URLHelper::getURL('dispatch.php/calendar/calendar', ['defaultDate' => date('Y-m-d')]);
if (!$GLOBALS['perm']->have_perm('admin') && Config::get()->SCHEDULE_ENABLE) {
$main_url = URLHelper::getURL('dispatch.php/calendar/schedule/index');
}
parent::__construct($title, $main_url);
$this->setImage(Icon::create('schedule', 'navigation', ['title' => $title]));
}
/**
* Initialize the sub-navigation of this item. This method
* is called once before the first item is added or removed.
*/
public function initSubNavigation()
{
parent::initSubNavigation();
if (!$GLOBALS['perm']->have_perm('admin') && Config::get()->SCHEDULE_ENABLE) {
$navigation = new Navigation(_('Stundenplan'), 'dispatch.php/calendar/schedule/index');
$this->addSubNavigation('schedule', $navigation);
}
if (Config::get()->CALENDAR_ENABLE) {
$navigation = new Navigation(_('Kalender'), 'dispatch.php/calendar/calendar', ['defaultDate' => date('Y-m-d')]);
$this->addSubNavigation('calendar', $navigation);
}
}
}