From 290363780d61b541634203baa50380bef1f53366 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 4 Mar 2019 18:31:00 +0100 Subject: [PATCH] Add support for HTML in article and trophy category descriptions See #2833 --- com.woltlab.wcf/templates/categoryArticleList.tpl | 2 +- com.woltlab.wcf/templates/categoryTrophyList.tpl | 4 ++-- .../lib/system/category/ArticleCategoryType.class.php | 8 ++++++++ .../lib/system/category/TrophyCategoryType.class.php | 8 ++++++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/com.woltlab.wcf/templates/categoryArticleList.tpl b/com.woltlab.wcf/templates/categoryArticleList.tpl index 0bab7c3203..b4ff17be1f 100644 --- a/com.woltlab.wcf/templates/categoryArticleList.tpl +++ b/com.woltlab.wcf/templates/categoryArticleList.tpl @@ -1,7 +1,7 @@ {capture assign='pageTitle'}{$category->getTitle()}{/capture} {capture assign='contentTitle'}{$category->getTitle()}{/capture} -{capture assign='contentDescription'}{$category->getDescription()}{/capture} +{capture assign='contentDescription'}{if $category->descriptionUseHtml}{@$category->getDescription()}{else}{$category->getDescription()}{/if}{/capture} {capture assign='headContent'} {if $pageNo < $pages} diff --git a/com.woltlab.wcf/templates/categoryTrophyList.tpl b/com.woltlab.wcf/templates/categoryTrophyList.tpl index 424c90a358..490798b3d6 100644 --- a/com.woltlab.wcf/templates/categoryTrophyList.tpl +++ b/com.woltlab.wcf/templates/categoryTrophyList.tpl @@ -5,7 +5,7 @@

{$category->getTitle()}

{if $category && $category->getDescription()} -

{$category->getDescription()}

+

{if $category->descriptionUseHtml}{@$category->getDescription()}{else}{$category->getDescription()}{/if}

{/if}
@@ -37,7 +37,7 @@ {foreach from=$objects item=trophy}
  • {@$trophy->renderTrophy(64)}
    - +

    {@$trophy->getTitle()}

    {if !$trophy->getDescription()|empty}{@$trophy->getDescription()}{/if} diff --git a/wcfsetup/install/files/lib/system/category/ArticleCategoryType.class.php b/wcfsetup/install/files/lib/system/category/ArticleCategoryType.class.php index 4497cb5304..669504c0f7 100644 --- a/wcfsetup/install/files/lib/system/category/ArticleCategoryType.class.php +++ b/wcfsetup/install/files/lib/system/category/ArticleCategoryType.class.php @@ -55,4 +55,12 @@ class ArticleCategoryType extends AbstractCategoryType { public function canEditCategory() { return WCF::getSession()->getPermission('admin.content.article.canManageCategory'); } + + /** + * @inheritDoc + * @sicne 5.2 + */ + public function supportsHtmlDescription() { + return true; + } } diff --git a/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php b/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php index 2762a87d53..7b804dada3 100644 --- a/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php +++ b/wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php @@ -72,4 +72,12 @@ class TrophyCategoryType extends AbstractCategoryType { $userTrophyAction = new UserTrophyAction($userTrophyList->getObjects(), 'delete'); $userTrophyAction->executeAction(); } + + /** + * @inheritDoc + * @sicne 5.2 + */ + public function supportsHtmlDescription() { + return true; + } } -- 2.20.1