mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 11:06:36 +00:00
Applied PHP formatting rules
This commit is contained in:
@@ -2,15 +2,22 @@
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\DatabaseMigrationService;
|
||||
use \Grocy\Services\DemoDataGeneratorService;
|
||||
use Grocy\Services\DatabaseMigrationService;
|
||||
use Grocy\Services\DemoDataGeneratorService;
|
||||
|
||||
class SystemController extends BaseController
|
||||
{
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
public function About(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
parent::__construct($container);
|
||||
return $this->renderPage($response, 'about', [
|
||||
'system_info' => $this->getApplicationService()->GetSystemInfo(),
|
||||
'changelog' => $this->getApplicationService()->GetChangelog()
|
||||
]);
|
||||
}
|
||||
|
||||
public function BarcodeScannerTesting(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'barcodescannertesting');
|
||||
}
|
||||
|
||||
public function Root(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
@@ -28,6 +35,11 @@ class SystemController extends BaseController
|
||||
return $response->withRedirect($this->AppContainer->get('UrlManager')->ConstructUrl($this->GetEntryPageRelative()));
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the entry page of the application based on the value of the entry page setting.
|
||||
*
|
||||
@@ -38,69 +50,69 @@ class SystemController extends BaseController
|
||||
*/
|
||||
private function GetEntryPageRelative()
|
||||
{
|
||||
if (defined('GROCY_ENTRY_PAGE')) {
|
||||
if (defined('GROCY_ENTRY_PAGE'))
|
||||
{
|
||||
$entryPage = constant('GROCY_ENTRY_PAGE');
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$entryPage = 'stock';
|
||||
}
|
||||
|
||||
// Stock
|
||||
if ($entryPage === 'stock' && constant('GROCY_FEATURE_FLAG_STOCK')) {
|
||||
// Stock
|
||||
if ($entryPage === 'stock' && constant('GROCY_FEATURE_FLAG_STOCK'))
|
||||
{
|
||||
return '/stockoverview';
|
||||
}
|
||||
|
||||
// Shoppinglist
|
||||
if ($entryPage === 'shoppinglist' && constant('GROCY_FEATURE_FLAG_SHOPPINGLIST')) {
|
||||
// Shoppinglist
|
||||
if ($entryPage === 'shoppinglist' && constant('GROCY_FEATURE_FLAG_SHOPPINGLIST'))
|
||||
{
|
||||
return '/shoppinglist';
|
||||
}
|
||||
|
||||
// Recipes
|
||||
if ($entryPage === 'recipes' && constant('GROCY_FEATURE_FLAG_RECIPES')) {
|
||||
// Recipes
|
||||
if ($entryPage === 'recipes' && constant('GROCY_FEATURE_FLAG_RECIPES'))
|
||||
{
|
||||
return '/recipes';
|
||||
}
|
||||
|
||||
// Chores
|
||||
if ($entryPage === 'chores' && constant('GROCY_FEATURE_FLAG_CHORES')) {
|
||||
// Chores
|
||||
if ($entryPage === 'chores' && constant('GROCY_FEATURE_FLAG_CHORES'))
|
||||
{
|
||||
return '/choresoverview';
|
||||
}
|
||||
|
||||
// Tasks
|
||||
if ($entryPage === 'tasks' && constant('GROCY_FEATURE_FLAG_TASKS')) {
|
||||
// Tasks
|
||||
if ($entryPage === 'tasks' && constant('GROCY_FEATURE_FLAG_TASKS'))
|
||||
{
|
||||
return '/tasks';
|
||||
}
|
||||
|
||||
// Batteries
|
||||
if ($entryPage === 'batteries' && constant('GROCY_FEATURE_FLAG_BATTERIES')) {
|
||||
// Batteries
|
||||
if ($entryPage === 'batteries' && constant('GROCY_FEATURE_FLAG_BATTERIES'))
|
||||
{
|
||||
return '/batteriesoverview';
|
||||
}
|
||||
|
||||
if ($entryPage === 'equipment' && constant('GROCY_FEATURE_FLAG_EQUIPMENT')) {
|
||||
if ($entryPage === 'equipment' && constant('GROCY_FEATURE_FLAG_EQUIPMENT'))
|
||||
{
|
||||
return '/equipment';
|
||||
}
|
||||
|
||||
// Calendar
|
||||
if ($entryPage === 'calendar' && constant('GROCY_FEATURE_FLAG_CALENDAR')) {
|
||||
// Calendar
|
||||
if ($entryPage === 'calendar' && constant('GROCY_FEATURE_FLAG_CALENDAR'))
|
||||
{
|
||||
return '/calendar';
|
||||
}
|
||||
|
||||
// Meal Plan
|
||||
if ($entryPage === 'mealplan' && constant('GROCY_FEATURE_FLAG_RECIPES')) {
|
||||
// Meal Plan
|
||||
if ($entryPage === 'mealplan' && constant('GROCY_FEATURE_FLAG_RECIPES'))
|
||||
{
|
||||
return '/mealplan';
|
||||
}
|
||||
|
||||
return '/about';
|
||||
}
|
||||
|
||||
public function About(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'about', [
|
||||
'system_info' => $this->getApplicationService()->GetSystemInfo(),
|
||||
'changelog' => $this->getApplicationService()->GetChangelog()
|
||||
]);
|
||||
}
|
||||
|
||||
public function BarcodeScannerTesting(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'barcodescannertesting');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user