From 2ebd5f4985c1dfde1b5e471b9037ead0a2c4cba0 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Tue, 25 Apr 2023 18:37:17 +0200 Subject: [PATCH] add plugin Uninstaller features --- src/Uninstall.php | 72 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/Uninstall.php diff --git a/src/Uninstall.php b/src/Uninstall.php new file mode 100644 index 0000000..e1b8c57 --- /dev/null +++ b/src/Uninstall.php @@ -0,0 +1,72 @@ +plugins->moduleExists('Uninstaller')) { + return false; + } + + Uninstaller::instance() + ->addUserAction( + 'settings', + 'delete_all', + My::id() + ) + ->addUserAction( + 'plugins', + 'delete', + My::id() + ) + ->addUserAction( + 'versions', + 'delete', + My::id() + ) + ->addDirectAction( + 'settings', + 'delete_all', + My::id() + ) + ->addDirectAction( + 'plugins', + 'delete', + My::id() + ) + ->addDirectAction( + 'versions', + 'delete', + My::id() + ) + ; + + // no custom action + return false; + } +}