Fix list enabled/disabled addons

This commit is contained in:
Art4 2025-01-12 20:38:55 +00:00
parent 6c43cac067
commit 9fbdbcb054

View file

@ -121,27 +121,28 @@ HELP;
$this->out($this->getHelp()); $this->out($this->getHelp());
return false; return false;
} }
foreach (AddonCore::getAvailableList() as $addon) { foreach (AddonCore::getAvailableList() as $addon) {
$addon_name = $addon[0]; $addon_name = $addon[0];
$enabled = AddonCore::isEnabled($addon_name) ? "enabled" : "disabled"; $enabled = AddonCore::isEnabled($addon_name);
switch ($subCmd) {
case 'all': if ($subCmd === 'all') {
$table->addRow([$addon_name, $enabled]); $table->addRow([$addon_name, $enabled ? 'enabled' : 'disabled']);
break;
case 'enabled': continue;
if (!$enabled) {
continue 2;
}
$table->addRow([$addon_name]);
case 'disabled':
if ($enabled) {
continue 2;
}
$table->addRow([$addon_name]);
break;
} }
if ($subCmd === 'enabled' && $enabled === true) {
$table->addRow([$addon_name]);
continue;
}
if ($subCmd === 'disabled' && $enabled === false) {
$table->addRow([$addon_name]);
continue;
}
} }
$this->out($table->getTable()); $this->out($table->getTable());
return 0; return 0;