mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Prepare for embedded mode
This commit is contained in:
parent
3131b8965e
commit
3afeb44b1d
@ -19,6 +19,7 @@ class BaseController
|
|||||||
$versionInfo = $applicationService->GetInstalledVersion();
|
$versionInfo = $applicationService->GetInstalledVersion();
|
||||||
$container->view->set('version', $versionInfo->Version);
|
$container->view->set('version', $versionInfo->Version);
|
||||||
$container->view->set('releaseDate', $versionInfo->ReleaseDate);
|
$container->view->set('releaseDate', $versionInfo->ReleaseDate);
|
||||||
|
$container->view->set('isEmbeddedInstallation', $applicationService->IsEmbeddedInstallation());
|
||||||
|
|
||||||
$container->view->set('localizationStrings', $localizationService->GetCurrentCultureLocalizations());
|
$container->view->set('localizationStrings', $localizationService->GetCurrentCultureLocalizations());
|
||||||
$container->view->set('L', function($text, ...$placeholderValues) use($localizationService)
|
$container->view->set('L', function($text, ...$placeholderValues) use($localizationService)
|
||||||
|
@ -132,6 +132,15 @@ function Setting(string $name, $value)
|
|||||||
{
|
{
|
||||||
if (!defined($name))
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul class="navbar-nav ml-auto">
|
<ul class="navbar-nav ml-auto">
|
||||||
@if(AUTHENTICATED === true)
|
@if(AUTHENTICATED === true && $isEmbeddedInstallation === false)
|
||||||
<li class="nav-item dropdown">
|
<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>
|
<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