mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +02:00
ObjectsController: introduce quick search
This commit is contained in:
parent
d7142b307a
commit
33d323286e
@ -99,7 +99,59 @@ abstract class ObjectsController extends ActionController
|
|||||||
|
|
||||||
$this->view->title = $this->translate('Icinga ' . ucfirst($ltype) . 's');
|
$this->view->title = $this->translate('Icinga ' . ucfirst($ltype) . 's');
|
||||||
$table = $this->loadTable($table)->setConnection($this->db());
|
$table = $this->loadTable($table)->setConnection($this->db());
|
||||||
$this->view->filterEditor = $table->getFilterEditor($this->getRequest());
|
$filterEditor = $table->getFilterEditor($this->getRequest());
|
||||||
|
$filter = $filterEditor->getFilter();
|
||||||
|
|
||||||
|
if ($filter->isEmpty()) {
|
||||||
|
|
||||||
|
if ($this->params->get('modifyFilter')) {
|
||||||
|
$this->view->addLink .= ' ' . $this->view->qlink(
|
||||||
|
$this->translate('Show unfiltered'),
|
||||||
|
$this->getRequest()->getUrl()->setParams(array()),
|
||||||
|
null,
|
||||||
|
array(
|
||||||
|
'class' => 'icon-cancel',
|
||||||
|
'data-base-target' => '_self',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->view->addLink .= ' ' . $this->view->qlink(
|
||||||
|
$this->translate('Filter'),
|
||||||
|
$this->getRequest()->getUrl()->with('modifyFilter', true),
|
||||||
|
null,
|
||||||
|
array(
|
||||||
|
'class' => 'icon-search',
|
||||||
|
'data-base-target' => '_self',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$this->view->addLink .= ' ' . $this->view->qlink(
|
||||||
|
$this->shorten($filter, 32),
|
||||||
|
$this->getRequest()->getUrl()->with('modifyFilter', true),
|
||||||
|
null,
|
||||||
|
array(
|
||||||
|
'class' => 'icon-search',
|
||||||
|
'data-base-target' => '_self',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->view->addLink .= ' ' . $this->view->qlink(
|
||||||
|
$this->translate('Show unfiltered'),
|
||||||
|
$this->getRequest()->getUrl()->setParams(array()),
|
||||||
|
null,
|
||||||
|
array(
|
||||||
|
'class' => 'icon-cancel',
|
||||||
|
'data-base-target' => '_self',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->params->get('modifyFilter')) {
|
||||||
|
$this->view->filterEditor = $filterEditor;
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->getRequest()->isApiRequest()) {
|
if ($this->getRequest()->isApiRequest()) {
|
||||||
$objects = array();
|
$objects = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user