fix: propagate _SETUP variable through unified layout system

- Add _SETUP to globals import list in renderUnifiedLayoutHeader/Footer
- Pass _SETUP via $vars in setup.php render calls
- Set $GLOBALS['_SETUP'] explicitly in setup.php
- Make header.php theme check null-safe (defensive against missing
  $rUserInfo/$rThemes on setup page)
This commit is contained in:
Divarion-D
2026-03-15 16:07:55 +03:00
parent 8abcda5091
commit e43d720fa4
4 changed files with 6 additions and 5 deletions

View File

@@ -33,7 +33,7 @@
<link href="assets/css/icons.css" rel="stylesheet" type="text/css" />
<link href="assets/libs/jquery-vectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
<link href="assets/libs/bootstrap-colorpicker/bootstrap-colorpicker.min.css" rel="stylesheet" type="text/css" />
<?php if (isset($_SETUP) || !$rThemes[$rUserInfo['theme']]['dark']): ?>
<?php if (!empty($_SETUP) || !($rThemes[$rUserInfo['theme'] ?? ''] ?? ['dark' => false])['dark']): ?>
<link href="assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="assets/css/app.css" rel="stylesheet" type="text/css" />
<link href="assets/css/listings.css" rel="stylesheet" type="text/css" />

View File

@@ -132,8 +132,9 @@ if (!isset(RequestManager::getAll()['update'])):
$_TITLE = 'Database Migration';
$_SETUP = true;
$GLOBALS['_SETUP'] = true;
require_once __DIR__ . '/../layouts/admin.php';
renderUnifiedLayoutHeader('admin');
renderUnifiedLayoutHeader('admin', ['_SETUP' => true]);
?>
<div class="wrapper boxed-layout" <?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
} else {
@@ -302,7 +303,7 @@ if (!isset(RequestManager::getAll()['update'])):
</div>
<?php
require_once __DIR__ . '/../layouts/footer.php';
renderUnifiedLayoutFooter('admin');
renderUnifiedLayoutFooter('admin', ['_SETUP' => true]);
?>
<?php if ($rMigrating): ?>
<script>

View File

@@ -29,7 +29,7 @@ if (!function_exists('renderUnifiedLayoutHeader')) {
'rUserInfo', 'rSettings', 'rThemes', 'rMobile', 'rHues',
'db', 'language', 'allServersHealthy', 'rServerError',
'rServers', 'allServers', 'rUpdate', '_TITLE', 'rModal',
'rProxyServers', 'rPermissions', '_PAGE',
'rProxyServers', 'rPermissions', '_PAGE', '_SETUP',
] as $_g) {
if (array_key_exists($_g, $GLOBALS)) {
$$_g = $GLOBALS[$_g];

View File

@@ -28,7 +28,7 @@ if (!function_exists('renderUnifiedLayoutFooter')) {
'rUserInfo', 'rSettings', 'rThemes', 'rMobile', 'rHues',
'db', 'language', 'rServers', 'allServers', 'rUpdate',
'_TITLE', 'rModal', 'rProxyServers', 'rPermissions',
'rServerError', 'allServersHealthy', '_PAGE',
'rServerError', 'allServersHealthy', '_PAGE', '_SETUP',
'rStreamIDs', 'rFilterBy', 'rSortArray', 'rFilterArray',
'rSearchBy', 'rURLs', 'rSubtitles', 'rLegacy', 'rSeries',
'rYearStart', 'rYearEnd', 'rRatingStart', 'rRatingEnd',