Disable newlines in trophy description
authorJoshua Rüsweg <josh@bastelstu.be>
Fri, 4 Aug 2017 14:11:27 +0000 (16:11 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Fri, 4 Aug 2017 14:11:27 +0000 (16:11 +0200)
See #2315

com.woltlab.wcf/templates/groupedUserTrophyList.tpl
com.woltlab.wcf/templates/trophy.tpl
com.woltlab.wcf/templates/trophyList.tpl
wcfsetup/install/files/acp/templates/trophyAdd.tpl
wcfsetup/install/files/acp/templates/userTrophyAdd.tpl
wcfsetup/install/files/lib/data/trophy/Trophy.class.php
wcfsetup/install/files/lib/data/user/trophy/UserTrophy.class.php

index 944c01eab609319911914533c345ac378f8078c1..48cb1fe66894a18d37cae099d7ff0c5ff449dac5 100644 (file)
@@ -7,7 +7,7 @@
 
                                        <div class="containerHeadline">
                                                <h3><a href="{link controller='Trophy' object=$userTrophy->getTrophy()}{/link}">{@$userTrophy->getTrophy()->getTitle()}</a></h3>
-                                               <small>{@$userTrophy->getDescription()} - {@$userTrophy->time|time}</small>
+                                               <small>{$userTrophy->getDescription()} - {@$userTrophy->time|time}</small>
                                        </div>
                                </div>
                        </li>
index a22edac15154d048fca6255dc56a6f9d24e6d31a..f238c92bf7f0004ad815c20f545413f299765b0d 100644 (file)
@@ -18,7 +18,7 @@
                <div class="contentHeaderTitle">
                        <h1 class="contentTitle">{$trophy->getTitle()}</h1>
                        <ul class="inlineList contentHeaderMetaData">
-                               <li>{@$trophy->getDescription()}</li>
+                               <li>{$trophy->getDescription()}</li>
                                <li><span class="icon icon16 fa-users"></span> {@$items}</li>
                        </ul>
                </div>
@@ -43,7 +43,7 @@
 
                                <div class="sidebarItemTitle">
                                        <h3>{@$userTrophy->getUserProfile()->getAnchorTag()}</h3>
-                                       <small>{@$userTrophy->getDescription()} – {@$userTrophy->time|time}</small>
+                                       <small>{$userTrophy->getDescription()} – {@$userTrophy->time|time}</small>
                                </div>
                        </li>
                {/foreach}
index f97ab713ecee8f51d879b31b9450b08c29bb6c1a..a023888bc6fa0e35b8aa889059ba8b1ec828f462 100644 (file)
@@ -52,7 +52,7 @@
 
                                                <div class="sidebarItemTitle">
                                                        <h3><a href="{$trophy->getLink()}">{@$trophy->getTitle()}</a></h3>
-                                                       <small>{@$trophy->getDescription()}</small>
+                                                       <small>{$trophy->getDescription()}</small>
                                                </div>
                                        </li>
                                {/foreach}
index f598edabf8dff3299fe86180f3d85e2517fe9a1a..2e031e2977cd413dc5ae28c5d4535c855e4b6eab 100644 (file)
                                </dd>
                        </dl>
                        {include file='multipleLanguageInputJavascript' elementIdentifier='title' forceSelection=false}
-                       
+
                        <dl{if $errorField == 'description'} class="formError"{/if}>
                                <dt><label for="description">{lang}wcf.acp.trophy.description{/lang}</label></dt>
                                <dd>
-                                       <textarea id="description" name="description" cols="40" rows="10">{$i18nPlainValues[description]}</textarea>
+                                       <input id="description" name="description" type="text" value="{$i18nPlainValues[description]}">
                                        {if $errorField == 'description'}
                                                <small class="innerError">
                                                        {if $errorType == 'empty'}
index ea5762ee5b701f6ab1c5e77c9780b7fdc995370b..3d885bfca52e59e1e9ed08c66dcc3e9cf013083e 100644 (file)
                                <label><input type="checkbox" name="useCustomDescription" value="1"{if $useCustomDescription} checked{/if}> {lang}wcf.acp.trophy.userTrophy.useCustomDescription{/lang}</label>
                        </dd>
                </dl>
-
-
+               
                <dl id="userTrophyDescriptionDL"{if $errorField == 'description'} class="formError"{/if}{if !$useCustomDescription} style="display: none;"{/if}>
                        <dt><label for="description">{lang}wcf.acp.trophy.description{/lang}</label></dt>
                        <dd>
-                               <textarea id="description" name="description" cols="40" rows="10">{$i18nPlainValues[description]}</textarea>
+                               <input id="description" name="description" type="text" value="{$i18nPlainValues[description]}">
                                {if $errorField == 'description'}
                                        <small class="innerError">
                                                {if $errorType == 'empty'}
index ac86bbf9daccf41a2aee3f07649bfb0a6ab40a4f..5405f53f784adfc47d1878c1241fab95747f4f12 100644 (file)
@@ -144,7 +144,7 @@ class Trophy extends DatabaseObject implements ITitledLinkObject, IRouteControll
         * @return      string
         */
        public function getDescription() {
-               return nl2br(StringUtil::encodeHTML(WCF::getLanguage()->get($this->description)), false); 
+               return WCF::getLanguage()->get($this->description);
        }
        
        /**
index 65f2669f80ad3d6a9e9d87fd5d5ea4ab08c8d230..d496cdad17d7590ef44a757fdf7ad3ff6b94538d 100644 (file)
@@ -67,7 +67,7 @@ class UserTrophy extends DatabaseObject {
                        return $this->getTrophy()->getDescription();
                }
                
-               return nl2br(StringUtil::encodeHTML(strtr($this->description, $this->getReplacements())));
+               return strtr(WCF::getLanguage()->get($this->description), $this->getReplacements());
        }
        
        /**