Added the ability to easily customize the control panel logo and documentation pages without overwriting defaults during updates

This commit is contained in:
Pinga 2024-11-21 13:32:13 +02:00
parent eac3d77b8c
commit 120ff607dc
11 changed files with 35 additions and 14 deletions

View file

@ -121,6 +121,17 @@ $container->set('view', function ($container) {
$view->getEnvironment()->addGlobal('uiLang', $uiLang);
$view->getEnvironment()->addGlobal('lang', $lang);
$view->getEnvironment()->addGlobal('flash', $container->get('flash'));
$staticDir = '/var/www/cp/public/static';
if (file_exists($staticDir . '/logo.svg')) {
$logoPath = '/static/logo.svg';
} elseif (file_exists($staticDir . '/logo.png')) {
$logoPath = '/static/logo.png';
} else {
$logoPath = '/static/logo.default.svg';
}
$view->getEnvironment()->addGlobal('logoPath', $logoPath);
if (isset($_SESSION['_screen_mode'])) {
$view->getEnvironment()->addGlobal('screen_mode', $_SESSION['_screen_mode']);
} else {