From 32659647b93864ebdaf9042738ca8ee689c7da48 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 11 May 2015 16:09:20 +0200 Subject: [PATCH] Implement Icinga\Web\Widget\SortBox::handleRequest() refs #9220 --- library/Icinga/Web/Widget/SortBox.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/library/Icinga/Web/Widget/SortBox.php b/library/Icinga/Web/Widget/SortBox.php index 1026596ca..7896fb8ef 100644 --- a/library/Icinga/Web/Widget/SortBox.php +++ b/library/Icinga/Web/Widget/SortBox.php @@ -6,6 +6,7 @@ namespace Icinga\Web\Widget; use Icinga\Web\Form; use Icinga\Web\Request; use Icinga\Data\Sortable; +use Icinga\Application\Icinga; /** * SortBox widget @@ -106,6 +107,17 @@ class SortBox extends AbstractWidget return $this; } + public function handleRequest(Request $request = null) + { + if ($request === null) { + $request = Icinga::app()->getFrontController()->getRequest(); + } + if ($sort = $request->getParam('sort')) { + $this->query->order($sort, $request->getParam('dir')); + } + return $this; + } + /** * Render this SortBox as HTML *