From 03935e3abcee65bd82fc197e724c98b6d4b4591f Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 11 Oct 2011 20:49:15 +0200 Subject: [PATCH] Fixed sort handling in MultipleLinkPage --- .../files/lib/page/MultipleLinkPage.class.php | 13 ++++++++++++ .../files/lib/page/SortablePage.class.php | 21 ------------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/wcfsetup/install/files/lib/page/MultipleLinkPage.class.php b/wcfsetup/install/files/lib/page/MultipleLinkPage.class.php index a35119e1a7..42656d01af 100644 --- a/wcfsetup/install/files/lib/page/MultipleLinkPage.class.php +++ b/wcfsetup/install/files/lib/page/MultipleLinkPage.class.php @@ -65,6 +65,18 @@ abstract class MultipleLinkPage extends AbstractPage { */ public $objectListClassName = ''; + /** + * selected sort field + * @var string + */ + public $sortField = ''; + + /** + * selected sort order + * @var string + */ + public $sortOrder = ''; + /** * @see wcf\data\DatabaseObjectList::$sqlLimit */ @@ -106,6 +118,7 @@ abstract class MultipleLinkPage extends AbstractPage { if ($this->items) { $this->sqlLimit = $this->itemsPerPage; $this->sqlOffset = ($this->pageNo - 1) * $this->itemsPerPage; + if ($this->sortField && $this->sortOrder) $this->sqlOrderBy = $this->sortField." ".$this->sortOrder; $this->readObjects(); } } diff --git a/wcfsetup/install/files/lib/page/SortablePage.class.php b/wcfsetup/install/files/lib/page/SortablePage.class.php index 433afd190b..ee3169d742 100644 --- a/wcfsetup/install/files/lib/page/SortablePage.class.php +++ b/wcfsetup/install/files/lib/page/SortablePage.class.php @@ -15,18 +15,6 @@ use wcf\system\event\EventHandler; * @category Community Framework */ abstract class SortablePage extends MultipleLinkPage { - /** - * selected sort field - * @var string - */ - public $sortField = ''; - - /** - * selected sort order - * @var string - */ - public $sortOrder = ''; - /** * default sort field * @var string @@ -66,15 +54,6 @@ abstract class SortablePage extends MultipleLinkPage { parent::readData(); } - /** - * @see wcf\page\MultipleLinkPage::readObjects() - */ - protected function readObjects() { - $this->sqlOrderBy = $this->sortField." ".$this->sortOrder; - - parent::readObjects(); - } - /** * Validates the given sort field parameter. */ -- 2.20.1