From bef9f43bc2bb8a3ef1f7fa2369a846721bdfe6d9 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 16 Feb 2026 00:00:00 +0000 Subject: [PATCH] Appended count of modules by state in admin/module. --- .../src/Controller/Admin/ModuleController.php | 14 ++++++++++++++ application/view/omeka/admin/module/browse.phtml | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/application/src/Controller/Admin/ModuleController.php b/application/src/Controller/Admin/ModuleController.php index 33077244c8..b760fd96dc 100644 --- a/application/src/Controller/Admin/ModuleController.php +++ b/application/src/Controller/Admin/ModuleController.php @@ -63,9 +63,23 @@ public function browseAction() return strcmp(strtolower($a->getName()), strtolower($b->getName())); }); + // Count modules per filter state. + $allModules = $this->omekaModules->getModules(); + $moduleCounts = [ + '' => count($allModules), + 'active' => count($this->omekaModules->getModulesByState('active')), + 'not_active' => count($this->omekaModules->getModulesByState('not_active')), + 'not_installed' => count($this->omekaModules->getModulesByState('not_installed')), + 'needs_upgrade' => count($this->omekaModules->getModulesByState('needs_upgrade')), + 'error' => count($this->omekaModules->getModulesByState('not_found')) + + count($this->omekaModules->getModulesByState('invalid_module')) + + count($this->omekaModules->getModulesByState('invalid_ini')), + ]; + $view = new ViewModel; $view->setVariable('modules', $modules); $view->setVariable('filterState', $state); + $view->setVariable('moduleCounts', $moduleCounts); $view->setVariable('filterStates', [ 'active' => $this->translate('Active'), 'not_active' => $this->translate('Not active'), diff --git a/application/view/omeka/admin/module/browse.phtml b/application/view/omeka/admin/module/browse.phtml index 76e98a9575..535696c8d6 100644 --- a/application/view/omeka/admin/module/browse.phtml +++ b/application/view/omeka/admin/module/browse.phtml @@ -12,9 +12,9 @@ $this->plugin('formRow')->setPartial(null);