From 2a0269021cc1d833d66ed6778195ebe106834dc2 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 25 Jun 2012 17:52:32 +0200 Subject: [PATCH] Added showOrder for sitemaps --- .../lib/system/cache/builder/SitemapCacheBuilder.class.php | 1 + .../plugin/SitemapPackageInstallationPlugin.class.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/cache/builder/SitemapCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/SitemapCacheBuilder.class.php index 8350344b6d..0dd72b6524 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/SitemapCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/SitemapCacheBuilder.class.php @@ -21,6 +21,7 @@ class SitemapCacheBuilder implements ICacheBuilder { $sitemapList = new SitemapList(); $sitemapList->getConditionBuilder()->add("sitemap.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies())); $sitemapList->sqlLimit = 0; + $sitemapList->sqlOrderBy = "sitemap.showOrder ASC"; $sitemapList->readObjects(); return $sitemapList->getObjects(); diff --git a/wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php index 518dd66851..8aefc912a3 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php @@ -49,9 +49,13 @@ class SitemapPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport() */ protected function prepareImport(array $data) { + $showOrder = (isset($data['elements']['showOrder'])) ? intval($data['elements']['showOrder']) : null; + $showOrder = $this->getShowOrder($showOrder, null, 'showOrder'); + return array( 'sitemapName' => $data['attributes']['name'], - 'className' => $data['elements']['classname'] + 'className' => $data['elements']['classname'], + 'showOrder' => $showOrder ); } -- 2.20.1