mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Prepare for embedded mode
This commit is contained in:
parent
3131b8965e
commit
3afeb44b1d
@ -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)
|
||||
|
@ -131,7 +131,16 @@ function BoolToString(bool $bool)
|
||||
function Setting(string $name, $value)
|
||||
{
|
||||
if (!defined($name))
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user