From 030f0a11f5bf35a1e2f4740b0f91cc6d033a2c3b Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Wed, 23 Oct 2024 09:54:47 +0200 Subject: [PATCH] Move template `imageViewer` to shared templates --- com.woltlab.wcf/acpTemplateDelete.xml | 1 + com.woltlab.wcf/fileDelete.xml | 1 + com.woltlab.wcf/templateDelete.xml | 1 + com.woltlab.wcf/templates/imageViewer.tpl | 35 ------------------- .../templates/shared_imageViewer.tpl | 18 ++++++++++ extra/migrate-shared-template.php | 1 + .../files/acp/templates/attachmentList.tpl | 3 +- .../files/acp/templates/imageViewer.tpl | 21 ----------- .../install/files/acp/templates/styleAdd.tpl | 2 ++ .../system/template/TemplateEngine.class.php | 1 + 10 files changed, 27 insertions(+), 57 deletions(-) delete mode 100644 com.woltlab.wcf/templates/imageViewer.tpl create mode 100644 com.woltlab.wcf/templates/shared_imageViewer.tpl delete mode 100644 wcfsetup/install/files/acp/templates/imageViewer.tpl diff --git a/com.woltlab.wcf/acpTemplateDelete.xml b/com.woltlab.wcf/acpTemplateDelete.xml index 5552c719d5..f3bc3dd87c 100644 --- a/com.woltlab.wcf/acpTemplateDelete.xml +++ b/com.woltlab.wcf/acpTemplateDelete.xml @@ -154,5 +154,6 @@ + diff --git a/com.woltlab.wcf/fileDelete.xml b/com.woltlab.wcf/fileDelete.xml index 37f95956d5..faaea3e50d 100644 --- a/com.woltlab.wcf/fileDelete.xml +++ b/com.woltlab.wcf/fileDelete.xml @@ -1291,6 +1291,7 @@ js/WCF.Comment.min.js js/WCF.Core.min.js js/WCF.ImageViewer.min.js + js/WCF.ImageViewer.js js/WCF.Label.min.js js/WCF.Like.js js/WCF.Like.min.js diff --git a/com.woltlab.wcf/templateDelete.xml b/com.woltlab.wcf/templateDelete.xml index 054f501b38..b173661dd9 100644 --- a/com.woltlab.wcf/templateDelete.xml +++ b/com.woltlab.wcf/templateDelete.xml @@ -116,5 +116,6 @@ + diff --git a/com.woltlab.wcf/templates/imageViewer.tpl b/com.woltlab.wcf/templates/imageViewer.tpl deleted file mode 100644 index bee3370972..0000000000 --- a/com.woltlab.wcf/templates/imageViewer.tpl +++ /dev/null @@ -1,35 +0,0 @@ -{if !$__imageViewerLoaded|isset} -{**} - - - {assign var=__imageViewerLoaded value=true} -{/if} diff --git a/com.woltlab.wcf/templates/shared_imageViewer.tpl b/com.woltlab.wcf/templates/shared_imageViewer.tpl new file mode 100644 index 0000000000..1572e1320e --- /dev/null +++ b/com.woltlab.wcf/templates/shared_imageViewer.tpl @@ -0,0 +1,18 @@ +{if !$__imageViewerLoaded|isset} + + + {assign var=__imageViewerLoaded value=true} +{/if} diff --git a/extra/migrate-shared-template.php b/extra/migrate-shared-template.php index 6cb51f22a9..db9bb69cc6 100644 --- a/extra/migrate-shared-template.php +++ b/extra/migrate-shared-template.php @@ -129,6 +129,7 @@ $templates = [ 'articleBBCodeTag' => 'shared_bbcode_wsa', '__multiPageCondition' => 'shared_multiPageCondition', '__multilineItemListFormField' => 'shared_multilineItemListFormField', + 'imageViewer' => 'shared_imageViewer', ]; if ($argc !== 2) { echo "ERROR: Expected a single argument to the directory that should be used to recursively replace template includes.\n"; diff --git a/wcfsetup/install/files/acp/templates/attachmentList.tpl b/wcfsetup/install/files/acp/templates/attachmentList.tpl index 11067f8115..6c846d7718 100644 --- a/wcfsetup/install/files/acp/templates/attachmentList.tpl +++ b/wcfsetup/install/files/acp/templates/attachmentList.tpl @@ -1,5 +1,6 @@ {include file='header' pageTitle='wcf.acp.attachment.list'} +{include file='shared_imageViewer'} - - {assign var=__imageViewerLoaded value=true} -{/if} diff --git a/wcfsetup/install/files/acp/templates/styleAdd.tpl b/wcfsetup/install/files/acp/templates/styleAdd.tpl index d29e7fa11d..aa484420b7 100644 --- a/wcfsetup/install/files/acp/templates/styleAdd.tpl +++ b/wcfsetup/install/files/acp/templates/styleAdd.tpl @@ -31,6 +31,8 @@ }); +{include file='shared_imageViewer'} +

{lang}wcf.acp.style.{$action}{/lang}

diff --git a/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php b/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php index 5bd0e44b0b..b3c4cfbf27 100755 --- a/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php +++ b/wcfsetup/install/files/lib/system/template/TemplateEngine.class.php @@ -137,6 +137,7 @@ class TemplateEngine extends SingletonFactory 'articleBBCodeTag' => 'shared_bbcode_wsa', '__multiPageCondition' => 'shared_multiPageCondition', '__multilineItemListFormField' => 'shared_multilineItemListFormField', + 'imageViewer' => 'shared_imageViewer', ]; /** -- 2.20.1