Restructure outer layout

This commit is contained in:
Thomas Gelf 2014-02-25 10:13:36 +00:00
parent 09ed62d8bf
commit a41bfcbfaf
3 changed files with 34 additions and 17 deletions

View File

@ -1,9 +1,26 @@
<?php if (Icinga\Authentication\Manager::getInstance()->isAuthenticated()): ?>
<div id="layout">
<div id="header">
<ul id="notifications"></ul>
<ul id="notifications"></ul>
<div id="logo"><a href="<?= $this->href('/dashboard') ?>"><img src="<?= $this->href('img/logo_icinga-inv.png') ?>" class="logo" /></a>
</div>
</div>
<div id="inner-layout">
<!--
<ul class="tabs" >
<li class="dropdown">
<a href="#" class="dropdown-toggle">
<?= $this->img('icons/user.png') ?>
<?= $this->escape($this->auth()->getUser()->getUsername()) ?>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="<?= $this->href('/preference') ?>"><?= $this->translate('Preferences'); ?></a></li>
<li><a href="<?= $this->href('/authentication/logout'); ?>" title="Logout"><?= $this->translate('Logout'); ?></a></li>
</ul>
</li>
</ul>
-->
<div id="sidebar">
<?= $this->layout()->navigation ?>
<?php echo $this->render('parts/navigation.phtml') ?>
@ -18,7 +35,6 @@
<div id="col3" class="container">
</div>
</div><!-- END of main -->
</div><!-- END of inner-layout -->
</div><!-- END of layout -->
<?php else: ?>
<?= $this->render('inline.phtml') ?>

View File

@ -11,7 +11,7 @@ foreach ($this->items as $item) {
$item->getIcon(),
array('height' => '16px', 'width' => '16px')
) . ' ' : '',
$item->getTitle()
$this->escape($item->getTitle())
);
if ($item->hasChildren()) {

View File

@ -1,19 +1,20 @@
<div id="menu-header"><img src="<?= $this->href('img/logo_icinga-inv.png') ?>" style="height: 2em; width:6em; float: left; margin-left: 1.5em; margin-right: 9em; margin-top: 0.5em;" alt="" /></div>
<div id="menu">
<input type="text" style="width: 9em; margin: 0.5em;background-color: #999; background-image: url('<?= $this->href('img/icons/search.png') ?>'); background-repeat: no-repeat; background-position: 0.8em center; padding: 0.3em; padding-left: 2.5em; border: none; color: #F5F5F5; text-shadow: -1px 1px 0 #555555;" placeholder="Search..." />
<?php
// determine current key
// Don't render a menu for unauthenticated users unless menu is auth aware
if (! $this->auth()->isAuthenticated()) {
return;
}
// Current url
$url = Icinga\Web\Url::fromRequest()->getRelativeUrl();
$menu = Icinga\Web\Menu::fromConfig();
if ($this->auth()->isAuthenticated()) {
echo $this->partial(
'parts/menu.phtml',
array(
'items' => $menu->getChildren(),
'url' => $url
)
);
}
?>
<div id="menu">
<form action="<?= $this->href('search') ?>" method="post"><input type="text" name="q" class="search" placeholder="Search..." autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /></form>
<?= $this->partial('parts/menu.phtml', array(
'items' => $menu->getChildren(),
'url' => $url
))
?>
</div>