aboutsummaryrefslogtreecommitdiff
path: root/app/views/start/index.php
blob: 7d6cb1af8fbb54101e9bd726182b5a7d736efdec (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
<?php
/**
 * @var array $columns
 * @var Flexi\Template $widget_layout
 * @var MessageBox[] $messages
 */
?>
<h1 class="sr-only">
    <? if ($GLOBALS['perm']->have_perm('root')) :?>
        <?= _("Startseite für Root bei Stud.IP")?>
    <? elseif ($GLOBALS['perm']->have_perm('admin')) : ?>
        <?= _("Startseite für Admins")?>
    <? elseif ($GLOBALS['perm']->have_perm('dozent')) :?>
        <?= _("Startseite für Lehrende")?>
    <? else : ?>
        <?= _("Ihre persönliche Startseite")?>
    <? endif ?>
</h1>

<?= implode('', $messages) ?>

<?php
// display a random banner if the module is enabled
if (Config::get()->BANNER_ADS_ENABLE) {
    echo Banner::getRandomBanner()->toHTML();
}
?>

<div class="start-widgetcontainer">
    <? foreach ($columns as $column): ?>
        <ul class="portal-widget-list">
            <? foreach ($column as $widget): ?>
                <li class="studip-widget-wrapper" id="<?= $widget->getPluginId() ?>">
                    <div class="ui-widget-content studip-widget">
                        <? if ($template = $widget->getPortalTemplate()): ?>
                            <? $widget_layout->clear_attributes() ?>
                            <? $template->set_layout($widget_layout) ?>
                            <?= $this->render_partial($template, compact('widget')) ?>
                        <? else: ?>
                            <?= $this->render_partial('start/_widget', compact('widget')) ?>
                        <? endif ?>
                    </div>
                </li>
            <? endforeach ?>
        </ul>
    <? endforeach ?>
</div>