mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
Move setupSortControl() from Monitoring_ListController to Icinga\Web\Controller
This commit is contained in:
parent
20b09d3bda
commit
a817d9070e
@ -4,6 +4,7 @@
|
|||||||
namespace Icinga\Web;
|
namespace Icinga\Web;
|
||||||
|
|
||||||
use Icinga\Web\Controller\ModuleActionController;
|
use Icinga\Web\Controller\ModuleActionController;
|
||||||
|
use Icinga\Web\Widget\SortBox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the controller all modules should inherit from
|
* This is the controller all modules should inherit from
|
||||||
@ -12,4 +13,18 @@ use Icinga\Web\Controller\ModuleActionController;
|
|||||||
*/
|
*/
|
||||||
class Controller extends ModuleActionController
|
class Controller extends ModuleActionController
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Create a sort control box at the 'sortControl' view parameter
|
||||||
|
*
|
||||||
|
* @param array $columns An array containing the sort columns, with the
|
||||||
|
* submit value as the key and the label as the value
|
||||||
|
*/
|
||||||
|
protected function setupSortControl(array $columns)
|
||||||
|
{
|
||||||
|
$req = $this->getRequest();
|
||||||
|
$this->view->sortControl = SortBox::create(
|
||||||
|
'sortbox-' . $req->getActionName(),
|
||||||
|
$columns
|
||||||
|
)->applyRequest($req);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ use Icinga\Web\Url;
|
|||||||
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
||||||
use Icinga\Web\Widget\Tabextension\OutputFormat;
|
use Icinga\Web\Widget\Tabextension\OutputFormat;
|
||||||
use Icinga\Web\Widget\Tabs;
|
use Icinga\Web\Widget\Tabs;
|
||||||
use Icinga\Web\Widget\SortBox;
|
|
||||||
use Icinga\Data\Filter\Filter;
|
use Icinga\Data\Filter\Filter;
|
||||||
use Icinga\Web\Widget;
|
use Icinga\Web\Widget;
|
||||||
use Icinga\Module\Monitoring\Forms\StatehistoryForm;
|
use Icinga\Module\Monitoring\Forms\StatehistoryForm;
|
||||||
@ -694,21 +693,6 @@ class Monitoring_ListController extends Controller
|
|||||||
return $columns;
|
return $columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a sort control box at the 'sortControl' view parameter
|
|
||||||
*
|
|
||||||
* @param array $columns An array containing the sort columns, with the
|
|
||||||
* submit value as the key and the value as the label
|
|
||||||
*/
|
|
||||||
private function setupSortControl(array $columns)
|
|
||||||
{
|
|
||||||
$this->view->sortControl = new SortBox(
|
|
||||||
'sortbox-' . $this->getRequest()->getActionName(),
|
|
||||||
$columns
|
|
||||||
);
|
|
||||||
$this->view->sortControl->applyRequest($this->getRequest());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function addTitleTab($action, $title, $tip)
|
protected function addTitleTab($action, $title, $tip)
|
||||||
{
|
{
|
||||||
$this->getTabs()->add($action, array(
|
$this->getTabs()->add($action, array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user