aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/short_urls.php
blob: e9fa843fd13445303a7255b6351b42605276207d (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
<?php

use Studip\Forms\Form;

class ShortUrlsController extends AuthenticatedController
{
    public function before_filter(&$action, &$args)
    {
        parent::before_filter($action, $args);
        $this->current_user = User::findCurrent();
    }

    public function index_action(): void
    {
        PageLayout::setTitle(_('Meine Kurzlinks'));
        Navigation::activateItem('/contents/short_urls/overview');

        $this->render_vue_app(
            Studip\VueApp::create('short-urls/ShortUrlList')
                ->withStore('shortUrlsStore', 'useShortUrlsStore')
        );
    }

    public function create_action(): void
    {
        PageLayout::setTitle(_('Link zur aktuellen Seite erstellen'));

        $this->render_vue_app(
            Studip\VueApp::create('short-urls/ShortUrlLink')
                ->withProps(['isInContext' => Context::isCourse() && Context::get()->hasCourseSet()])
        );
    }
}