aboutsummaryrefslogtreecommitdiff
path: root/lib/modules/StudygroupWidget.php
blob: 8a6db375ca4682d8a8524c03d0d1245759783e82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
 * Study group widget. Displays a list of possibly interesting study groups
 *
 * @author
 * @license GPL2 or any later version
 * @since   Stud.IP 6.0
 */

class StudygroupWidget extends CorePlugin implements PortalPlugin
{
    public function getPluginName()
    {
        return _('Für dich vorgeschlagene Studiengruppen');
    }

    public function getMetadata()
    {
        return [
            'description' => _('Dieses Widget zeigt eine Liste von Vorschlägen interessanter Studiengruppen an.')
        ];
    }

    public function getPortalTemplate()
    {
        $template = $GLOBALS['template_factory']->open('start/studygroups');
        $template->proposals = Studip\VueApp::create('StudygroupProposals');

        $navigation = new Navigation(
            _('Neue Studiengruppe anlegen'),
            URLHelper::getURL('dispatch.php/course/wizard', ['studygroup' => 1])
        );
        $navigation->setImage(Icon::create('add'));
        $navigation->setLinkAttributes([
            'data-dialog' => 'reload-on-close',
            'title'       => _('Neue Studiengruppe anlegen'),
        ]);
        $template->icons = [$navigation];

        return $template;
    }
}