aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/admin/lti.php
blob: 25ea3febe9caac15d398566403f6e0d2207de7a7 (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
43
44
45
46
47
48
49
50
<?php
/**
 * admin/lti.php - LTI consumer API for Stud.IP
 *
 * 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.
 *
 * @author      Elmar Ludwig
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
 */

class Admin_LtiController extends AuthenticatedController
{
    /**
     * Callback function being called before an action is executed.
     */
    public function before_filter(&$action, &$args)
    {
        parent::before_filter($action, $args);

        $GLOBALS['perm']->check('root');

        Navigation::activateItem('/admin/config/lti');
        PageLayout::setTitle(_('LTI-Tools'));

        $widget = Sidebar::get()->addWidget(new ActionsWidget());
        $widget->addLink(
            _('Neues LTI-Tool registrieren'),
            $this->url_for('lti/tool/add/global'),
            Icon::create('add')
        )->asDialog();
        $widget->addLink(
            _('Daten zur LTI-Plattform anzeigen'),
            $this->url_for('lti/auth/platform_data'),
            Icon::create('info')
        )->asDialog();

        Helpbar::get()->addPlainText('', _('Hier können Sie LTI-Tools konfigurieren. Diese müssen den LTI-Standard in Version 1.0/1.1 oder 1.3A unterstützen.'));
    }

    /**
     * Display the list of registered LTI tools.
     */
    public function index_action()
    {
        $this->tools = LtiTool::findAll();
    }
}