Rename media bbcode template
authorCyperghost <olaf_schmitz_1@t-online.de>
Mon, 29 Jan 2024 10:52:35 +0000 (11:52 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Mon, 29 Jan 2024 10:52:35 +0000 (11:52 +0100)
com.woltlab.wcf/templates/shared_bbcode_wsm.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/shared_mediaBBCodeTag.tpl [deleted file]
wcfsetup/install/files/lib/system/bbcode/WoltLabSuiteMediaBBCode.class.php

diff --git a/com.woltlab.wcf/templates/shared_bbcode_wsm.tpl b/com.woltlab.wcf/templates/shared_bbcode_wsm.tpl
new file mode 100644 (file)
index 0000000..b536509
--- /dev/null
@@ -0,0 +1,37 @@
+{if !$removeLinks|isset}{assign var='removeLinks' value=false}{/if}
+{if $float === 'center'}<p class="text-center">{/if}
+<span class="mediaBBCode{if $float != 'none'} messageFloatObject{$float|ucfirst}{/if}"{if $width !== 'auto'} style="width: {$width}px; display: inline-flex"{/if}>
+       {if $media->isImage}
+               {if $thumbnailSize != 'original'}
+                       {if !$removeLinks}
+                               <a href="{$mediaLink}" class="embeddedAttachmentLink jsImageViewer">
+                       {/if}
+                                       <img src="{$thumbnailLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->getThumbnailWidth($thumbnailSize)}" height="{@$media->getThumbnailHeight($thumbnailSize)}" loading="lazy">
+                       {if !$removeLinks}
+                                       <span class="embeddedAttachmentLinkEnlarge">
+                                               {icon size=24 name='magnifying-glass'}
+                                       </span>
+                               </a>
+                       {/if}
+               {else}
+                       <img src="{$mediaLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->width}" height="{@$media->height}" loading="lazy">
+               {/if}
+       {elseif $media->isVideo()}
+               <video src="{$mediaLink}" controls></video>
+       {elseif $media->isAudio()}
+               <audio src="{$mediaLink}" controls></audio>
+       {/if}
+
+       {if $media->caption}
+               <span class="mediaBBCodeCaption">
+                       <span class="mediaBBCodeCaptionAlignment">
+                               {if $media->captionEnableHtml}
+                                       {@$media->caption}
+                               {else}
+                                       {$media->caption}
+                               {/if}
+                       </span>
+               </span>
+       {/if}
+</span>
+{if $float === 'center'}</p>{/if}
diff --git a/com.woltlab.wcf/templates/shared_mediaBBCodeTag.tpl b/com.woltlab.wcf/templates/shared_mediaBBCodeTag.tpl
deleted file mode 100644 (file)
index b536509..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-{if !$removeLinks|isset}{assign var='removeLinks' value=false}{/if}
-{if $float === 'center'}<p class="text-center">{/if}
-<span class="mediaBBCode{if $float != 'none'} messageFloatObject{$float|ucfirst}{/if}"{if $width !== 'auto'} style="width: {$width}px; display: inline-flex"{/if}>
-       {if $media->isImage}
-               {if $thumbnailSize != 'original'}
-                       {if !$removeLinks}
-                               <a href="{$mediaLink}" class="embeddedAttachmentLink jsImageViewer">
-                       {/if}
-                                       <img src="{$thumbnailLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->getThumbnailWidth($thumbnailSize)}" height="{@$media->getThumbnailHeight($thumbnailSize)}" loading="lazy">
-                       {if !$removeLinks}
-                                       <span class="embeddedAttachmentLinkEnlarge">
-                                               {icon size=24 name='magnifying-glass'}
-                                       </span>
-                               </a>
-                       {/if}
-               {else}
-                       <img src="{$mediaLink}" alt="{$media->altText}" title="{$media->title}" width="{@$media->width}" height="{@$media->height}" loading="lazy">
-               {/if}
-       {elseif $media->isVideo()}
-               <video src="{$mediaLink}" controls></video>
-       {elseif $media->isAudio()}
-               <audio src="{$mediaLink}" controls></audio>
-       {/if}
-
-       {if $media->caption}
-               <span class="mediaBBCodeCaption">
-                       <span class="mediaBBCodeCaptionAlignment">
-                               {if $media->captionEnableHtml}
-                                       {@$media->caption}
-                               {else}
-                                       {$media->caption}
-                               {/if}
-                       </span>
-               </span>
-       {/if}
-</span>
-{if $float === 'center'}</p>{/if}
index 258f903e7564cf5a3cf87090e7ad710652ab6259..b1ce57c908d9927b074f38d9200095ce1bd9c5b8 100644 (file)
@@ -66,7 +66,7 @@ final class WoltLabSuiteMediaBBCode extends AbstractBBCode
                     $float = (!empty($openingTag['attributes'][2])) ? $openingTag['attributes'][2] : 'none';
                     $width = (!empty($openingTag['attributes'][3])) ? $openingTag['attributes'][3] : 'auto';
 
-                    return WCF::getTPL()->fetch('shared_mediaBBCodeTag', 'wcf', [
+                    return WCF::getTPL()->fetch('shared_bbcode_wsm', 'wcf', [
                         'mediaLink' => $this->getLink($media),
                         'removeLinks' => $removeLinks,
                         'thumbnailLink' => $thumbnailSize !== 'original' ? $this->getThumbnailLink(
@@ -79,7 +79,7 @@ final class WoltLabSuiteMediaBBCode extends AbstractBBCode
                         'width' => $width,
                     ]);
                 } elseif ($media->isVideo() || $media->isAudio()) {
-                    return WCF::getTPL()->fetch('shared_mediaBBCodeTag', 'wcf', [
+                    return WCF::getTPL()->fetch('shared_bbcode_wsm', 'wcf', [
                         'mediaLink' => $this->getLink($media),
                         'removeLinks' => $removeLinks,
                         'float' => 'none',