aboutsummaryrefslogtreecommitdiff
path: root/app/routes/Studip.php
blob: 749a53adc495ccdd8370c68fdd0509ee441d60cb (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
namespace RESTAPI\Routes;

use Config;
use SemClass;
use SemType;

/**
 * @author     Jan-Hendrik Willms <tleilax+studip@gmail.com>
 * @author     <mlunzena@uos.de>
 * @license    GPL 2 or later
 * @deprecated Since Stud.IP 5.0. Will be removed in Stud.IP 6.0.
 */
class Studip extends \RESTAPI\RouteMap
{
    /**
     * Grundlegende Systemeinstellungen
     *
     * @get /studip/settings
     */
    public function getSettings()
    {
        $sem_types = array_map(function ($item) {
            return [
                'name'  => $item['name'],
                'class' => $item['class'],
            ];
        }, SemType::getTypes());

        $sem_classes = array_map(function ($item) {
            $item = (array) $item;
            return reset($item);
        }, SemClass::getClasses());

        return [
            'ALLOW_CHANGE_USERNAME' => Config::get()->ALLOW_CHANGE_USERNAME,
            'ALLOW_CHANGE_EMAIL'    => Config::get()->ALLOW_CHANGE_EMAIL,
            'ALLOW_CHANGE_NAME'     => Config::get()->ALLOW_CHANGE_NAME,
            'ALLOW_CHANGE_TITLE'    => Config::get()->ALLOW_CHANGE_TITLE,
            'INST_TYPE'             => $GLOBALS['INST_TYPE'],
            'SEM_TYPE'              => $sem_types,
            'SEM_CLASS'             => $sem_classes,
            'TERMIN_TYP'            => $GLOBALS['TERMIN_TYP'],
            'PERS_TERMIN_KAT'       => $GLOBALS['PERS_TERMIN_KAT'],
            'SUPPORT_EMAIL'         => $GLOBALS['UNI_CONTACT'],
            'TITLES'                => $GLOBALS['DEFAULT_TITLE_FOR_STATUS'],
            'UNI_NAME_CLEAN'        => Config::get()->UNI_NAME_CLEAN,
        ];
    }

    /**
     * Farbeinstellungen
     *
     * @get /studip/colors
     */
    public function getColors()
    {
        // TODO: Move these definitions somewhere else (but where!?)
        return [
            'background' => '#e1e4e9',
            'dark'       => '#34578c',
            'light'      => '#899ab9',
        ];
    }
}