diff options
Diffstat (limited to 'lib/modules/ScheduleWidget.php')
| -rw-r--r-- | lib/modules/ScheduleWidget.php | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/lib/modules/ScheduleWidget.php b/lib/modules/ScheduleWidget.php new file mode 100644 index 0000000..339beb3 --- /dev/null +++ b/lib/modules/ScheduleWidget.php @@ -0,0 +1,54 @@ +<?php +/* + * This class displays a seminar-schedule for + * users on a seminar-based view and for admins on an institute based view + * + * 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 Till Glöggler <tgloeggl@uos.de> + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +class ScheduleWidget extends CorePlugin implements PortalPlugin +{ + /** + * Returns the name of the plugin/widget. + * + * @return String containing the name + */ + public function getPluginName() + { + return _('Mein Stundenplan'); + } + + public function getMetadata() + { + return [ + 'description' => _('Mit diesem Widget haben Sie eine Übersicht Ihres aktuellen Stundenplans.') + ]; + } + + /** + * Return the template for the widget. + * + * @return Flexi_PhpTemplate The template containing the widget contents + */ + public function getPortalTemplate() + { + $view = CalendarScheduleModel::getUserCalendarView( + $GLOBALS['user']->id, + false, + false, + $days = array(0,1,2,3,4) + ); + + $template = $GLOBALS['template_factory']->open('shared/string'); + $template->content = CalendarWidgetView::createFromWeekView($view)->render(); + + return $template; + } +} |
