Add support for HTML in article and trophy category descriptions
authorMatthias Schmidt <gravatronics@live.com>
Mon, 4 Mar 2019 17:31:00 +0000 (18:31 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 4 Mar 2019 17:31:00 +0000 (18:31 +0100)
See #2833

com.woltlab.wcf/templates/categoryArticleList.tpl
com.woltlab.wcf/templates/categoryTrophyList.tpl
wcfsetup/install/files/lib/system/category/ArticleCategoryType.class.php
wcfsetup/install/files/lib/system/category/TrophyCategoryType.class.php

index 0bab7c32031caa6c897d409356c4adb72e5e78bf..b4ff17be1f50115701af9eb019ad676ff2c0af51 100644 (file)
@@ -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}
index 424c90a35818e7eddf01177f957d90013595f633..490798b3d6ae1985c7af14ddffd8823d9b887949 100644 (file)
@@ -5,7 +5,7 @@
                <div class="contentHeaderTitle">
                        <h1 class="contentTitle">{$category->getTitle()}</h1>
                        {if $category && $category->getDescription()}
-                               <p class="contentHeaderDescription">{$category->getDescription()}</p>
+                               <p class="contentHeaderDescription">{if $category->descriptionUseHtml}{@$category->getDescription()}{else}{$category->getDescription()}{/if}</p>
                        {/if}
                </div>
        </header>
@@ -37,7 +37,7 @@
                                {foreach from=$objects item=trophy}
                                        <li class="box64">
                                                <div>{@$trophy->renderTrophy(64)}</div>
-
+                                               
                                                <div class="sidebarItemTitle">
                                                        <h3><a href="{$trophy->getLink()}">{@$trophy->getTitle()}</a></h3>
                                                        {if !$trophy->getDescription()|empty}<small>{@$trophy->getDescription()}</small>{/if}
index 4497cb53041bfe1782ca5fc850988a317d6c54bc..669504c0f73a412b02794123664b556f6acf2e53 100644 (file)
@@ -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;
+       }
 }
index 2762a87d53e06ecbdb457370d7b9c1cf9008cfb2..7b804dada3e436ad3bd37e7b167a031b777cd970 100644 (file)
@@ -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;
+       }
 }