-<img src="{if $thumbnailSize == 'original'}{$media->getLink()}{else}{$media->getThumbnailLink($thumbnailSize)}{/if}" alt="{$media->getTitle()}"{if $float != 'none'} class="messageFloatObject{$float|ucfirst}"{/if}>
\ No newline at end of file
+<figure class="mediaBBCode{if $float != 'none'} messageFloatObject{$float|ucfirst}{/if}">
+ {if $thumbnailSize != 'original'}
+ <a href="{$media->getLink()}" class="embeddedAttachmentLink jsImageViewer"><img src="{$media->getThumbnailLink($thumbnailSize)}" alt="{$media->altText}" title="{$media->title}"></a>
+ {else}
+ <img src="{$media->getLink()}" alt="{$media->altText}" title="{$media->title}">
+ {/if}
+
+ {if $media->caption}
+ <figcaption>{$media->caption}</figcaption>
+ {/if}
+</figure>
--- /dev/null
+<?php
+namespace wcf\system\cache\runtime;
+use wcf\data\media\ViewableMedia;
+use wcf\data\media\ViewableMediaList;
+
+/**
+ * Runtime cache implementation for viewable media.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2016 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Cache\Runtime
+ * @since 3.0
+ *
+ * @method ViewableMedia[] getCachedObjects()
+ * @method ViewableMedia getObject($objectID)
+ * @method ViewableMedia[] getObjects(array $objectIDs)
+ */
+class ViewableMediaRuntimeCache extends AbstractRuntimeCache {
+ /**
+ * @inheritDoc
+ */
+ protected $listClassName = ViewableMediaList::class;
+}
namespace wcf\system\message\embedded\object;
use wcf\data\media\Media;
use wcf\data\media\MediaList;
-use wcf\system\cache\runtime\MediaRuntimeCache;
+use wcf\system\cache\runtime\ViewableMediaRuntimeCache;
use wcf\system\html\input\HtmlInputProcessor;
use wcf\util\ArrayUtil;
* @inheritDoc
*/
public function loadObjects(array $objectIDs) {
- return MediaRuntimeCache::getInstance()->getObjects($objectIDs);
+ return ViewableMediaRuntimeCache::getInstance()->getObjects($objectIDs);
}
/**
--- /dev/null
+.mediaBBCode {
+ display: inline-block;
+
+ figcaption {
+ color: $wcfContentDimmedText;
+ margin-top: 5px;
+ text-align: center;
+
+ @include wcfFontSmall;
+ }
+}