Create AddonHelper and proxy to check if addon is enabled

This commit is contained in:
Art4 2025-02-01 21:58:59 +00:00
parent f1dfa63764
commit 91bd6089b5
5 changed files with 61 additions and 1 deletions

View file

@ -35,8 +35,10 @@ class Index extends BaseAdmin
break;
case 'toggle' :
$addonHelper = DI::addonHelper();
$addon = $_GET['addon'] ?? '';
if (Addon::isEnabled($addon)) {
if ($addonHelper->isEnabled($addon)) {
Addon::uninstall($addon);
DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s disabled.', $addon));
} elseif (Addon::install($addon)) {