Improved simplified html message versions
authorMarcel Werk <burntime@woltlab.com>
Sun, 31 Jul 2016 19:20:29 +0000 (21:20 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sun, 31 Jul 2016 19:20:36 +0000 (21:20 +0200)
com.woltlab.wcf/templates/searchResultList.tpl
wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php

index 361db5e9467ea56568de98d76f80420651b481ed..291d73737b1072267ba41ac169d42ad71719295b 100644 (file)
                                                        {if $message->getUserProfile() || $message->getTime() || $message->getContainerTitle()}
                                                                <ul class="inlineList dotSeparated">
                                                                        {if $message->getUserProfile()}
-                                                                               <li>
-                                                                                       {if $message->getUserProfile()->userID}
-                                                                                               <a href="{link controller='User' object=$message->getUserProfile()}{/link}" class="userLink" data-user-id="{@$message->getUserProfile()->userID}">{$message->getUserProfile()->username}</a>
-                                                                                       {else}
-                                                                                               {$message->getUserProfile()->username}
-                                                                                       {/if}
-                                                                               </li>
+                                                                               <li>{if $message->getUserProfile()->userID}<a href="{link controller='User' object=$message->getUserProfile()}{/link}" class="userLink" data-user-id="{@$message->getUserProfile()->userID}">{$message->getUserProfile()->username}</a>{else}{$message->getUserProfile()->username}{/if}</li>
                                                                        {/if}
                                                                        {if $message->getTime()}
                                                                                <li><small>{@$message->getTime()|time}</small></li>
index b71cbbcc8fd164044f0ea7b576f805bf6f8ff58f..9a0c6728317fc4639a0ee1d99cccb1f032d37456 100644 (file)
@@ -53,7 +53,7 @@ class AttachmentBBCode extends AbstractBBCode {
                }
                
                if ($attachment !== null) {
-                       if ($attachment->showAsImage() && $attachment->canViewPreview() && $parser->getOutputType() == 'text/html') {
+                       if ($attachment->showAsImage() && $attachment->canViewPreview() && ($parser->getOutputType() == 'text/html' || $parser->getOutputType() == 'text/simplified-html')) {
                                // image
                                $alignment = (isset($openingTag['attributes'][1]) ? $openingTag['attributes'][1] : '');
                                $thumbnail = (isset($openingTag['attributes'][2]) ? $openingTag['attributes'][2] : false);
@@ -72,6 +72,11 @@ class AttachmentBBCode extends AbstractBBCode {
                                        $thumbnail = true;
                                }
                                
+                               // always use thumbnail in simplified version
+                               if ($parser->getOutputType() == 'text/simplified-html') {
+                                       $thumbnail = true;
+                               }
+                               
                                // check if width is valid and the original is accessible by viewer
                                if (!$thumbnail && !$attachment->canDownload()) {
                                        $thumbnail = false;