<maxvalue>100</maxvalue>
<suffix>percent</suffix>
</option>
+ <option name="article_sort_order">
+ <categoryname>cms.article</categoryname>
+ <optiontype>select</optiontype>
+ <defaultvalue>DESC</defaultvalue>
+ <selectoptions>ASC:wcf.global.sortOrder.ascending
+DESC:wcf.global.sortOrder.descending</selectoptions>
+ <options>module_article</options>
+ </option>
<!-- /cms.article -->
</options>
</import>
define('SHOW_UPDATE_NOTICE_FRONTEND', 1);
define('LANGUAGE_USE_INFORMAL_VARIANT', 0);
define('SHOW_STYLE_CHANGER', 0);
+define('ARTICLE_SORT_ORDER', 'DESC');
/**
* @inheritDoc
*/
- public $sqlOrderBy = 'article.time DESC';
+ public $sortField = 'time';
+
+ /**
+ * @inheritDoc
+ */
+ public $sortOrder = ARTICLE_SORT_ORDER;
/**
* @inheritDoc
// get next article
$articleList = new CategoryArticleList($this->article->categoryID);
- $articleList->getConditionBuilder()->add('article.time > ?', [$this->article->time]);
- $articleList->sqlOrderBy = 'article.time';
+ $articleList->getConditionBuilder()->add('article.time ' . (ARTICLE_SORT_ORDER == 'DESC' ? '>' : '<') . ' ?', [$this->article->time]);
+ $articleList->sqlOrderBy = 'article.time ' . (ARTICLE_SORT_ORDER == 'DESC' ? 'ASC' : 'DESC');
$articleList->sqlLimit = 1;
$articleList->readObjects();
foreach ($articleList as $article) $this->nextArticle = $article;
// get previous article
$articleList = new CategoryArticleList($this->article->categoryID);
- $articleList->getConditionBuilder()->add('article.time < ?', [$this->article->time]);
- $articleList->sqlOrderBy = 'article.time DESC';
+ $articleList->getConditionBuilder()->add('article.time ' . (ARTICLE_SORT_ORDER == 'DESC' ? '<' : '>') . ' ?', [$this->article->time]);
+ $articleList->sqlOrderBy = 'article.time ' . ARTICLE_SORT_ORDER;
$articleList->sqlLimit = 1;
$articleList->readObjects();
foreach ($articleList as $article) $this->previousArticle = $article;
<item name="wcf.acp.option.media_small_thumbnail_height"><![CDATA[Höhe der kleinen Vorschaugrafiken]]></item>
<item name="wcf.acp.option.media_small_thumbnail_retain_dimensions"><![CDATA[Bildformat beim Erzeugen von kleinen Vorschaugrafiken beibehalten]]></item>
<item name="wcf.acp.option.media_small_thumbnail_width"><![CDATA[Breite der kleinen Vorschaugrafiken]]></item>
-
+ <item name="wcf.acp.option.article_sort_order"><![CDATA[Sortierungsreihenfolge]]></item>
+ <item name="wcf.acp.option.article_sort_order.description"><![CDATA[Standard-Reihenfolge für die Liste der Artikel.]]></item>
</category>
<category name="wcf.acp.package">
<item name="wcf.acp.option.media_small_thumbnail_height"><![CDATA[Small Thumbnail Height]]></item>
<item name="wcf.acp.option.media_small_thumbnail_retain_dimensions"><![CDATA[Retain thumbnail dimensions (small)]]></item>
<item name="wcf.acp.option.media_small_thumbnail_width"><![CDATA[Small Thumbnail Width]]></item>
+ <item name="wcf.acp.option.article_sort_order"><![CDATA[Sort Order]]></item>
+ <item name="wcf.acp.option.article_sort_order.description"><![CDATA[Choose default sort order of articles.]]></item>
</category>
<category name="wcf.acp.package">