Add `AcpTemplateDeletePackageInstallationPlugin`
authorMatthias Schmidt <gravatronics@live.com>
Tue, 8 Jun 2021 11:47:54 +0000 (13:47 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 8 Jun 2021 15:12:55 +0000 (17:12 +0200)
XSD/acpTemplateDelete.xsd [new file with mode: 0644]
com.woltlab.wcf/packageInstallationPlugin.xml
wcfsetup/install/files/lib/system/package/plugin/AcpTemplateDeletePackageInstallationPlugin.class.php [new file with mode: 0644]
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

diff --git a/XSD/acpTemplateDelete.xsd b/XSD/acpTemplateDelete.xsd
new file mode 100644 (file)
index 0000000..54c6c82
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!-- This file is used for xml files which delete acp templates. -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.woltlab.com" targetNamespace="http://www.woltlab.com" elementFormDefault="qualified">
+       <xs:include schemaLocation="types.xsd" />
+       
+       <xs:element name="data">
+               <xs:complexType>
+                       <xs:all>
+                               <xs:element name="delete" type="delete" minOccurs="0" />
+                       </xs:all>
+               </xs:complexType>
+       </xs:element>
+       
+       <xs:complexType name="delete">
+               <xs:sequence>
+                       <xs:element name="template" type="template" maxOccurs="unbounded" />
+               </xs:sequence>
+       </xs:complexType>
+       
+       <xs:complexType name="template">
+               <xs:simpleContent>
+                       <xs:extension base="xs:string">
+                               <xs:attribute name="application" type="woltlab_varchar"/>
+                       </xs:extension>
+               </xs:simpleContent>
+       </xs:complexType>
+</xs:schema>
index c64fb38ee63ab0d109a515506c4116ac31da1401..9274500c8345b8fedbb53878a1b324fdcf3c20fc 100644 (file)
@@ -33,5 +33,6 @@
                <pip name="mediaProvider">wcf\system\package\plugin\MediaProviderPackageInstallationPlugin</pip>
                <pip name="database">wcf\system\package\plugin\DatabasePackageInstallationPlugin</pip>
                <pip name="fileDelete">wcf\system\package\plugin\FileDeletePackageInstallationPlugin</pip>
+               <pip name="acpTemplateDelete">wcf\system\package\plugin\AcpTemplateDeletePackageInstallationPlugin</pip>
        </import>
 </data>
diff --git a/wcfsetup/install/files/lib/system/package/plugin/AcpTemplateDeletePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/AcpTemplateDeletePackageInstallationPlugin.class.php
new file mode 100644 (file)
index 0000000..48dda41
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+
+namespace wcf\system\package\plugin;
+
+use wcf\data\application\Application;
+
+/**
+ * Deletes templates installed with the `acpTemplate` package installation plugin.
+ *
+ * @author  Matthias Schmidt
+ * @copyright   2001-2021 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Package\Plugin
+ * @since   5.5
+ */
+final class AcpTemplateDeletePackageInstallationPlugin extends AbstractTemplateDeletePackageInstallationPlugin
+{
+    /**
+     * @inheritDoc
+     */
+    protected function getLogTableName(): string
+    {
+        return 'wcf1_acp_template';
+    }
+
+    /**
+     * @inheritDoc
+     */
+    protected function getFilePath(string $filename, string $application): string
+    {
+        return \sprintf(
+            '%s/acp/templates/%s.tpl',
+            Application::getDirectory($application),
+            $filename
+        );
+    }
+}
index c2298b269b6a8aa6cfa287279784c648ea4240fc..15a68cb2e1210fed7e22809e9a76c842cc8b725e 100644 (file)
@@ -2646,6 +2646,10 @@ Kein Abschnitt darf leer sein und alle Abschnitten dürfen nur folgende Zeichen
                <item name="wcf.acp.pip.fileDelete.info"><![CDATA[Das <kbd>fileDelete</kbd>-Package Installation Plugin löscht Dateien, die mit dem <kbd>file</kbd>-Package Installation Plugin installiert wurden. {if LANGUAGE_USE_INFORMAL_VARIANT}Du kannst{else}Sie können{/if} mehr Informationen in der <a href="https://docs.woltlab.com/latest/package/pip/fileDelete" class="externalURL">Entwickler-Dokumentation</a> finden.]]></item>
                <item name="wcf.acp.pip.fileDelete.file"><![CDATA[Datei]]></item>
                <item name="wcf.acp.pip.fileDelete.application"><![CDATA[App]]></item>
+               <item name="wcf.acp.pip.acpTemplateDelete.info"><![CDATA[Das <kbd>acpTemplateDelete</kbd>-Package Installation Plugin löscht Templates, die mit dem <kbd>acpTemplate</kbd>-Package Installation Plugin installiert wurden. {if LANGUAGE_USE_INFORMAL_VARIANT}Du kannst{else}Sie können{/if} mehr Informationen in der <a href="https://docs.woltlab.com/latest/package/pip/acpTemplateDelete" class="externalURL">Entwickler-Dokumentation</a> finden.]]></item>
+               <item name="wcf.acp.pip.acpTemplateDelete.template"><![CDATA[Template]]></item>
+               <item name="wcf.acp.pip.acpTemplateDelete.template.error.tplSuffix"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Gebe{else}Geben Sie{/if} nur den Namen des Templates ohne die Dateiendung <kbd>.tpl</kbd> an.]]></item>
+               <item name="wcf.acp.pip.acpTemplateDelete.application"><![CDATA[App]]></item>
        </category>
        <category name="wcf.acp.reactionType">
                <item name="wcf.acp.reactionType.type"><![CDATA[Reaktions-Typ]]></item>
index 027b0b02aadfef2f66d8d05c2a4f2931463c2b2e..b857c60828bf0b9cbf042ce011baef18fcae2d5c 100644 (file)
@@ -2576,6 +2576,10 @@ If you have <strong>already bought the licenses for the listed apps</strong>, th
                <item name="wcf.acp.pip.fileDelete.info"><![CDATA[The <kbd>fileDelete</kbd> package installation plugin installs deletes files installed with the <kbd>file</kbd> package installation plugin. You can find more information in the <a href="https://docs.woltlab.com/latest/package/pip/fileDelete/" class="externalURL">developer documentation</a>.]]></item>
                <item name="wcf.acp.pip.fileDelete.file"><![CDATA[File]]></item>
                <item name="wcf.acp.pip.fileDelete.application"><![CDATA[App]]></item>
+               <item name="wcf.acp.pip.acpTemplateDelete.info"><![CDATA[The <kbd>acpTemplateDelete</kbd> package installation plugin installs deletes templates installed with the <kbd>acpTemplate</kbd> package installation plugin. You can find more information in the <a href="https://docs.woltlab.com/latest/package/pip/acpTemplateDelete/" class="externalURL">developer documentation</a>.]]></item>
+               <item name="wcf.acp.pip.acpTemplateDelete.template"><![CDATA[Template]]></item>
+               <item name="wcf.acp.pip.acpTemplateDelete.template.error.tplSuffix"><![CDATA[Only enter the name of the template without the file extension <kbd>.tpl</kbd>.]]></item>
+               <item name="wcf.acp.pip.acpTemplateDelete.application"><![CDATA[App]]></item>
        </category>
        <category name="wcf.acp.reactionType">
                <item name="wcf.acp.reactionType.type"><![CDATA[Reaction Type]]></item>