[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Admin Modules: Fix left/right column modules hidden on tiki-admin_modules.php
Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <69c1599b1c4af_3b18d87866863@gitlab-sidekiq-low-urgency-cpu-bound-v2-85c8dd67d-qbsxl.mail> |
Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
89e4b4ef by Espoir Baraka at 2026-03-23T14:50:31+00:00
[FIX] Admin Modules: Fix left/right column modules hidden on tiki-admin_modules.php
---
* [FIX] Tiki-admin_modules: Fix left/right column modules hidden on Admin Modules page
See merge request tikiwiki/tiki!9746
- - - - -
2 changed files:
- lib/modules/modlib.php
- tiki-admin_modules.php
Changes:
=====================================
lib/modules/modlib.php
=====================================
@@ -16,6 +16,7 @@ use Tiki\Sections;
class ModLib extends TikiLib
{
public $pref_errors = [];
+ private bool $moduleAssignmentMode = false;
// additional module zones added to this array will be exposed to tiki.tpl
// TODO change modules user interface to enable additional zones
@@ -516,8 +517,16 @@ class ModLib extends TikiLib
}
/**
- * @param $module
- * @return bool
+ * Decide if a module should be shown in the current request context.
+ *
+ * Applies module-level preferences, unified admin backend rules and
+ * various visibility constraints (language, section, page, groups, etc.).
+ * When the unified admin backend is enabled, non-admin modules are
+ * normally hidden on control panel pages. Module assignment mode can
+ * override this so modules can be displayed in the site layout context.
+ *
+ * @param array $module tiki_modules row with parsed params
+ * @return bool true if the module should be displayed
*/
public function filter_active_module($module)
{
@@ -533,13 +542,21 @@ class ModLib extends TikiLib
return true;
}
}
- // Load only the Unified Admin Interface (UAB) specific modules for Admins on admin panels/management pages
+ // Load only Unified Admin Interface specific modules for admins on admin panels.
$topLogin = $module['name'] === 'login_box' && $module['position'] === 'top';
$topQA = $module['name'] === 'quickadmin' && $module['position'] === 'top';
$footer = $module['position'] === 'bottom';
$isControlPanel = Sections::isCurrentSection(Sections::SECTION_ADMIN);
- if ($prefs['theme_unified_admin_backend'] === 'y' && $isControlPanel && $module['position'] !== 'admin' && ! $topLogin && ! $footer && ! $topQA) {
+ if (
+ $prefs['theme_unified_admin_backend'] === 'y'
+ && $isControlPanel
+ && ! $this->isModuleAssignmentMode()
+ && $module['position'] !== 'admin'
+ && ! $topLogin
+ && ! $footer
+ && ! $topQA
+ ) {
return false;
}
@@ -1247,10 +1264,14 @@ class ModLib extends TikiLib
}
/**
- * Returns true if on the admin modules page
+ * Returns true when we are on the Admin Modules screen with permission.
*
- * @param bool $ifShowingHiddenModules - check for $_REQUEST['show_hidden_modules'] as well
+ * Used to detect the modules management context (tiki-admin_modules.php).
+ * When $ifShowingHiddenModules is true, this only returns true if the
+ * request also has show_hidden_modules set, which some modules use to
+ * decide whether to render additional admin-only or placeholder output.
*
+ * @param bool $ifShowingHiddenModules also require show_hidden_modules in the request
* @return bool
*/
public function is_admin_mode($ifShowingHiddenModules = false)
@@ -1265,6 +1286,30 @@ class ModLib extends TikiLib
strpos($_SERVER["SCRIPT_NAME"], 'tiki-admin_modules.php') !== false;
}
+ /**
+ * Returns true when the current request is managing module assignments.
+ *
+ * This is used to override normal layout filtering so modules can be
+ * displayed in context on tiki-admin_modules.php.
+ *
+ * @return bool
+ */
+ public function isModuleAssignmentMode()
+ {
+ return $this->moduleAssignmentMode;
+ }
+
+ /**
+ * Enable or disable module assignment mode for the current request.
+ *
+ * @param bool $enabled
+ * @return void
+ */
+ public function setModuleAssignmentMode($enabled)
+ {
+ $this->moduleAssignmentMode = (bool) $enabled;
+ }
+
/**
* @param $name
* @param $module_params
=====================================
tiki-admin_modules.php
=====================================
@@ -62,6 +62,8 @@ $modlib = TikiLib::lib('mod');
$menulib = TikiLib::lib('menu');
$tikilib = TikiLib::lib('tiki');
+$modlib->setModuleAssignmentMode(true);
+
$userHasAssignedModules = $prefs['user_assigned_modules'] === 'y'
&& TikiLib::lib('usermodules')->user_has_assigned_modules($user);
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/89e4b4ef4e3bdaf883c9e7b162f4e2213e50d6f5
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/89e4b4ef4e3bdaf883c9e7b162f4e2213e50d6f5
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs