Added showOrder for sitemaps
authorAlexander Ebert <ebert@woltlab.com>
Mon, 25 Jun 2012 15:52:32 +0000 (17:52 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 25 Jun 2012 15:52:32 +0000 (17:52 +0200)
wcfsetup/install/files/lib/system/cache/builder/SitemapCacheBuilder.class.php
wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php

index 8350344b6d9d85f21782336a415e4a1e4779e1da..0dd72b6524d9618f38c690c214bcb02fd82f25f3 100644 (file)
@@ -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();
index 518dd6685193994cf6d8a4adf09e90e033922a1d..8aefc912a367b44c12724fa887d32a3661b9f74f 100644 (file)
@@ -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
                );
        }