diff options
| author | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2022-05-11 07:19:42 +0000 |
|---|---|---|
| committer | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2022-05-11 07:19:42 +0000 |
| commit | 20240b2aacb15ab3264afbfbbc9dae952db4bb63 (patch) | |
| tree | 597cae73c5ae7ab9eda6d066d45430c3f17a4560 /lib/modules/TerminWidget.php | |
| parent | c054faf90288a75fc3680480434ba93b7f5b287b (diff) | |
convert old core plugins to new model, re #814
Merge request studip/studip!440
Diffstat (limited to 'lib/modules/TerminWidget.php')
| -rw-r--r-- | lib/modules/TerminWidget.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/modules/TerminWidget.php b/lib/modules/TerminWidget.php new file mode 100644 index 0000000..c92f1d2 --- /dev/null +++ b/lib/modules/TerminWidget.php @@ -0,0 +1,43 @@ +<?php +/* + * TerminWidget.php - A portal plugin for dates + * + * Copyright (C) 2014 - André Klaßen <klassen@elan-ev.de> + * + * 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. + */ + +require_once 'app/controllers/calendar/contentbox.php'; + +class TerminWidget extends CorePlugin implements PortalPlugin +{ + public function getPluginName() + { + return _('Meine aktuellen Termine'); + } + + public function getMetadata() + { + return [ + 'description' => _('Mit diesem Widget haben Sie ihre aktuellen Termine im Überlick.') + ]; + } + + public function getPortalTemplate() + { + $dispatcher = new StudipDispatcher(); + $controller = new Calendar_ContentboxController($dispatcher); + $response = $controller->relay('calendar/contentbox/display/'.$GLOBALS['user']->id); + $template = $GLOBALS['template_factory']->open('shared/string'); + $template->content = $response->body; + + $navigation = new Navigation('', 'dispatch.php/calendar/single/week', ['self' => true]); + $navigation->setImage(Icon::create('add', 'clickable', ["title" => _('Neuen Termin anlegen')])); + $template->icons = [$navigation]; + + return $template; + } +} |
