mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
QuickSearch: implement it as a trait
This commit is contained in:
parent
e0589d3560
commit
bf5b7dbf32
33
library/Director/Web/Controller/Extension/QuickSearch.php
Normal file
33
library/Director/Web/Controller/Extension/QuickSearch.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Icinga\Module\Director\Web\Controller\Extension;
|
||||||
|
|
||||||
|
use ipl\Html\Html;
|
||||||
|
|
||||||
|
trait QuickSearch
|
||||||
|
{
|
||||||
|
public function quickSearch()
|
||||||
|
{
|
||||||
|
$search = $this->params->get('q');
|
||||||
|
|
||||||
|
$form = Html::tag('form', [
|
||||||
|
'action' => $this->getRequest()->getUrl()->without(array('q', 'page', 'modifyFilter')),
|
||||||
|
'class' => ['quicksearch', 'inline'],
|
||||||
|
'method' => 'GET'
|
||||||
|
]);
|
||||||
|
|
||||||
|
$form->add(
|
||||||
|
Html::tag('input', [
|
||||||
|
'type' => 'text',
|
||||||
|
'name' => 'q',
|
||||||
|
'value' => $search,
|
||||||
|
'placeholder' => $this->translate('Search...'),
|
||||||
|
'class' => 'search'
|
||||||
|
])
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->controls()->add($form);
|
||||||
|
|
||||||
|
return $search;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user