mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-22 17:37:45 +02:00
Fix some logical inconsistencies
This commit is contained in:
parent
e688d48167
commit
5d5f6cbcd2
@ -6,7 +6,7 @@ use Icinga\Web\Widget\SearchDashboard;
|
||||
$searchDashboard = new SearchDashboard();
|
||||
$searchDashboard->setUser($this->Auth()->getUser());
|
||||
|
||||
if (! $searchDashboard->search('dummy')->getActiveHome()->getEntry('search')->hasEntries()): ?>
|
||||
if ($searchDashboard->search('dummy')->getActiveHome()->getEntry('search')->hasEntries()): ?>
|
||||
<form action="<?= $this->href('search') ?>" method="get" role="search" class="search-control">
|
||||
<input type="text" name="q" id="search" class="search search-input" required
|
||||
placeholder="<?= $this->translate('Search') ?> …"
|
||||
|
@ -6,6 +6,7 @@ namespace Icinga\Web\Widget;
|
||||
use Icinga\Exception\Http\HttpNotFoundException;
|
||||
use Icinga\Application\Icinga;
|
||||
use Icinga\Web\Dashboard\DashboardHome;
|
||||
use Icinga\Web\Dashboard\Dashlet;
|
||||
use Icinga\Web\Url;
|
||||
|
||||
/**
|
||||
@ -104,11 +105,14 @@ class SearchDashboard extends \Icinga\Web\Dashboard\Dashboard
|
||||
|
||||
protected function assemble()
|
||||
{
|
||||
if ($this->searchHome->getEntry(self::SEARCH_PANE)->hasEntries()) {
|
||||
if (! $this->searchHome->getEntry(self::SEARCH_PANE)->hasEntries()) {
|
||||
throw new HttpNotFoundException(t('Page not found'));
|
||||
}
|
||||
|
||||
$this->add($this->searchHome->getEntry(self::SEARCH_PANE)->getEntries());
|
||||
/** @var Dashlet $dashlet */
|
||||
foreach ($this->searchHome->getEntry(self::SEARCH_PANE)->getEntries() as $dashlet) {
|
||||
$this->addHtml($dashlet->getHtml());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user