mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Controller: Drop method createFilterControl()
This commit is contained in:
parent
0293a2c721
commit
febdae2552
1 changed files with 0 additions and 37 deletions
|
|
@ -12,7 +12,6 @@ use Icinga\Module\Icingadb\Common\Database;
|
|||
use Icinga\Module\Icingadb\Compat\MonitoringRestrictions;
|
||||
use Icinga\Module\Icingadb\Compat\UrlMigrator;
|
||||
use Icinga\Module\Icingadb\Widget\BaseItemList;
|
||||
use Icinga\Module\Icingadb\Widget\FilterControl;
|
||||
use Icinga\Module\Icingadb\Widget\ViewModeSwitcher;
|
||||
use InvalidArgumentException;
|
||||
use ipl\Html\Html;
|
||||
|
|
@ -229,42 +228,6 @@ class Controller extends CompatController
|
|||
return $searchBar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and return the FilterControl
|
||||
*
|
||||
* @param Query $query
|
||||
* @param array $preserveParams
|
||||
*
|
||||
* @return FilterControl
|
||||
*/
|
||||
public function createFilterControl(Query $query, array $preserveParams = null)
|
||||
{
|
||||
$request = clone $this->getRequest();
|
||||
$params = clone $this->params;
|
||||
|
||||
if (! empty($preserveParams)) {
|
||||
foreach ($preserveParams as $param) {
|
||||
if (! $params->has($param) && ($value = $request->getUrl()->getParam($param)) !== null) {
|
||||
$params->set($param, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$request->getUrl()->setParams($params);
|
||||
|
||||
$filterControl = new FilterControl($query, $preserveParams);
|
||||
$filterControl->handleRequest($request);
|
||||
|
||||
// We're cloning the params, the editor does it, so we have to shift these ourselves
|
||||
$this->params->shift('addFilter');
|
||||
$this->params->shift('removeFilter');
|
||||
$this->params->shift('stripFilter');
|
||||
$this->params->shift('modifyFilter');
|
||||
$this->params->shift('q');
|
||||
|
||||
return $filterControl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and return the ViewModeSwitcher
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue