diff --git a/application/controllers/SearchController.php b/application/controllers/SearchController.php index 2fdba5662..e7e2b3b5b 100644 --- a/application/controllers/SearchController.php +++ b/application/controllers/SearchController.php @@ -4,6 +4,8 @@ namespace Icinga\Controllers; use Icinga\Web\Widget\SearchDashboard; +use ipl\Html\HtmlElement; +use ipl\Html\Text; use ipl\Web\Compat\CompatController; /** @@ -22,5 +24,17 @@ class SearchController extends CompatController public function hintAction() { + $this->getTabs()->disableLegacyExtensions(); + + $this->addContent(new HtmlElement('h1', null, Text::create(t('I\'m ready to search, waiting for your input')))); + + $p = new HtmlElement('p'); + $p->addHtml(new HtmlElement('strong', null, Text::create(t('Hint') . ': '))); + $p->addHtml(Text::create(t( + 'Please use the asterisk (*) as a placeholder for wildcard searches. For convenience I\'ll always add' . + ' a wildcard in front and after your search string.' + ))); + + $this->addContent($p); } } diff --git a/application/views/scripts/search/hint.phtml b/application/views/scripts/search/hint.phtml deleted file mode 100644 index d54c0b24f..000000000 --- a/application/views/scripts/search/hint.phtml +++ /dev/null @@ -1,8 +0,0 @@ -
-

translate("I'm ready to search, waiting for your input") ?>

-

translate('Hint') ?>: translate( - 'Please use the asterisk (*) as a placeholder for wildcard searches.' - . " For convenience I'll always add a wildcard in front and after your" - . ' search string.' -) ?>

-
diff --git a/library/Icinga/Web/Widget/SearchDashboard.php b/library/Icinga/Web/Widget/SearchDashboard.php index 5b12060ac..cd15fec44 100644 --- a/library/Icinga/Web/Widget/SearchDashboard.php +++ b/library/Icinga/Web/Widget/SearchDashboard.php @@ -5,6 +5,7 @@ namespace Icinga\Web\Widget; use Icinga\Exception\Http\HttpNotFoundException; use Icinga\Application\Icinga; +use Icinga\Web\Dashboard\Dashboard; use Icinga\Web\Dashboard\DashboardHome; use Icinga\Web\Dashboard\Dashlet; use Icinga\Web\Url; @@ -12,7 +13,7 @@ use Icinga\Web\Url; /** * Class SearchDashboard display multiple search views on a single search page */ -class SearchDashboard extends \Icinga\Web\Dashboard\Dashboard +class SearchDashboard extends Dashboard { /** * Name for the search home @@ -58,7 +59,7 @@ class SearchDashboard extends \Icinga\Web\Dashboard\Dashboard return $this->tabs; } - public function getActiveHome() + public function getActiveHome(): ?DashboardHome { return $this->searchHome; } @@ -70,7 +71,7 @@ class SearchDashboard extends \Icinga\Web\Dashboard\Dashboard * * @return $this */ - public function search($searchString = '') + public function search(string $searchString = ''): self { $pane = $this->searchHome->createEntry(self::SEARCH_PANE)->getEntry(self::SEARCH_PANE); $pane->setTitle(t('Search'));