Rename media and article bb-code template
authorCyperghost <olaf_schmitz_1@t-online.de>
Thu, 25 Jan 2024 12:56:03 +0000 (13:56 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Thu, 25 Jan 2024 12:56:03 +0000 (13:56 +0100)
com.woltlab.wcf/templates/articleBBCode.tpl [deleted file]
com.woltlab.wcf/templates/mediaBBCodeTag.tpl [deleted file]
com.woltlab.wcf/templates/shared_articleBBCode.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/shared_mediaBBCodeTag.tpl [new file with mode: 0644]
syncTemplates.json
wcfsetup/install/files/acp/templates/articleBBCode.tpl [deleted file]
wcfsetup/install/files/acp/templates/mediaBBCodeTag.tpl [deleted file]
wcfsetup/install/files/lib/system/bbcode/WoltLabSuiteArticleBBCode.class.php
wcfsetup/install/files/lib/system/bbcode/WoltLabSuiteMediaBBCode.class.php

diff --git a/com.woltlab.wcf/templates/articleBBCode.tpl b/com.woltlab.wcf/templates/articleBBCode.tpl
deleted file mode 100644 (file)
index d0445d0..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<article class="articleEmbeddedEntry embeddedContent" aria-labelledby="{$titleHash}_entryTitle{$article->articleID}">
-       <div class="embeddedContentLink">
-               <img
-                       class="embeddedContentImageElement"
-                       src="{if $article->getTeaserImage()}{$article->getTeaserImage()->getThumbnailLink('medium')}{else}{$__wcf->getStyleHandler()->getStyle()->getCoverPhotoURL()}{/if}"
-                       height="{if $article->getTeaserImage()}{$article->getTeaserImage()->getThumbnailHeight('medium')}{else}{$__wcf->getStyleHandler()->getStyle()->getCoverPhotoHeight()}{/if}"
-                       width="{if $article->getTeaserImage()}{$article->getTeaserImage()->getThumbnailWidth('medium')}{else}{$__wcf->getStyleHandler()->getStyle()->getCoverPhotoWidth()}{/if}"
-                       loading="lazy"
-                       alt="">
-
-               <div class="embeddedContentCategory">{lang}wcf.article.bbcode.type{/lang}</div>
-               
-               <h3 class="embeddedContentTitle" id="{$titleHash}_articleTitle{$article->articleID}">
-                       <a href="{$article->getLink()}" class="embeddedContentTitleLink">{$article->getTitle()}</a>
-               </h3>
-               
-               <div class="embeddedContentDescription">
-                       {@$article->getFormattedTeaser()}
-               </div>
-       </div>
-       
-       <div class="embeddedContentMeta">
-               <div class="embeddedContentMetaImage">
-                       {@$article->getUserProfile()->getAvatar()->getImageTag(32)}
-               </div>
-               
-               <div class="embeddedContentMetaContent">
-                       <div class="embeddedContentMetaAuthor">
-                               {@$article->getUserProfile()->getFormattedUsername()}
-                       </div>
-                       
-                       <div class="embeddedContentMetaTime">
-                               {time time=$article->time}
-                       </div>
-               </div>
-       </div>
-</article>
diff --git a/com.woltlab.wcf/templates/mediaBBCodeTag.tpl b/com.woltlab.wcf/templates/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}
diff --git a/com.woltlab.wcf/templates/shared_articleBBCode.tpl b/com.woltlab.wcf/templates/shared_articleBBCode.tpl
new file mode 100644 (file)
index 0000000..d0445d0
--- /dev/null
@@ -0,0 +1,37 @@
+<article class="articleEmbeddedEntry embeddedContent" aria-labelledby="{$titleHash}_entryTitle{$article->articleID}">
+       <div class="embeddedContentLink">
+               <img
+                       class="embeddedContentImageElement"
+                       src="{if $article->getTeaserImage()}{$article->getTeaserImage()->getThumbnailLink('medium')}{else}{$__wcf->getStyleHandler()->getStyle()->getCoverPhotoURL()}{/if}"
+                       height="{if $article->getTeaserImage()}{$article->getTeaserImage()->getThumbnailHeight('medium')}{else}{$__wcf->getStyleHandler()->getStyle()->getCoverPhotoHeight()}{/if}"
+                       width="{if $article->getTeaserImage()}{$article->getTeaserImage()->getThumbnailWidth('medium')}{else}{$__wcf->getStyleHandler()->getStyle()->getCoverPhotoWidth()}{/if}"
+                       loading="lazy"
+                       alt="">
+
+               <div class="embeddedContentCategory">{lang}wcf.article.bbcode.type{/lang}</div>
+               
+               <h3 class="embeddedContentTitle" id="{$titleHash}_articleTitle{$article->articleID}">
+                       <a href="{$article->getLink()}" class="embeddedContentTitleLink">{$article->getTitle()}</a>
+               </h3>
+               
+               <div class="embeddedContentDescription">
+                       {@$article->getFormattedTeaser()}
+               </div>
+       </div>
+       
+       <div class="embeddedContentMeta">
+               <div class="embeddedContentMetaImage">
+                       {@$article->getUserProfile()->getAvatar()->getImageTag(32)}
+               </div>
+               
+               <div class="embeddedContentMetaContent">
+                       <div class="embeddedContentMetaAuthor">
+                               {@$article->getUserProfile()->getFormattedUsername()}
+                       </div>
+                       
+                       <div class="embeddedContentMetaTime">
+                               {time time=$article->time}
+                       </div>
+               </div>
+       </div>
+</article>
diff --git a/com.woltlab.wcf/templates/shared_mediaBBCodeTag.tpl b/com.woltlab.wcf/templates/shared_mediaBBCodeTag.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}
index c89b4971b64b3daf78d2b85c55d488916932fb27..33b51411ac05f7649d8368db6255339d1b0c3885 100644 (file)
@@ -62,7 +62,6 @@
     "aclPermissionJavaScript",
     "aclSimple",
     "articleAddDialog",
-    "articleBBCode",
     "benchmark",
     "booleanOptionType",
     "booleanSearchableOptionType",
@@ -79,7 +78,6 @@
     "formSuccess",
     "languageChooser",
     "lineBreakSeparatedTextOptionType",
-    "mediaBBCodeTag",
     "mediaManager",
     "messageFormAttachments",
     "messageTableOfContents",
diff --git a/wcfsetup/install/files/acp/templates/articleBBCode.tpl b/wcfsetup/install/files/acp/templates/articleBBCode.tpl
deleted file mode 100644 (file)
index d0445d0..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<article class="articleEmbeddedEntry embeddedContent" aria-labelledby="{$titleHash}_entryTitle{$article->articleID}">
-       <div class="embeddedContentLink">
-               <img
-                       class="embeddedContentImageElement"
-                       src="{if $article->getTeaserImage()}{$article->getTeaserImage()->getThumbnailLink('medium')}{else}{$__wcf->getStyleHandler()->getStyle()->getCoverPhotoURL()}{/if}"
-                       height="{if $article->getTeaserImage()}{$article->getTeaserImage()->getThumbnailHeight('medium')}{else}{$__wcf->getStyleHandler()->getStyle()->getCoverPhotoHeight()}{/if}"
-                       width="{if $article->getTeaserImage()}{$article->getTeaserImage()->getThumbnailWidth('medium')}{else}{$__wcf->getStyleHandler()->getStyle()->getCoverPhotoWidth()}{/if}"
-                       loading="lazy"
-                       alt="">
-
-               <div class="embeddedContentCategory">{lang}wcf.article.bbcode.type{/lang}</div>
-               
-               <h3 class="embeddedContentTitle" id="{$titleHash}_articleTitle{$article->articleID}">
-                       <a href="{$article->getLink()}" class="embeddedContentTitleLink">{$article->getTitle()}</a>
-               </h3>
-               
-               <div class="embeddedContentDescription">
-                       {@$article->getFormattedTeaser()}
-               </div>
-       </div>
-       
-       <div class="embeddedContentMeta">
-               <div class="embeddedContentMetaImage">
-                       {@$article->getUserProfile()->getAvatar()->getImageTag(32)}
-               </div>
-               
-               <div class="embeddedContentMetaContent">
-                       <div class="embeddedContentMetaAuthor">
-                               {@$article->getUserProfile()->getFormattedUsername()}
-                       </div>
-                       
-                       <div class="embeddedContentMetaTime">
-                               {time time=$article->time}
-                       </div>
-               </div>
-       </div>
-</article>
diff --git a/wcfsetup/install/files/acp/templates/mediaBBCodeTag.tpl b/wcfsetup/install/files/acp/templates/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 6ef1b7f87d4babb590ffd68708f008bd9458727a..0c95c709b3c13f32a4675c0a8cb7f0855a715510 100644 (file)
@@ -4,6 +4,7 @@ namespace wcf\system\bbcode;
 
 use wcf\data\article\ViewableArticle;
 use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
+use wcf\system\template\SharedTemplateEngine;
 use wcf\system\WCF;
 use wcf\util\StringUtil;
 
@@ -40,7 +41,7 @@ final class WoltLabSuiteArticleBBCode extends AbstractBBCode
                 'message' => WCF::getLanguage()->getDynamicVariable('wcf.message.content.no.permission.title')
             ], true);
         } elseif ($parser->getOutputType() == 'text/html') {
-            return WCF::getTPL()->fetch('articleBBCode', 'wcf', [
+            return SharedTemplateEngine::getInstance()->fetch('shared_articleBBCode', 'wcf', [
                 'article' => $article,
                 'articleID' => $article->articleID,
                 'titleHash' => \substr(StringUtil::getRandomID(), 0, 8),
index 7c27b49b56aed1128f8d23e8a36709e7013cfa0f..8367503edb089eccf57fdd919bc7a32f43e99869 100644 (file)
@@ -5,6 +5,7 @@ namespace wcf\system\bbcode;
 use wcf\data\media\ViewableMedia;
 use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
 use wcf\system\request\LinkHandler;
+use wcf\system\template\SharedTemplateEngine;
 use wcf\system\WCF;
 use wcf\util\StringUtil;
 
@@ -66,7 +67,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('mediaBBCodeTag', 'wcf', [
+                    return SharedTemplateEngine::getInstance()->fetch('shared_mediaBBCodeTag', 'wcf', [
                         'mediaLink' => $this->getLink($media),
                         'removeLinks' => $removeLinks,
                         'thumbnailLink' => $thumbnailSize !== 'original' ? $this->getThumbnailLink(
@@ -79,7 +80,7 @@ final class WoltLabSuiteMediaBBCode extends AbstractBBCode
                         'width' => $width,
                     ]);
                 } elseif ($media->isVideo() || $media->isAudio()) {
-                    return WCF::getTPL()->fetch('mediaBBCodeTag', 'wcf', [
+                    return SharedTemplateEngine::getInstance()->fetch('shared_mediaBBCodeTag', 'wcf', [
                         'mediaLink' => $this->getLink($media),
                         'removeLinks' => $removeLinks,
                         'float' => 'none',