Allow possibility to choose custom homepage

This commit is contained in:
Niels Tholenaar 2019-06-22 16:02:52 +02:00
parent 511c95070e
commit 86f5667039
2 changed files with 21 additions and 17 deletions

View File

@ -41,8 +41,9 @@ Setting('STOCK_BARCODE_LOOKUP_PLUGIN', 'DemoBarcodeLookupPlugin');
# set this to true
Setting('DISABLE_URL_REWRITING', false);
# By default the homepage will be set to the stock overview.
# You can set this to any overview you want. Example: Use recipes to set the homepage to the recipes overview.
Setting('ENTRY_PAGE', 'stock');
# Default user settings
# These settings can be changed per user, here the defaults

View File

@ -41,21 +41,24 @@ class SystemController extends BaseController
private function GetEntryPageRelative()
{
$entryPage = '/stockoverview';
if (!GROCY_FEATURE_FLAG_STOCK)
{
$entryPage = '/choresoverview';
switch (GROCY_ENTRY_PAGE) {
default:
case 'stock':
return '/stockoverview';
case 'shoppinglist':
return '/shoppinglist';
case 'recipes':
return '/recipes';
case 'chores':
return '/choresoverview';
case 'tasks':
return '/tasks';
case 'batteries':
return '/batteriesoverview';
case 'equipment':
return '/equipment';
case 'calendar':
return '/calendar';
}
if (!GROCY_FEATURE_FLAG_CHORES)
{
$entryPage = '/batteriesoverview';
}
if (!GROCY_FEATURE_FLAG_BATTERIES)
{
$entryPage = '/equipment';
}
return $entryPage;
}
}