summaryrefslogtreecommitdiffstats
path: root/application/layouts/scripts/body.phtml
blob: 87b570bfe561feaad6e50b67e3a3c3c76c57848b (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
<?php

use Icinga\Web\Url;
use Icinga\Web\Notification;
use Icinga\Authentication\Auth;
use ipl\Html\HtmlString;
use ipl\Web\Widget\Icon;

$moduleName = $this->layout()->moduleName;
if ($moduleName !== 'default') {
    $moduleClass = ' icinga-module module-' . $moduleName;
} else {
    $moduleClass = '';
}

$refresh = '';
if ($this->layout()->autorefreshInterval) {
    $refresh = ' data-icinga-refresh="' . $this->layout()->autorefreshInterval . '"';
}

if ($this->layout()->inlineLayout) {
    $inlineLayoutScript = $this->layout()->inlineLayout . '.phtml';
} else {
    $inlineLayoutScript = 'inline.phtml';
}

?>
<div id="header">
    <div id="announcements" class="container">
        <?= $this->widget('announcements') ?>
    </div>
</div>
<div id="content-wrapper">
<?php if (! $this->layout()->isIframe): ?>
    <div id="sidebar">
        <div id="header-logo-container">
            <?= $this->qlink(
                '',
                Auth::getInstance()->isAuthenticated() ? 'dashboard' : '',
                null,
                array(
                    'aria-hidden'       => 'true',
                    'data-base-target'  => '_main',
                    'id'                => 'header-logo'
                )
            ); ?>
            <div id="mobile-menu-toggle">
                <button type="button"><?= $this->icon('menu') ?><?= $this->icon('cancel') ?></button>
            </div>
        </div>
        <?= $this->render('parts/navigation.phtml'); ?>
    </div>
<?php endif ?>
    <div id="main" role="main">
        <div id="col1"
            class="container<?= $moduleClass ?>"
        <?php if ($moduleName): ?>
            data-icinga-module="<?= $moduleName ?>"
        <?php endif ?>
            data-icinga-url="<?= $this->escape(Url::fromRequest()->without('renderLayout')->getAbsoluteUrl()); ?>"
            <?= $refresh; ?>
        >
            <?= $this->render($inlineLayoutScript) ?>
      </div>
      <div id="col2" class="container"></div>
      <div id="col3" class="container"></div>
    </div>
</div>
<div id="footer">
  <ul role="alert" id="notifications"><?php

    $notifications = Notification::getInstance();
    if ($notifications->hasMessages()) {
        foreach ($notifications->popMessages() as $m) {
            switch ($m->type) {
                case 'success':
                    $icon = new HtmlString(new Icon('check-circle'));
                    break;
                case 'error':
                    $icon = new HtmlString(new Icon('times'));
                    break;
                case 'warning':
                    $icon = new HtmlString(new Icon('exclamation-triangle'));
                    break;
                case 'info':
                    $icon = new HtmlString(new Icon('info-circle'));
                    break;
                default:
                    $icon = '';
                    break;
            }

            echo '<li class="' . $m->type . '">' . $icon . $this->escape($m->message) . '</li>';
        }
    }
  ?></ul>
  <div id="application-state-summary" class="container" data-icinga-url="<?= $this->url('application-state/summary') ?>" data-last-update="-1" data-icinga-refresh="60"></div>
</div>