From b8fe355afe102ec63230adf900af7acbef73c68b Mon Sep 17 00:00:00 2001 From: "NB-GABOR02\\Goffy" Date: Sun, 12 Apr 2026 21:20:05 +0200 Subject: [PATCH 1/5] updated KPI for active modules --- .../system/themes/modern/language/english/main.php | 5 +++-- htdocs/modules/system/themes/modern/modern.php | 14 +++++++------- .../system/themes/modern/xotpl/xo_dashboard.tpl | 3 ++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/htdocs/modules/system/themes/modern/language/english/main.php b/htdocs/modules/system/themes/modern/language/english/main.php index 29218609b..3461c4dd3 100644 --- a/htdocs/modules/system/themes/modern/language/english/main.php +++ b/htdocs/modules/system/themes/modern/language/english/main.php @@ -20,9 +20,10 @@ // -- Dashboard: KPI Cards -- define('_MODERN_TOTAL_USERS', 'Total Users'); -define('_MODERN_NEW_THIS_MONTH', 'new this month'); +define('_MODERN_NEW_THIS_MONTH', 'New this month'); define('_MODERN_ACTIVE_MODULES', 'Active Modules'); -define('_MODERN_INACTIVE', 'inactive'); +define('_MODERN_ACTIVE_MODULES_USERS', 'Active Modules For Users'); +define('_MODERN_ACTIVE_MODULES_ADMINS', 'Active Modules For Admins'); define('_MODERN_ACTIVE_USERS', 'Active Users'); define('_MODERN_LAST_30_DAYS', 'Last 30 days'); define('_MODERN_SERVER_LOAD', 'Server Load'); diff --git a/htdocs/modules/system/themes/modern/modern.php b/htdocs/modules/system/themes/modern/modern.php index aca4e7154..c555cad06 100644 --- a/htdocs/modules/system/themes/modern/modern.php +++ b/htdocs/modules/system/themes/modern/modern.php @@ -243,18 +243,18 @@ private function getModuleStats(&$tpl) { /** @var XoopsModuleHandler $module_handler */ $module_handler = xoops_getHandler('module'); + $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('hasmain', 1)); + // active modules $criteria->add(new Criteria('isactive', 1)); - $active_modules = $module_handler->getCount($criteria); - - $criteria_all = new Criteria('dirname', '', '!='); - $total_modules = $module_handler->getCount($criteria_all); + // active modules for user side + $criteria->add(new Criteria('hasmain', 1)); + $active_modules_user = $module_handler->getCount($criteria); $tpl->assign('active_modules', $active_modules); - $tpl->assign('total_modules', $total_modules); - $tpl->assign('inactive_modules', $total_modules - $active_modules); + $tpl->assign('active_modules_user', $active_modules_user); + $tpl->assign('active_modules_admin', $active_modules - $active_modules_user); } /** diff --git a/htdocs/modules/system/themes/modern/xotpl/xo_dashboard.tpl b/htdocs/modules/system/themes/modern/xotpl/xo_dashboard.tpl index a03d353b5..c7499e356 100644 --- a/htdocs/modules/system/themes/modern/xotpl/xo_dashboard.tpl +++ b/htdocs/modules/system/themes/modern/xotpl/xo_dashboard.tpl @@ -16,7 +16,8 @@
<{$smarty.const._MODERN_ACTIVE_MODULES}>
<{$active_modules}>
- <{$inactive_modules}> <{$smarty.const._MODERN_INACTIVE}> + <{$smarty.const._MODERN_ACTIVE_MODULES_USERS}>: <{$active_modules_user}>
+ <{$smarty.const._MODERN_ACTIVE_MODULES_ADMINS}>: <{$active_modules_admin}>
From 931eb3da159c673ffac020d983881ee82c6408dd Mon Sep 17 00:00:00 2001 From: "NB-GABOR02\\Goffy" Date: Sun, 12 Apr 2026 21:35:37 +0200 Subject: [PATCH 2/5] show dashboard only for htdocs/admin.php --- htdocs/modules/system/themes/modern/xotpl/xo_dashboard.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modules/system/themes/modern/xotpl/xo_dashboard.tpl b/htdocs/modules/system/themes/modern/xotpl/xo_dashboard.tpl index c7499e356..7a17bae77 100644 --- a/htdocs/modules/system/themes/modern/xotpl/xo_dashboard.tpl +++ b/htdocs/modules/system/themes/modern/xotpl/xo_dashboard.tpl @@ -1,5 +1,5 @@ <{* Dashboard shown only on admin.php homepage *}> -<{if $xoops_dirname == 'system' && !isset($smarty.get.fct)}> +<{if $xoops_page == 'admin'}>
From 33acbc006c1df97e637c1031ffcbebf629f467bc Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 13 Apr 2026 21:35:31 -0400 Subject: [PATCH 3/5] Update module definitions for clarity --- htdocs/modules/system/themes/modern/language/english/main.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modules/system/themes/modern/language/english/main.php b/htdocs/modules/system/themes/modern/language/english/main.php index 3461c4dd3..e5bc6f6f9 100644 --- a/htdocs/modules/system/themes/modern/language/english/main.php +++ b/htdocs/modules/system/themes/modern/language/english/main.php @@ -22,8 +22,8 @@ define('_MODERN_TOTAL_USERS', 'Total Users'); define('_MODERN_NEW_THIS_MONTH', 'New this month'); define('_MODERN_ACTIVE_MODULES', 'Active Modules'); -define('_MODERN_ACTIVE_MODULES_USERS', 'Active Modules For Users'); -define('_MODERN_ACTIVE_MODULES_ADMINS', 'Active Modules For Admins'); +define('_MODERN_ACTIVE_MODULES_USERS', 'User-Facing Modules'); +define('_MODERN_ACTIVE_MODULES_ADMINS', 'Admin-Only Modules'); define('_MODERN_ACTIVE_USERS', 'Active Users'); define('_MODERN_LAST_30_DAYS', 'Last 30 days'); define('_MODERN_SERVER_LOAD', 'Server Load'); From 57cbd59d0f2cba0e4ac8a7947feb64c6537476db Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 13 Apr 2026 21:39:04 -0400 Subject: [PATCH 4/5] Improve comments for active modules assignment Add comments to clarify admin-only module logic. --- htdocs/modules/system/themes/modern/modern.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/modules/system/themes/modern/modern.php b/htdocs/modules/system/themes/modern/modern.php index c555cad06..65abbac12 100644 --- a/htdocs/modules/system/themes/modern/modern.php +++ b/htdocs/modules/system/themes/modern/modern.php @@ -254,6 +254,9 @@ private function getModuleStats(&$tpl) $tpl->assign('active_modules', $active_modules); $tpl->assign('active_modules_user', $active_modules_user); + // Modules without a frontend entry (hasmain=0) are admin-only by XOOPS design. + // Every active module has at least hasmain=1 or hasadmin=1, so this subtraction + // equals querying isactive=1 AND hasmain=0 without an extra DB round-trip. $tpl->assign('active_modules_admin', $active_modules - $active_modules_user); } From ef19868877d67f991fd0ec3e4e60853c19cfe96b Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 13 Apr 2026 21:43:55 -0400 Subject: [PATCH 5/5] Update htdocs/modules/system/themes/modern/modern.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- htdocs/modules/system/themes/modern/modern.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modules/system/themes/modern/modern.php b/htdocs/modules/system/themes/modern/modern.php index 65abbac12..bc2b0dffa 100644 --- a/htdocs/modules/system/themes/modern/modern.php +++ b/htdocs/modules/system/themes/modern/modern.php @@ -256,7 +256,7 @@ private function getModuleStats(&$tpl) $tpl->assign('active_modules_user', $active_modules_user); // Modules without a frontend entry (hasmain=0) are admin-only by XOOPS design. // Every active module has at least hasmain=1 or hasadmin=1, so this subtraction - // equals querying isactive=1 AND hasmain=0 without an extra DB round-trip. + // equals querying isactive=1 AND hasmain=0 without an extra DB round-trip. $tpl->assign('active_modules_admin', $active_modules - $active_modules_user); }