<type>
<name>com.woltlab.wcf.userList</name>
<definitionname>com.woltlab.wcf.boxController</definitionname>
- <classname>wcf\system\box\userListBoxController</classname>
+ <classname>wcf\system\box\UserListBoxController</classname>
</type>
<type>
<name>com.woltlab.wcf.userOnlineList</name>
<definitionname>com.woltlab.wcf.boxController</definitionname>
<classname>wcf\system\box\ArticleCategoriesBoxController</classname>
</type>
+ <type>
+ <name>com.woltlab.wcf.articleList</name>
+ <definitionname>com.woltlab.wcf.boxController</definitionname>
+ <classname>wcf\system\box\ArticleListBoxController</classname>
+ </type>
<!-- /box controllers -->
<!-- deprecated -->
--- /dev/null
+{include file='articleListItems' objects=$boxArticleList}
--- /dev/null
+<ul class="sidebarBoxList">
+ {foreach from=$boxArticleList item=boxArticle}
+ <li>
+ <a href="{$boxArticle->getLink()}" class="box48">
+ <span>{if $boxArticle->getImage()}{@$boxArticle->getImage()->getElementTag(48)}{/if}</span>
+
+ <div>
+ <h3>{$boxArticle->getTitle()}</h3>
+ <small>
+ {if $boxSortField == 'time'}
+ {@$boxArticle->time|time}
+ {elseif $boxSortField == 'views'}
+ {lang article=$boxArticle}wcf.article.articleViews{/lang}
+ {elseif $boxSortField == 'comments'}
+ {lang article=$boxArticle}wcf.article.articleComments{/lang}
+ {elseif $boxSortField == 'cumulativeLikes'}
+ {if MODULE_LIKE && $__wcf->getSession()->getPermission('user.like.canViewLike') && ($boxArticle->likes || $boxArticle->dislikes)}
+ <span class="wcfLikeCounter{if $boxArticle->cumulativeLikes > 0} likeCounterLiked{elseif $boxArticle->cumulativeLikes < 0}likeCounterDisliked{/if}">
+ <span class="icon icon16 fa-thumbs-o-{if $boxArticle->cumulativeLikes < 0}down{else}up{/if} jsTooltip" title="{lang likes=$boxArticle->likes dislikes=$boxArticle->dislikes}wcf.like.tooltip{/lang}"></span>{if $boxArticle->cumulativeLikes > 0}+{elseif $boxArticle->cumulativeLikes == 0}±{/if}{#$boxArticle->cumulativeLikes}
+ </span>
+ {/if}
+ {/if}
+ </small>
+ </div>
+ </a>
+ </li>
+ {/foreach}
+</ul>
parent::save();
$content = [];
- if ($this->isMultilingual) {
+ if ($this->boxType == 'system' || $this->isMultilingual) {
foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
$content[$language->languageID] = [
'title' => (!empty($this->title[$language->languageID]) ? $this->title[$language->languageID] : ''),
AbstractForm::save();
$content = [];
- if ($this->isMultilingual) {
+ if ($this->boxType == 'system' || $this->isMultilingual) {
foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
$content[$language->languageID] = [
'title' => (!empty($_POST['title'][$language->languageID]) ? $_POST['title'][$language->languageID] : ''),
*/
public function getBoxContentTitle() {
$boxContent = $this->getBoxContent();
- if ($this->isMultilingual) {
+ if ($this->isMultilingual || $this->boxType == 'system') {
if (isset($boxContent[WCF::getLanguage()->languageID])) {
return $boxContent[WCF::getLanguage()->languageID]['title'];
}
--- /dev/null
+<?php
+namespace wcf\system\box;
+use wcf\data\article\AccessibleArticleList;
+use wcf\system\WCF;
+
+/**
+ * Box controller for a list of articles.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2016 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Box
+ * @since 3.0
+ */
+class ArticleListBoxController extends AbstractDatabaseObjectListBoxController {
+ /**
+ * @inheritDoc
+ */
+ protected $supportedPositions = ['sidebarLeft', 'sidebarRight', 'contentTop', 'contentBottom', 'top', 'bottom'];
+
+ /**
+ * @inheritDoc
+ */
+ protected $sortFieldLanguageItemPrefix = 'wcf.article';
+
+ /**
+ * @inheritDoc
+ */
+ public $validSortFields = [
+ 'time',
+ 'comments',
+ 'views'
+ ];
+
+ /**
+ * @inheritDoc
+ */
+ public function __construct() {
+ if (!empty($this->validSortFields) && MODULE_LIKE) {
+ $this->validSortFields[] = 'cumulativeLikes';
+ }
+
+ parent::__construct();
+ }
+
+ /**
+ * @inheritDoc
+ */
+ protected function getObjectList() {
+ return new AccessibleArticleList();
+ }
+
+ /**
+ * @inheritDoc
+ */
+ protected function getTemplate() {
+ $templateName = 'boxArticleList';
+ if ($this->box->position === 'sidebarLeft' || $this->box->position === 'sidebarRight') {
+ $templateName = 'boxArticleListSidebar';
+ }
+
+ return WCF::getTPL()->fetch($templateName, 'wcf', [
+ 'boxArticleList' => $this->objectList,
+ 'boxSortField' => $this->sortField
+ ]);
+ }
+}
transition: .2s ease opacity;
}
- &:not(.rowColGap) {
- > li:not(:first-child) {
- margin-top: 30px;
- }
+ > li:not(:first-child) {
+ margin-top: 30px;
}
-}
\ No newline at end of file
+}