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:
Divarion-D
2026-04-20 20:33:41 +03:00
parent 788ec37637
commit ab9e8c8d18
2 changed files with 1 additions and 10 deletions
@@ -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;
}
}
/**