2020-04-24 18:08:09 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Engelsystem\Controllers;
|
|
|
|
|
2021-04-10 17:02:34 +02:00
|
|
|
use Engelsystem\Config\Config;
|
2020-04-24 18:08:09 +02:00
|
|
|
use Engelsystem\Http\Response;
|
2022-06-06 13:00:37 +02:00
|
|
|
use Engelsystem\Models\User\PersonalData;
|
2020-04-24 18:08:09 +02:00
|
|
|
use Engelsystem\Models\User\State;
|
|
|
|
use Engelsystem\Models\User\User;
|
|
|
|
|
|
|
|
class DesignController extends BaseController
|
|
|
|
{
|
|
|
|
/** @var Response */
|
|
|
|
protected $response;
|
|
|
|
|
2021-04-10 17:02:34 +02:00
|
|
|
/** @var Config */
|
|
|
|
protected $config;
|
|
|
|
|
2020-04-24 18:08:09 +02:00
|
|
|
/**
|
|
|
|
* @param Response $response
|
2021-04-10 17:02:34 +02:00
|
|
|
* @param Config $config
|
2020-04-24 18:08:09 +02:00
|
|
|
*/
|
2021-04-10 17:02:34 +02:00
|
|
|
public function __construct(Response $response, Config $config)
|
2020-04-24 18:08:09 +02:00
|
|
|
{
|
2021-04-10 17:02:34 +02:00
|
|
|
$this->config = $config;
|
2020-04-24 18:08:09 +02:00
|
|
|
$this->response = $response;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show the design overview page
|
|
|
|
*
|
|
|
|
* @return Response
|
|
|
|
*/
|
2021-07-24 12:35:29 +02:00
|
|
|
public function index()
|
2020-04-24 18:08:09 +02:00
|
|
|
{
|
|
|
|
$demoUser = (new User())->forceFill([
|
2021-04-10 17:02:34 +02:00
|
|
|
'id' => 42,
|
2020-04-24 18:08:09 +02:00
|
|
|
'name' => 'test',
|
|
|
|
]);
|
|
|
|
$demoUser->__set('state', (new State())->forceFill([
|
|
|
|
'user_id' => 42,
|
|
|
|
'arrived' => true,
|
|
|
|
]));
|
|
|
|
$demoUser2 = (new User())->forceFill([
|
2021-04-10 17:02:34 +02:00
|
|
|
'id' => 1337,
|
2020-04-24 18:08:09 +02:00
|
|
|
'name' => 'test2',
|
|
|
|
]);
|
|
|
|
$demoUser2->__set('state', (new State())->forceFill([
|
|
|
|
'user_id' => 1337,
|
|
|
|
'arrived' => false,
|
|
|
|
]));
|
2022-06-06 13:00:37 +02:00
|
|
|
$demoUser2->__set('personalData', (new PersonalData())->forceFill([
|
|
|
|
'pronoun' => 'it/its',
|
|
|
|
]));
|
2020-04-24 18:08:09 +02:00
|
|
|
|
2021-04-29 21:58:20 +02:00
|
|
|
$themes = $this->config->get('themes');
|
2021-04-10 17:02:34 +02:00
|
|
|
$data = [
|
|
|
|
'demo_user' => $demoUser,
|
|
|
|
'demo_user_2' => $demoUser2,
|
|
|
|
'themes' => $themes,
|
|
|
|
];
|
|
|
|
|
2020-04-24 18:08:09 +02:00
|
|
|
return $this->response->withView(
|
|
|
|
'pages/design',
|
2021-04-10 17:02:34 +02:00
|
|
|
$data
|
2020-04-24 18:08:09 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|