aboutsummaryrefslogtreecommitdiff
path: root/app/views/profile_modules/index.php
blob: 17477d2db924583f7d6dacb27477e907a1b7cb10 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
 * @var ProfileModulesController $controller
 * @var string $username
 * @var array $list
 * @var array $config
 */
?>
<form action="<?= $controller->url_for('profilemodules/update', compact('username')) ?>" method="post" class="default plus">
    <?= CSRFProtection::tokenTag() ?>

<? foreach ($list as $category => $pluginlist): ?>
    <article class="studip">
        <header>
            <h1><?= htmlReady($category) ?></h1>
        </header>
    <? foreach ($pluginlist as $id => $item): ?>
        <section>
            <div class="plus_basic">

                <div class="element_header">
                    <input type="hidden" name="modules[<?= htmlReady($id) ?>]" value="0">
                    <label>
                        <input type="checkbox" value="1"
                               name="modules[<?= htmlReady($id) ?>]"
                               onclick="jQuery(this).closest('form').submit()"
                               <? if ($item['activated']) echo 'checked'; ?>>

                        <strong><?= htmlReady($item['name']) ?></strong>
                    </label>
                </div>

                <div class="element_description">
                <? if ($item['icon']): ?>
                    <?= $item['icon']->asImg(['class' => 'plugin_icon text-bottom']) ?>
                <? endif ?>

                    <strong class="shortdesc">
                        <?= htmlReady($item['abstract']) ?>
                    </strong>
                </div>
            </div>

        <? if ($config['view'] === 'openall'): ?>
            <div class="plus_expert">
                <div class="screenshot_holder">
                <? if ($item['screenshots']): ?>
                    <a href="<?= htmlReady($item['screenshots'][0]['source']) ?>"
                       data-lightbox="<?= htmlReady($item['name']) ?>"
                       data-title="<?= htmlReady($item['screenshots'][0]['title']) ?>">
                        <img class="big_thumb" src="<?= htmlReady($item['screenshots'][0]['source']) ?>"
                             alt="<?= htmlReady($item['name']) ?>">
                    </a>

                    <? if (count($item['screenshots']) > 1): ?>
                        <div class="thumb_holder">
                        <? foreach (array_slice($item['screenshots'], 1) as $shot): ?>
                            <a href="<?= htmlReady($shot['source']) ?>"
                               data-lightbox="<?= htmlReady($item['name']) ?>"
                               data-title="<?= htmlReady($shot['title']) ?>">
                                <img class="small_thumb"
                                     src="<?= htmlReady($shot['source']) ?>"
                                     alt="<?= htmlReady($item['name']) ?>">
                            </a>

                        <? endforeach; ?>
                        </div>
                    <? endif; ?>
                <? endif ?>
                </div>

                <div class="descriptionbox">
                <? if ($item['keywords']): ?>
                    <ul class="keywords">
                    <? foreach ($item['keywords'] as $keyword): ?>
                        <li><?= htmlReady($keyword) ?></li>
                    <? endforeach; ?>
                    </ul>
                <? endif; ?>

                    <p class="longdesc">
                        <?= htmlReady($item['description']) ?: _('Keine Beschreibung vorhanden.') ?>
                    </p>

                <? if ($item['homepage']): ?>
                    <p>
                        <strong><?= _('Weitere Informationen:') ?></strong>
                        <a href="<?= htmlReady($item['homepage']) ?>">
                            <?= htmlReady($item['homepage']) ?>
                        </a>
                    </p>
                <? endif; ?>

                <? if ($item['helplink']): ?>
                    <a class="helplink" href="<?= htmlReady($item['helplink']) ?> ">
                        <?= _('...mehr') ?>
                    </a>
                <? endif; ?>
                </div>
            </div>
        <? endif; ?>
        </section>
    <? endforeach; ?>
    </article>
<? endforeach; ?>

    <footer class="hidden-js">
        <?= Studip\Button::create(_('An- / Ausschalten'), 'uebernehmen') ?>
    </footer>
</form>