Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/rebuild-form-builder-5525
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Meyer committed Sep 9, 2014
2 parents e7c0218 + 7d45384 commit 83772c6
Show file tree
Hide file tree
Showing 51 changed files with 862 additions and 639 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -11,6 +11,8 @@

build/

development/

# ./configure output
config.log
autom4te.cache
Expand Down
8 changes: 5 additions & 3 deletions application/controllers/LayoutController.php
Expand Up @@ -18,10 +18,12 @@ class LayoutController extends ActionController
*/
public function menuAction()
{
$this->setAutorefreshInterval(15);
$this->_helper->layout()->disableLayout();
$this->view->menuRenderer = new MenuRenderer(
Menu::load(), Url::fromRequest()->without('renderLayout')->getRelativeUrl()
);

$url = Url::fromRequest();
$menu = new MenuRenderer(Menu::load(), $url->getRelativeUrl());
$this->view->menuRenderer = $menu->useCustomRenderer();
}

/**
Expand Down
7 changes: 3 additions & 4 deletions application/controllers/StaticController.php
Expand Up @@ -59,13 +59,12 @@ public function gravatarAction()
public function imgAction()
{
$module = $this->_getParam('module_name');
// TODO: This is more than dangerous, must be fixed!!
$file = $this->_getParam('file');

$basedir = Icinga::app()->getModuleManager()->getModule($module)->getBaseDir();

$filePath = $basedir . '/public/img/' . $file;
if (! file_exists($filePath)) {
$filePath = realpath($basedir . '/public/img/' . $file);

if (! $filePath || strpos($filePath, $basedir) !== 0) {
throw new ActionException(sprintf(
'%s does not exist',
$filePath
Expand Down
14 changes: 9 additions & 5 deletions application/layouts/scripts/parts/navigation.phtml
Expand Up @@ -11,11 +11,15 @@ if (! $this->auth()->isAuthenticated()) {
}

?>
<div id="menu" data-base-target="_main">
<div
id="menu" data-last-update="<?= (time() - 14) ?>000" data-base-target="_main" class="container" data-icinga-url="<?=$this->href('layout/menu');?>"
data-icinga-refresh="15"
>
<? if (SearchDashboard::search('dummy')->getPane('search')->hasComponents()): ?>
<form action="<?= $this->href('search') ?>" method="get" role="search">
<input type="text" name="q" class="search autofocus" placeholder="<?= $this->translate('Search...') ?>" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
</form>
<form action="<?= $this->href('search') ?>" method="get" role="search">
<input type="text" name="q" class="search autofocus" placeholder="<?= $this->translate('Search...') ?>"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
</form>
<? endif; ?>
<?= new MenuRenderer(Menu::load(), Url::fromRequest()->without('renderLayout')->getRelativeUrl()); ?>
<?= new MenuRenderer(Menu::load(), Url::fromRequest()->without('renderLayout')->getRelativeUrl()); ?>
</div>
2 changes: 1 addition & 1 deletion application/views/helpers/FormTriStateCheckbox.php
Expand Up @@ -2,7 +2,7 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}

use Zend_View_Helper_FormElement;
use \Zend_View_Helper_FormElement;

/**
* Helper to generate a "datetime" element
Expand Down
14 changes: 13 additions & 1 deletion application/views/scripts/layout/menu.phtml
@@ -1 +1,13 @@
<?= $menuRenderer; ?>
<?php
use Icinga\Web\Widget\SearchDashboard;
?>

<? if (SearchDashboard::search('dummy')->getPane('search')->hasComponents()): ?>
<form action="<?= $this->href('search') ?>" method="get" role="search">
<input
type="text" name="q" class="search autofocus" placeholder="<?= $this->translate('Search...') ?>"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
/>
</form>
<? endif; ?>
<?= $menuRenderer; ?>
130 changes: 0 additions & 130 deletions doc/components.md

This file was deleted.

8 changes: 6 additions & 2 deletions library/Icinga/Application/Modules/Module.php
Expand Up @@ -8,6 +8,7 @@
use Zend_Config;
use Zend_Controller_Router_Route_Abstract;
use Zend_Controller_Router_Route as Route;
use Zend_Controller_Router_Route_Regex as RegexRoute;
use Icinga\Application\ApplicationBootstrap;
use Icinga\Application\Config;
use Icinga\Application\Icinga;
Expand Down Expand Up @@ -821,12 +822,15 @@ protected function registerRoutes()
);
$router->addRoute(
$this->name . '_img',
new Route(
'img/' . $this->name . '/:file',
new RegexRoute(
'img/' . $this->name . '/(.+)',
array(
'controller' => 'static',
'action' => 'img',
'module_name' => $this->name
),
array(
1 => 'file'
)
)
);
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Chart/Graph/Tooltip.php
Expand Up @@ -67,7 +67,7 @@ class Tooltip
*/
public function __construct (
$data = array(),
$format = '<b>{title}</b></b><br> {value} of {sum} {label}'
$format = '<b>{title}</b></b><br/> {value} of {sum} {label}'
) {
$this->data = array_merge($this->data, $data);
$this->defaultFormat = $format;
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Web/Hook.php
Expand Up @@ -123,7 +123,7 @@ public static function createInstance($name, $key)
*/
private static function assertValidHook($instance, $name)
{
$base_class = self::$BASE_NS . ucfirst($name);
$base_class = self::$BASE_NS . ucfirst($name) . 'Hook';

if (strpos($base_class, self::$classSuffix) === false) {
$base_class .= self::$classSuffix;
Expand Down

0 comments on commit 83772c6

Please sign in to comment.