aboutsummaryrefslogtreecommitdiff
path: root/lib/models/Courseware/BlockTypes/BiographyAchievements.php
blob: 2f8aeb7a0003ba1134ff6e4c0a1c6e18ea5d27f2 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php

namespace Courseware\BlockTypes;

/**
 * This class represents the content of a Courseware biography achievements block.
 *
 * @author  Robin Winkler <rwinkler@uos.de>
 * @author  Ron Lucke <lucke@elan-ev.de>
 * @license GPL2 or any later version
 *
 * @since   Stud.IP 5.2
 */
class BiographyAchievements extends BlockType
{
    public static function getType(): string
    {
        return 'biography-achievements';
    }

    public static function getTitle(): string
    {
        return _('Erfolge');
    }

    public static function getDescription(): string
    {
        return _('Zeigt verschiedene Arten von erreichten Erfolgen an.');
    }

    public function initialPayload(): array
    {
        return [
            'type' => 'certificate',
            'title' => '',
            'date' => time() * 1000,
            'end_date' => time() * 1000,
            'role' => '',
            'description' => ''
        ];
    }

    public function getPayload()
    {
        $payload = parent::getPayload();
        $payload['description'] = \Studip\Markup::purifyHtml(\Studip\Markup::markAsHtml($payload['description']));

        return $payload;
    }

    public function setPayload($payload): void
    {
        $payload['description'] = \Studip\Markup::purifyHtml(\Studip\Markup::markAsHtml($payload['description']));

        parent::setPayload($payload);
    }

    public static function getJsonSchema(): string
    {
        $schemaFile = __DIR__.'/BiographyAchievements.json';
        return file_get_contents($schemaFile);
    }

    public static function getCategories(): array
    {
        return ['biography'];
    }

    public static function getContentTypes(): array
    {
        return ['text'];
    }

    public static function getFileTypes(): array
    {
        return [];
    }

    public static function getTags(): array
    {
        return [
            _('Portfolio'), _('Lebenslauf'), _('Zertifikat'), _('Bewerbung'), _('Karriere'), _('Job'),
            _('Beruf'), _('Achievement'), _('Badges'), _('Auszeichnung'), _('Ergebnis'), _('Sammelmappe'),
            _('Akkreditierung'), _('Buch'), _('Veröffentlichung'), _('Mitgliedschaft'), _('Abzeichen')
        ];
    }
}