mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-21 20:03:08 +02:00
fix(layout): prevent double footer rendering breaking Bootstrap dropdowns
renderUnifiedLayoutFooter() was called twice - once from view files and once from BaseAdminController::render(). Since admin/footer.php uses require (not require_once), this loaded vendor.min.js twice, recreating jQuery and destroying Bootstrap's document-level dropdown handlers. - Add static $rendered guard to renderUnifiedLayoutFooter() for idempotency - Remove redundant footer call from BaseAdminController::render() - Remove split-mode (.scripts.php) mechanism from BaseAdminController - Add rRegisteredUsers, rLine to footer globals passthrough
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
* 1. renderUnifiedLayoutHeader('admin')
|
||||
* 2. require Views/admin/{view}.php — HTML-контент
|
||||
* 3. renderUnifiedLayoutFooter('admin')
|
||||
* 4. require Views/admin/{view}.scripts.php — page-specific JS
|
||||
*
|
||||
* Контроллер-наследник:
|
||||
* - Вызывает requirePermission() для проверки доступа
|
||||
@@ -153,19 +152,10 @@ class BaseAdminController {
|
||||
|
||||
// 2. View content
|
||||
$__viewFile = $__viewsDir . $view . '.php';
|
||||
$__scriptsFile = $__viewsDir . $view . '.scripts.php';
|
||||
$__hasScriptsFile = file_exists($__scriptsFile);
|
||||
|
||||
if (file_exists($__viewFile)) {
|
||||
require $__viewFile;
|
||||
}
|
||||
|
||||
// Split mode: separate .scripts.php exists → footer + scripts handled here.
|
||||
// Otherwise: view handles its own footer/closing HTML.
|
||||
if ($__hasScriptsFile) {
|
||||
renderUnifiedLayoutFooter($this->scope);
|
||||
require $__scriptsFile;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user