Prepare for embedded mode

This commit is contained in:
Bernd Bestel 2018-07-18 19:07:00 +02:00
parent 3131b8965e
commit 3afeb44b1d
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
3 changed files with 12 additions and 2 deletions

View File

@ -19,6 +19,7 @@ class BaseController
$versionInfo = $applicationService->GetInstalledVersion();
$container->view->set('version', $versionInfo->Version);
$container->view->set('releaseDate', $versionInfo->ReleaseDate);
$container->view->set('isEmbeddedInstallation', $applicationService->IsEmbeddedInstallation());
$container->view->set('localizationStrings', $localizationService->GetCurrentCultureLocalizations());
$container->view->set('L', function($text, ...$placeholderValues) use($localizationService)

View File

@ -132,6 +132,15 @@ function Setting(string $name, $value)
{
if (!defined($name))
{
define($name, $value);
// The content of a $name.txt file in /data/settingoverrides can overwrite the given setting (for embedded mode)
$settingOverrideFile = DATAPATH . '/settingoverrides/' . $name . '.txt';
if (file_exists($settingOverrideFile))
{
define($name, file_get_contents($settingOverrideFile));
}
else
{
define($name, $value);
}
}
}

View File

@ -164,7 +164,7 @@
</ul>
<ul class="navbar-nav ml-auto">
@if(AUTHENTICATED === true)
@if(AUTHENTICATED === true && $isEmbeddedInstallation === false)
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle discrete-link" href="#" data-toggle="dropdown"><i class="fas fa-user"></i> {{ HTTP_USER }}</a>