mirror of
https://github.com/grocy/grocy.git
synced 2025-08-16 18:54:35 +00:00
Added a feature flag to also be able to hide all stock related UI elements and routes (closes #228)
This commit is contained in:
@@ -28,7 +28,7 @@ class SystemController extends BaseController
|
||||
$demoDataGeneratorService->PopulateDemoData();
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl('/stockoverview'));
|
||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl($this->GetEntryPageRelative()));
|
||||
}
|
||||
|
||||
public function About(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
@@ -38,4 +38,24 @@ class SystemController extends BaseController
|
||||
'changelog' => $this->ApplicationService->GetChangelog()
|
||||
]);
|
||||
}
|
||||
|
||||
private function GetEntryPageRelative()
|
||||
{
|
||||
$entryPage = '/stockoverview';
|
||||
|
||||
if (!GROCY_FEATURE_FLAG_STOCK)
|
||||
{
|
||||
$entryPage = '/choresoverview';
|
||||
}
|
||||
if (!GROCY_FEATURE_FLAG_CHORES)
|
||||
{
|
||||
$entryPage = '/batteriesoverview';
|
||||
}
|
||||
if (!GROCY_FEATURE_FLAG_BATTERIES)
|
||||
{
|
||||
$entryPage = '/equipment';
|
||||
}
|
||||
|
||||
return $entryPage;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user