Icinga\Web\Controller::setupSortControl(): set query on the newly created SortBox (if given)
refs #9220
This commit is contained in:
parent
32659647b9
commit
e1c3d23d12
|
@ -43,17 +43,22 @@ class Controller extends ModuleActionController
|
|||
*
|
||||
* @param array $columns An array containing the sort columns, with the
|
||||
* submit value as the key and the label as the value
|
||||
* @param Sortable $query Query to set on the newly created SortBox
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
protected function setupSortControl(array $columns)
|
||||
protected function setupSortControl(array $columns, Sortable $query = null)
|
||||
{
|
||||
if (! $this->view->compact) {
|
||||
$req = $this->getRequest();
|
||||
$this->view->sortBox = SortBox::create(
|
||||
$this->view->sortBox = $sortBox = SortBox::create(
|
||||
'sortbox-' . $req->getActionName(),
|
||||
$columns
|
||||
)->setRequest($req);
|
||||
if ($query !== null) {
|
||||
$sortBox->setQuery($query);
|
||||
}
|
||||
$sortBox->handleRequest();
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
Loading…
Reference in New Issue