icingaweb2/application/layouts/scripts/layout.phtml

70 lines
2.2 KiB
PHTML
Raw Normal View History

2014-02-18 19:06:27 +01:00
<?php
use Icinga\Web\JavaScript;
2014-06-20 13:14:14 +02:00
use Icinga\Util\Translator;
2014-02-18 19:06:27 +01:00
2014-04-07 14:04:23 +02:00
if (array_key_exists('_dev', $_GET)) {
$jsfile = 'js/icinga.dev.js';
$cssfile = 'css/icinga.css';
} else {
$jsfile = 'js/icinga.min.js';
$cssfile = 'css/icinga.min.css';
}
$ie8jsfile = 'js/icinga.ie8.js';
$lang = Translator::splitLocaleCode()->language;
$isIframe = $this->layout()->isIframe;
$iframeClass = $isIframe ? ' iframe' : '';
2014-04-07 14:04:23 +02:00
2014-02-18 19:06:27 +01:00
?><!DOCTYPE html>
<!--[if IE 8]>
2014-06-20 13:14:14 +02:00
<html class="no-js ie8<?= $iframeClass ?>" lang="<?= $lang ?>"> <![endif]-->
<!--[if gt IE 8]><!-->
2014-06-20 13:14:14 +02:00
<html class="no-js<?= $iframeClass ?>" lang="<?= $lang ?>"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<meta name="google" value="notranslate">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?= $this->title ? $this->escape($this->title) : 'Icinga Web' ?></title>
<!-- TODO: viewport and scale settings make no sense for us, fix this -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
2014-04-07 14:04:23 +02:00
<link rel="stylesheet" href="<?= $this->href($cssfile) ?>" media="screen" type="text/css" />
<? if ($isIframe): ?>
<base target="_parent"/>
<?php else: ?>
<script type="text/javascript">
(function() {
var html = document.getElementsByTagName('html')[0];
html.className = html.className.replace(/no-js/, 'js');
}());
</script>
<?php endif ?>
2014-02-18 19:06:27 +01:00
<!-- Respond.js IE8 support of media queries -->
<!--[if lt IE 9]>
<script src="<?= $this->baseUrl('js/vendor/respond.min.js');?>"></script>
<![endif]-->
2014-08-19 10:13:19 +02:00
<link rel="shortcut icon" href="<?= $this->baseUrl('img/favicon.png') ?>" />
</head>
2014-02-18 19:06:27 +01:00
<body id="body">
<pre id="responsive-debug"></pre>
<div id="layout" class="default-layout">
2014-02-18 19:06:27 +01:00
<?= $this->render('body.phtml') ?>
</div>
<?php if (! $isIframe): ?>
<!--[if IE 8]>
<script type="text/javascript" src="<?= $this->href($ie8jsfile) ?>"></script>
<![endif]-->
<!--[if gt IE 8]><!-->
2014-04-07 14:04:23 +02:00
<script type="text/javascript" src="<?= $this->href($jsfile) ?>"></script>
<!--<![endif]-->
2014-02-18 19:06:27 +01:00
<script type="text/javascript">
var icinga = new Icinga({
baseUrl: '<?= $this->href('/') ?>'
2014-02-18 19:06:27 +01:00
});
</script>
<?php endif ?>
</body>
</html>