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

diff --git a/XSD/templateDelete.xsd b/XSD/templateDelete.xsd
new file mode 100644 (file)
index 0000000..d72924d
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!-- This file is used for xml files which delete 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 9274500c8345b8fedbb53878a1b324fdcf3c20fc..87090a2d7693a20017df24ea9a59c7e508be40d9 100644 (file)
@@ -33,6 +33,7 @@
                <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="templateDelete">wcf\system\package\plugin\TemplateDeletePackageInstallationPlugin</pip>
                <pip name="acpTemplateDelete">wcf\system\package\plugin\AcpTemplateDeletePackageInstallationPlugin</pip>
        </import>
 </data>
diff --git a/wcfsetup/install/files/lib/system/package/plugin/TemplateDeletePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/TemplateDeletePackageInstallationPlugin.class.php
new file mode 100644 (file)
index 0000000..cf4020f
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+
+namespace wcf\system\package\plugin;
+
+use wcf\data\application\Application;
+
+/**
+ * Deletes templates installed with the `template` 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 TemplateDeletePackageInstallationPlugin extends AbstractTemplateDeletePackageInstallationPlugin
+{
+    /**
+     * @inheritDoc
+     */
+    protected function getLogTableName(): string
+    {
+        return 'wcf1_template';
+    }
+
+    /**
+     * @inheritDoc
+     */
+    protected function getFilePath(string $filename, string $application): string
+    {
+        return \sprintf(
+            '%s/templates/%s.tpl',
+            Application::getDirectory($application),
+            $filename
+        );
+    }
+}
index 15a68cb2e1210fed7e22809e9a76c842cc8b725e..a4db7d55db25732ec3bedd075c31c8624791d98a 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.templateDelete.info"><![CDATA[Das <kbd>templateDelete</kbd>-Package Installation Plugin löscht Templates, die mit dem <kbd>template</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/templateDelete" class="externalURL">Entwickler-Dokumentation</a> finden.]]></item>
+               <item name="wcf.acp.pip.templateDelete.template"><![CDATA[Template]]></item>
+               <item name="wcf.acp.pip.templateDelete.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.templateDelete.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>
index b857c60828bf0b9cbf042ce011baef18fcae2d5c..9519c9da83483ace8023fb6abf036ceb2e2c1b4d 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.templateDelete.info"><![CDATA[The <kbd>templateDelete</kbd> package installation plugin installs deletes templates installed with the <kbd>template</kbd> package installation plugin. You can find more information in the <a href="https://docs.woltlab.com/latest/package/pip/templateDelete/" class="externalURL">developer documentation</a>.]]></item>
+               <item name="wcf.acp.pip.templateDelete.template"><![CDATA[Template]]></item>
+               <item name="wcf.acp.pip.templateDelete.template.error.tplSuffix"><![CDATA[Only enter the name of the template without the file extension <kbd>.tpl</kbd>.]]></item>
+               <item name="wcf.acp.pip.templateDelete.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>