|
|
@ -2,6 +2,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace Engelsystem\Controllers;
|
|
|
|
namespace Engelsystem\Controllers;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use Engelsystem\Config\Config;
|
|
|
|
|
|
|
|
use Engelsystem\Http\Request;
|
|
|
|
use Engelsystem\Http\Response;
|
|
|
|
use Engelsystem\Http\Response;
|
|
|
|
use Engelsystem\Models\User\State;
|
|
|
|
use Engelsystem\Models\User\State;
|
|
|
|
use Engelsystem\Models\User\User;
|
|
|
|
use Engelsystem\Models\User\User;
|
|
|
@ -11,23 +13,30 @@ class DesignController extends BaseController
|
|
|
|
/** @var Response */
|
|
|
|
/** @var Response */
|
|
|
|
protected $response;
|
|
|
|
protected $response;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @var Config */
|
|
|
|
|
|
|
|
protected $config;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param Response $response
|
|
|
|
* @param Response $response
|
|
|
|
|
|
|
|
* @param Config $config
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function __construct(Response $response)
|
|
|
|
public function __construct(Response $response, Config $config)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
$this->config = $config;
|
|
|
|
$this->response = $response;
|
|
|
|
$this->response = $response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Show the design overview page
|
|
|
|
* Show the design overview page
|
|
|
|
*
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param Request $request
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return Response
|
|
|
|
* @return Response
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function index()
|
|
|
|
public function index(Request $request)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$demoUser = (new User())->forceFill([
|
|
|
|
$demoUser = (new User())->forceFill([
|
|
|
|
'id' => 42,
|
|
|
|
'id' => 42,
|
|
|
|
'name' => 'test',
|
|
|
|
'name' => 'test',
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
$demoUser->__set('state', (new State())->forceFill([
|
|
|
|
$demoUser->__set('state', (new State())->forceFill([
|
|
|
@ -35,7 +44,7 @@ class DesignController extends BaseController
|
|
|
|
'arrived' => true,
|
|
|
|
'arrived' => true,
|
|
|
|
]));
|
|
|
|
]));
|
|
|
|
$demoUser2 = (new User())->forceFill([
|
|
|
|
$demoUser2 = (new User())->forceFill([
|
|
|
|
'id' => 1337,
|
|
|
|
'id' => 1337,
|
|
|
|
'name' => 'test2',
|
|
|
|
'name' => 'test2',
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
$demoUser2->__set('state', (new State())->forceFill([
|
|
|
|
$demoUser2->__set('state', (new State())->forceFill([
|
|
|
@ -43,12 +52,22 @@ class DesignController extends BaseController
|
|
|
|
'arrived' => false,
|
|
|
|
'arrived' => false,
|
|
|
|
]));
|
|
|
|
]));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$themes = $this->config->get('available_themes');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data = [
|
|
|
|
|
|
|
|
'demo_user' => $demoUser,
|
|
|
|
|
|
|
|
'demo_user_2' => $demoUser2,
|
|
|
|
|
|
|
|
'themes' => $themes,
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$theme = $request->get('theme');
|
|
|
|
|
|
|
|
if (isset($themes[$theme])) {
|
|
|
|
|
|
|
|
$data['theme'] = $theme;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $this->response->withView(
|
|
|
|
return $this->response->withView(
|
|
|
|
'pages/design',
|
|
|
|
'pages/design',
|
|
|
|
[
|
|
|
|
$data
|
|
|
|
'demo_user' => $demoUser,
|
|
|
|
|
|
|
|
'demo_user_2' => $demoUser2,
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|