Applied suggestions
authorMarcel Werk <burntime@woltlab.com>
Fri, 7 Aug 2020 08:28:47 +0000 (10:28 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 7 Aug 2020 08:28:47 +0000 (10:28 +0200)
com.woltlab.wcf/templates/__menu.tpl
com.woltlab.wcf/templates/userInformationButtons.tpl
wcfsetup/install/files/lib/data/article/content/ArticleContent.class.php
wcfsetup/install/files/lib/data/box/content/BoxContent.class.php
wcfsetup/install/files/lib/data/page/content/PageContent.class.php
wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php
wcfsetup/install/files/lib/system/template/plugin/AnchorAttributesFunctionTemplatePlugin.class.php

index aec0b7c40636e01ab42e8af0170c6e67a03b6eff..5bdd92d00db4a1fdf96d092d29bff0fd408d455a 100644 (file)
@@ -4,7 +4,7 @@
                
                {foreach from=$menuItemNodeList item=menuItemNode}
                        <li class="{if $menuItemNode->isActiveNode()}active{/if}{if $menuItemNode->hasChildren()} boxMenuHasChildren{/if}" data-identifier="{@$menuItemNode->identifier}">
-                               <a href="{$menuItemNode->getURL()}" class="boxMenuLink"{anchorAttributes url=$menuItemNode->getURL() appendClassname=false}{if $menuItemNode->isActiveNode()} aria-current="page"{/if}>
+                               <a {anchorAttributes url=$menuItemNode->getURL() appendClassname=false} class="boxMenuLink"{if $menuItemNode->isActiveNode()} aria-current="page"{/if}>
                                        <span class="boxMenuLinkTitle">{$menuItemNode->getTitle()}</span>
                                        {if $menuItemNode->getOutstandingItems() > 0}
                                                <span class="boxMenuLinkOutstandingItems badge badgeUpdate" aria-label="{lang}wcf.page.menu.outstandingItems{/lang}">{#$menuItemNode->getOutstandingItems()}</span>
index 0a5c4093223de43ed746195d874351aeae6e2628..066564ce60602b13852914283dd8e130ce97a58f 100644 (file)
@@ -3,7 +3,7 @@
                <ul class="buttonList iconList">
                        {content}
                                {if $user->homepage && $user->homepage != 'http://'}
-                                       <li><a class="jsTooltip" title="{lang}wcf.user.option.homepage{/lang}" {anchorAttributes url=$user->homepage appendClassname=false  isUgc=true}><span class="icon icon16 fa-home"></span> <span class="invisible">{lang}wcf.user.option.homepage{/lang}</span></a></li>
+                                       <li><a class="jsTooltip" title="{lang}wcf.user.option.homepage{/lang}" {anchorAttributes url=$user->homepage appendClassname=false isUgc=true}><span class="icon icon16 fa-home"></span> <span class="invisible">{lang}wcf.user.option.homepage{/lang}</span></a></li>
                                {/if}
                                
                                {if $user->userID != $__wcf->user->userID}
index f5216fdcbf8b1954981688fd317dae1812f91790..b2b200597ab855530620908df287d9b8658e499e 100644 (file)
@@ -81,7 +81,7 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo
                else {
                        $htmlOutputProcessor = new HtmlOutputProcessor();
                        $htmlOutputProcessor->setOutputType('text/plain');
-                       $htmlOutputProcessor->enableUgc(false);
+                       $htmlOutputProcessor->setUgc(false);
                        $htmlOutputProcessor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID, false, $this->languageID);
                        
                        return nl2br(StringUtil::encodeHTML(StringUtil::truncate($htmlOutputProcessor->getHtml(), 500)), false);
@@ -95,7 +95,7 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo
         */
        public function getFormattedContent() {
                $processor = new HtmlOutputProcessor();
-               $processor->enableUgc(false);
+               $processor->setUgc(false);
                $processor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID, false, $this->languageID);
                
                return $processor->getHtml();
@@ -108,7 +108,7 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo
         */
        public function getAmpFormattedContent() {
                $processor = new AmpHtmlOutputProcessor();
-               $processor->enableUgc(false);
+               $processor->setUgc(false);
                $processor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID);
                
                return $processor->getHtml();
@@ -152,7 +152,7 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo
                        case 'text/plain':
                                $processor = new HtmlOutputProcessor();
                                $processor->setOutputType('text/plain');
-                               $processor->enableUgc(false);
+                               $processor->setUgc(false);
                                $processor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID);
                                
                                return $processor->getHtml();
@@ -160,7 +160,7 @@ class ArticleContent extends DatabaseObject implements ILinkableObject, IRouteCo
                                // parse and return message
                                $processor = new HtmlOutputProcessor();
                                $processor->setOutputType('text/simplified-html');
-                               $processor->enableUgc(false);
+                               $processor->setUgc(false);
                                $processor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID);
                                
                                return $processor->getHtml();
index d8ab70f7d7bcb7337ec9af1fb97017ca19b058ef..29b055fa50f029faf1e5d0b850cce3395c256a79 100644 (file)
@@ -103,7 +103,7 @@ class BoxContent extends DatabaseObject {
         */
        public function getFormattedContent() {
                $processor = new HtmlOutputProcessor();
-               $processor->enableUgc(false);
+               $processor->setUgc(false);
                $processor->process($this->content, 'com.woltlab.wcf.box.content', $this->boxContentID);
                
                return $processor->getHtml();
index dbb4e95b0ecc6eaefd36e70516f0e74a6266ac23..956559b1ad722d5b2a930557d54f90f459afa286 100644 (file)
@@ -47,7 +47,7 @@ class PageContent extends DatabaseObject implements ILinkableObject {
                MessageEmbeddedObjectManager::getInstance()->loadObjects('com.woltlab.wcf.page.content', [$this->pageContentID]);
                
                $processor = new HtmlOutputProcessor();
-               $processor->enableUgc(false);
+               $processor->setUgc(false);
                $processor->process($this->content, 'com.woltlab.wcf.page.content', $this->pageContentID);
                
                return $processor->getHtml();
index e414efc56698b7b153d140b2663104344305045e..6264184058597679a38ad7c90a6c4f31f5c6d2c6 100644 (file)
@@ -125,7 +125,7 @@ class HtmlOutputProcessor extends AbstractHtmlProcessor {
         * 
         * @param bool $enable
         */
-       public function enableUgc($enable = true) {
+       public function setUgc($enable = true) {
                $this->ugc = $enable;
        }
        
index 4fc465095a466289ffa404321e4b655ec3cc7b9a..554816513562b604c1d0bf436f8b9a59ab5d12ac 100644 (file)
@@ -9,14 +9,14 @@ use wcf\util\StringUtil;
  * Template function plugin which generates attributes for `a` HTML elements.
  *
  * Required parameter:
- *     `url` (string)
+ *      `url` (string)
  * Optional parameter:
  *      `appendHref` (bool, default true)
- *     `appendClassname` (bool, default true)
+ *      `appendClassname` (bool, default true)
  *      `isUgc` (bool, default false)
  *
  * Usage:
- *     {anchorAttributes url=$url}
+ *      {anchorAttributes url=$url}
  *
  * @author     Marcel Werk
  * @copyright  2001-2020 WoltLab GmbH
@@ -56,7 +56,7 @@ class AnchorAttributesFunctionTemplatePlugin implements IFunctionTemplatePlugin
                        $rel = 'nofollow';
                        if (EXTERNAL_LINK_TARGET_BLANK) {
                                $rel .= ' noopener noreferrer';
-                               $attributes .= 'target="_blank"';
+                               $attributes .= ' target="_blank"';
                        }
                        if ($isUgc) {
                                $rel .= ' ugc';