Skip to content
Snippets Groups Projects
Select Git revision
  • e3e7e1af2d31c2a4cfba63fb2e70f3a87cdaa467
  • main default protected
  • step-3263
  • feature/plugins-cli
  • feature/vite
  • step-2484-peerreview
  • biest/issue-5051
  • tests/simplify-jsonapi-tests
  • fix/typo-in-1a70031
  • feature/broadcasting
  • database-seeders-and-factories
  • feature/peer-review-2
  • feature-feedback-jsonapi
  • feature/peerreview
  • feature/balloon-plus
  • feature/stock-images-unsplash
  • tic-2588
  • 5.0
  • 5.2
  • biest/unlock-blocks
  • biest-1514
21 results

avatar.js

Blame
  • 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);
            }
        }
    }