isIframe: clean up, load less html and js
We use isIframe only when we have no JS, therefore it makes no sense to load JS files in an iFrame. Also removed sidebar.
This commit is contained in:
parent
3b84078b2f
commit
216f0f3f55
|
@ -32,9 +32,11 @@ if ($notifications->hasMessages()) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!$this->layout()->isIframe): ?>
|
||||
<div id="sidebar">
|
||||
<?php echo $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="<?= Url::fromRequest() ?>"<?= $refresh ?> style="display: block">
|
||||
<?= $this->render('inline.phtml') ?>
|
||||
|
|
|
@ -13,7 +13,7 @@ if (array_key_exists('_dev', $_GET)) {
|
|||
|
||||
$ie8jsfile = 'js/icinga.ie8.js';
|
||||
$lang = Translator::getLanguage();
|
||||
$isIframe = isset($_GET['isIframe']);
|
||||
$isIframe = $this->layout()->isIframe;
|
||||
$iframeClass = $isIframe ? ' iframe' : '';
|
||||
|
||||
?><!DOCTYPE html>
|
||||
|
@ -30,15 +30,16 @@ $iframeClass = $isIframe ? ' iframe' : '';
|
|||
<!-- 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">
|
||||
<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>
|
||||
<? if ($isIframe): ?>
|
||||
<base target="_parent"/>
|
||||
<? endif ?>
|
||||
<?php endif ?>
|
||||
<!-- Respond.js IE8 support of media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="<?= $this->baseUrl('js/vendor/respond.min.js');?>"></script>
|
||||
|
@ -50,6 +51,7 @@ $iframeClass = $isIframe ? ' iframe' : '';
|
|||
<div id="layout" class="default-layout">
|
||||
<?= $this->render('body.phtml') ?>
|
||||
</div>
|
||||
<?php if (! $isIframe): ?>
|
||||
<!--[if IE 8]>
|
||||
<script type="text/javascript" src="<?= $this->href($ie8jsfile) ?>"></script>
|
||||
<![endif]-->
|
||||
|
@ -61,5 +63,6 @@ var icinga = new Icinga({
|
|||
baseUrl: '<?= $this->href('/') ?>'
|
||||
});
|
||||
</script>
|
||||
<?php endif ?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -109,7 +109,7 @@ class ActionController extends Zend_Controller_Action
|
|||
|
||||
$this->handlerBrowserWindows();
|
||||
$this->view->translationDomain = 'icinga';
|
||||
|
||||
$this->_helper->layout()->isIframe = (bool) $this->params->shift('isIframe', false);
|
||||
if ($this->requiresConfig()) {
|
||||
$this->redirectNow(Url::fromPath('install'));
|
||||
}
|
||||
|
|
|
@ -442,7 +442,6 @@ class Monitoring_ListController extends Controller
|
|||
$params = clone $this->params;
|
||||
|
||||
$params->shift('_render');
|
||||
$params->shift('isIframe');
|
||||
$limit = $params->shift('limit');
|
||||
$sort = $params->shift('sort');
|
||||
$dir = $params->shift('dir');
|
||||
|
|
Loading…
Reference in New Issue