mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-05-21 07:00:11 +02:00
Icinga\Web\Controller::setupSortControl(): set query on the newly created SortBox (if given)
refs #9220
This commit is contained in:
parent
32659647b9
commit
e1c3d23d12
@ -41,19 +41,24 @@ class Controller extends ModuleActionController
|
|||||||
*
|
*
|
||||||
* In case the current view has been requested as compact this method does nothing.
|
* In case the current view has been requested as compact this method does nothing.
|
||||||
*
|
*
|
||||||
* @param array $columns An array containing the sort columns, with the
|
* @param array $columns An array containing the sort columns, with the
|
||||||
* submit value as the key and the label as the value
|
* submit value as the key and the label as the value
|
||||||
|
* @param Sortable $query Query to set on the newly created SortBox
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
protected function setupSortControl(array $columns)
|
protected function setupSortControl(array $columns, Sortable $query = null)
|
||||||
{
|
{
|
||||||
if (! $this->view->compact) {
|
if (! $this->view->compact) {
|
||||||
$req = $this->getRequest();
|
$req = $this->getRequest();
|
||||||
$this->view->sortBox = SortBox::create(
|
$this->view->sortBox = $sortBox = SortBox::create(
|
||||||
'sortbox-' . $req->getActionName(),
|
'sortbox-' . $req->getActionName(),
|
||||||
$columns
|
$columns
|
||||||
)->setRequest($req);
|
)->setRequest($req);
|
||||||
|
if ($query !== null) {
|
||||||
|
$sortBox->setQuery($query);
|
||||||
|
}
|
||||||
|
$sortBox->handleRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user