diff --git a/htdocs/modules/system/themes/modern/language/english/main.php b/htdocs/modules/system/themes/modern/language/english/main.php index 29218609b..e5bc6f6f9 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', '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'); diff --git a/htdocs/modules/system/themes/modern/modern.php b/htdocs/modules/system/themes/modern/modern.php index aca4e7154..bc2b0dffa 100644 --- a/htdocs/modules/system/themes/modern/modern.php +++ b/htdocs/modules/system/themes/modern/modern.php @@ -243,18 +243,21 @@ 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); + // 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); } /** diff --git a/htdocs/modules/system/themes/modern/xotpl/xo_dashboard.tpl b/htdocs/modules/system/themes/modern/xotpl/xo_dashboard.tpl index a03d353b5..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'}>
@@ -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}>