icingaweb2/application/layouts/scripts/body.phtml

69 lines
2.0 KiB
PHTML
Raw Normal View History

<?php
use Icinga\Web\Url;
use Icinga\Web\Notification;
use Icinga\Authentication\Auth;
$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">
2016-11-29 15:12:33 +01:00
<div id="announcements" class="container">
<?= $this->widget('announcements') ?>
</div>
<div id="header-logo-container">
<?= $this->qlink(
'',
Auth::getInstance()->isAuthenticated() ? 'dashboard' : '',
null,
array(
'aria-hidden' => 'true',
'data-base-target' => '_main',
2016-01-18 11:37:11 +01:00
'id' => 'header-logo'
)
); ?>
</div>
</div>
<?php if (! $this->layout()->isIframe): ?>
<div id="sidebar">
<?= $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; ?> style="display: block">
<?= $this->render($inlineLayoutScript) ?>
</div>
2014-02-18 19:06:27 +01:00
<div id="col2" class="container">
</div>
2014-02-18 19:06:27 +01:00
<div id="col3" class="container">
</div>
</div>
<div id="footer">
2016-01-22 13:35:51 +01:00
<ul role="alert" id="notifications"><?php
$notifications = Notification::getInstance();
if ($notifications->hasMessages()) {
foreach ($notifications->popMessages() as $m) {
echo '<li class="' . $m->type . '">' . $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>