aboutsummaryrefslogtreecommitdiff
path: root/app/views/course/contentmodules/info.php
blob: 48323c41b2edb71fc002c4506b7e434aa5ee42a6 (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
<?php
/**
 * @var StudIPPlugin $plugin
 * @var array $metadata
 */
?>
<? if ($plugin->getDescriptionMode() === 'replace_all') : ?>
    <?= formatReady($plugin->getPluginDescription()) ?>
<? else : ?>
    <div class="contentmodule_info">
        <div class="main_part">
            <div class="header">
                <div class="image">
                <? if ($metadata['icon']): ?>
                    <?= $metadata['icon']->copyWithRole(Icon::ROLE_INFO)->asImg(100) ?>
                <? endif; ?>
                </div>
                <div class="text">
                    <h1><?= htmlReady($metadata['displayname'] ?? $plugin->getPluginName()) ?></h1>
                <? if (!empty($metadata['summary'])): ?>
                    <strong>
                        <?= htmlReady($metadata['summary']) ?>
                    </strong>
                <? endif; ?>
                </div>
            </div>
            <?= Studip\VueApp::create('ContentModulesControl')->withProps([
                 'module_id' => (int) $plugin->getPluginId(),
            ]) ?>
            <? $keywords = preg_split( "/;/", $metadata['keywords'] ?? '', -1, PREG_SPLIT_NO_EMPTY) ?>
            <? if (count($keywords) > 0) : ?>
            <ul class="keywords">
                <? foreach ($keywords as $keyword) : ?>
                <li>
                    <?= htmlReady($keyword) ?>
                </li>
                <? endforeach ?>
            </ul>
            <? endif ?>
            <div class="description">
                <?= formatReady($plugin->getPluginDescription()) ?>
            </div>
        </div>
        <? if (isset($screenshots) && count($screenshots)) : ?>
        <ul class="screenshots clean">
            <? foreach ($screenshots as $screenshot) : ?>
            <li>
                <a href="<?= htmlReady($screenshot['source']) ?>"
                   data-lightbox="<?= htmlReady($metadata['displayname'] ?? $plugin->getPluginName()) ?>"
                   data-title="<?= htmlReady($screenshot['title']) ?>">
                    <img src="<?= htmlReady($screenshot['source']) ?>" alt="">
                    <?= htmlReady($screenshot['title']) ?>
                </a>
            </li>
            <? endforeach ?>
        </ul>
        <? endif ?>
    </div>
<? endif ?>