aboutsummaryrefslogtreecommitdiff
path: root/lib/modules/MyStudygroupsWidget.php
diff options
context:
space:
mode:
authorRasmus Fuhse <fuhse@data-quest.de>2025-01-10 12:13:24 +0000
committerRasmus Fuhse <fuhse@data-quest.de>2025-01-10 12:13:24 +0000
commit39745c9aa8bb099e8bda1f4d775ed229dbe97be4 (patch)
treea2a96deecf48e62d995507c5c8b39eea9ae9293d /lib/modules/MyStudygroupsWidget.php
parent03e8e1d8f9100cf9bfcb111b63ac4077f510a026 (diff)
Resolve "Studiengruppen erweitern" - Hauptbronch
Closes #3616 Merge request studip/studip!2509
Diffstat (limited to 'lib/modules/MyStudygroupsWidget.php')
-rw-r--r--lib/modules/MyStudygroupsWidget.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/modules/MyStudygroupsWidget.php b/lib/modules/MyStudygroupsWidget.php
new file mode 100644
index 0000000..1709419
--- /dev/null
+++ b/lib/modules/MyStudygroupsWidget.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * My Study group widget. Displays a list of own study groups
+ *
+ * @author
+ * @license GPL2 or any later version
+ * @since Stud.IP 6.0
+ */
+class MyStudygroupsWidget extends CorePlugin implements PortalPlugin
+{
+ public function getPluginName()
+ {
+ return _('Meine Studiengruppen');
+ }
+
+ public function getMetadata()
+ {
+ return [
+ 'description' => _('Dieses Widget zeigt eine Liste Ihrer Studiengruppen an.')
+ ];
+ }
+
+ public function getPortalTemplate()
+ {
+ $template = $GLOBALS['template_factory']->open('start/my_studygroups');
+
+ $controller = app(\Trails\Dispatcher::class)->load_controller('my_studygroups');
+ $response = $controller->relayWithRedirect('my_studygroups/index/true');
+ $template->content = $response->body;
+
+ $navigation = new Navigation('', 'dispatch.php/course/wizard?studygroup=1');
+ $navigation->setImage(Icon::create('add', Icon::ROLE_CLICKABLE, ['title' => _('Neue Studiengruppe anlegen')]));
+ $navigation->setLinkAttributes(['data-dialog' => 'reload-on-close']);
+ $template->icons = [$navigation];
+
+ return $template;
+ }
+}