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 # set this to true
Setting('DISABLE_URL_REWRITING', false); 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 # Default user settings
# These settings can be changed per user, here the defaults # These settings can be changed per user, here the defaults

View File

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