Rename attach bbcode templates
authorCyperghost <olaf_schmitz_1@t-online.de>
Mon, 29 Jan 2024 10:57:34 +0000 (11:57 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Mon, 29 Jan 2024 10:57:34 +0000 (11:57 +0100)
com.woltlab.wcf/templateDelete.xml
com.woltlab.wcf/templates/__audioAttachmentBBCode.tpl [deleted file]
com.woltlab.wcf/templates/__videoAttachmentBBCode.tpl [deleted file]
com.woltlab.wcf/templates/shared_bbcode_attach_audio.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/shared_bbcode_attach_video.tpl [new file with mode: 0644]
wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php

index e0c4d3b9ee1b425fff64fdd1ee3f06bfbc606c3f..ec31b73aba110b0180f55971e4be037235e38a07 100644 (file)
                <template>userOptionsCondition</template>
                <template>worker</template>
                <template>wysiwyg</template>
+               <template>groupBBCodeTag</template>
+               <template>__videoAttachmentBBCode</template>
+               <template>__audioAttachmentBBCode</template>
        </delete>
 </data>
diff --git a/com.woltlab.wcf/templates/__audioAttachmentBBCode.tpl b/com.woltlab.wcf/templates/__audioAttachmentBBCode.tpl
deleted file mode 100644 (file)
index 1adb76e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<span class="mediaBBCode">
-       <audio src="{$attachment->getLink()}" style="display: none;" id="attachmentAudio_{$attachmentIdentifier}" controls></audio>
-       
-       <span class="mediaBBCodeCaption">
-               <a href="{$attachment->getLink()}">{$attachment->filename}</a>
-       </span>
-</span>
-
-<script data-relocate="true">
-       (function () {
-               {* try to determine if browser might be able to play audio *}
-               var audio = elById('attachmentAudio_{@$attachmentIdentifier}');
-               var canPlayType = audio.canPlayType('{$attachment->fileType}');
-               
-               if (canPlayType === '') {
-                       elRemove(audio);
-               }
-               else {
-                       elShow(audio);
-               }
-       })();
-</script>
diff --git a/com.woltlab.wcf/templates/__videoAttachmentBBCode.tpl b/com.woltlab.wcf/templates/__videoAttachmentBBCode.tpl
deleted file mode 100644 (file)
index 2521c6c..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<span class="mediaBBCode">
-       <video src="{$attachment->getLink()}" style="display: none;" id="attachmentVideo_{$attachmentIdentifier}" controls></video>
-       
-       <span class="mediaBBCodeCaption">
-               <a href="{$attachment->getLink()}">{$attachment->filename}</a>
-       </span>
-</span>
-
-<script data-relocate="true">
-       (function () {
-               {* try to determine if browser might be able to play video *}
-               var video = elById('attachmentVideo_{@$attachmentIdentifier}');
-               var canPlayType = video.canPlayType('{$attachment->fileType}');
-               
-               if (canPlayType === '') {
-                       elRemove(video);
-               }
-               else {
-                       elShow(video);
-               }
-       })();
-</script>
diff --git a/com.woltlab.wcf/templates/shared_bbcode_attach_audio.tpl b/com.woltlab.wcf/templates/shared_bbcode_attach_audio.tpl
new file mode 100644 (file)
index 0000000..1adb76e
--- /dev/null
@@ -0,0 +1,22 @@
+<span class="mediaBBCode">
+       <audio src="{$attachment->getLink()}" style="display: none;" id="attachmentAudio_{$attachmentIdentifier}" controls></audio>
+       
+       <span class="mediaBBCodeCaption">
+               <a href="{$attachment->getLink()}">{$attachment->filename}</a>
+       </span>
+</span>
+
+<script data-relocate="true">
+       (function () {
+               {* try to determine if browser might be able to play audio *}
+               var audio = elById('attachmentAudio_{@$attachmentIdentifier}');
+               var canPlayType = audio.canPlayType('{$attachment->fileType}');
+               
+               if (canPlayType === '') {
+                       elRemove(audio);
+               }
+               else {
+                       elShow(audio);
+               }
+       })();
+</script>
diff --git a/com.woltlab.wcf/templates/shared_bbcode_attach_video.tpl b/com.woltlab.wcf/templates/shared_bbcode_attach_video.tpl
new file mode 100644 (file)
index 0000000..2521c6c
--- /dev/null
@@ -0,0 +1,22 @@
+<span class="mediaBBCode">
+       <video src="{$attachment->getLink()}" style="display: none;" id="attachmentVideo_{$attachmentIdentifier}" controls></video>
+       
+       <span class="mediaBBCodeCaption">
+               <a href="{$attachment->getLink()}">{$attachment->filename}</a>
+       </span>
+</span>
+
+<script data-relocate="true">
+       (function () {
+               {* try to determine if browser might be able to play video *}
+               var video = elById('attachmentVideo_{@$attachmentIdentifier}');
+               var canPlayType = video.canPlayType('{$attachment->fileType}');
+               
+               if (canPlayType === '') {
+                       elRemove(video);
+               }
+               else {
+                       elShow(video);
+               }
+       })();
+</script>
index 78726ce35869be72b0542bcbb38b96e49940a11b..8c120dc846e59f215f4da9b504d669cd9e79e285 100644 (file)
@@ -253,7 +253,7 @@ final class AttachmentBBCode extends AbstractBBCode
 
     private function showVideoPlayer(Attachment $attachment): string
     {
-        return WCF::getTPL()->fetch('__videoAttachmentBBCode', 'wcf', [
+        return WCF::getTPL()->fetch('shared_bbcode_attach_video', 'wcf', [
             'attachment' => $attachment,
             'attachmentIdentifier' => StringUtil::getRandomID(),
         ]);
@@ -261,7 +261,7 @@ final class AttachmentBBCode extends AbstractBBCode
 
     private function showAudioPlayer(Attachment $attachment): string
     {
-        return WCF::getTPL()->fetch('__audioAttachmentBBCode', 'wcf', [
+        return WCF::getTPL()->fetch('shared_bbcode_attach_audio', 'wcf', [
             'attachment' => $attachment,
             'attachmentIdentifier' => StringUtil::getRandomID(),
         ]);