date('Y-m-d')]); if (!$GLOBALS['perm']->have_perm('admin') && Config::get()->SCHEDULE_ENABLE) { $title = _('Stundenplan'); $main_url = URLHelper::getURL('dispatch.php/calendar/schedule'); } 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() { global $perm, $atime; parent::initSubNavigation(); if (!$perm->have_perm('admin') && Config::get()->SCHEDULE_ENABLE) { $navigation = new Navigation(_('Stundenplan'), 'dispatch.php/calendar/schedule'); $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); } } }