* @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 = [0, 1, 2, 3, 4] ); $template = $GLOBALS['template_factory']->open('shared/string'); $template->content = CalendarWidgetView::createFromWeekView($view)->render(); return $template; } }