aboutsummaryrefslogtreecommitdiff
path: root/lib/models/Courseware/BlockTypes/IFrame.php
blob: f697e742fbf9847b23d9d6563592fd32a89c1b9f (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
<?php

namespace Courseware\BlockTypes;

/**
 * This class represents the content of a Courseware iFrame block.
 *
 * @author  Ron Lucke <lucke@elan-ev.de>
 * @license GPL2 or any later version
 *
 * @since   Stud.IP 5.0
 */
class IFrame extends BlockType
{
    public static function getType(): string
    {
        return 'iframe';
    }

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

    public static function getDescription(): string
    {
        return _('Einbetten von einer Website oder Datei.');
    }

    public function initialPayload(): array
    {
        return [
            'url' => 'https://studip.de',
            'title' => 'Stud.IP',
            'height' => '400',
            'submit_user_id' => 'false',
            'submit_param' => 'uid',
            'salt' => md5(uniqid('', true)),
            'cc_info' => 'false',
            'cc_work' => '',
            'cc_author' => '',
            'cc_base' => '',
        ];
    }

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

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

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

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

    public static function getTags(): array
    {
        return [
            _('Webseite'), _('einbinden'), _('extern'), _('klickbar'), _('Rahmen'),
            _('Datei'), _('einbetten'), _('Seite auf der Seite'), _('Multimedia'),
            _('Navigation'), _('Material'), _('Reader'), _('online lesen'), _('Infomaterial'),
            _('Homepage'), _('Evaluation'), _('Survey')
        ];
    }
}