|
|
|
<?php
|
|
|
|
|
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
|
|
use Slim\Views\Twig;
|
|
|
|
|
|
|
|
include "brain/data/Book.inc.php";
|
|
|
|
|
|
|
|
class DashControl
|
|
|
|
{
|
|
|
|
public static function start(
|
|
|
|
ServerRequestInterface $request,
|
|
|
|
ResponseInterface $response,
|
|
|
|
array $args
|
|
|
|
): ResponseInterface {
|
|
|
|
$view = Twig::fromRequest($request);
|
|
|
|
$pageOptions = [];
|
|
|
|
switch (isset($args["second"]) ? $args["second"] : "index") {
|
|
|
|
case "pages":
|
|
|
|
$content = [];
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$pageOptions = [
|
|
|
|
"title" => "Fipamo Dashboard",
|
|
|
|
"status" => (new Auth())->sessionStatus(),
|
|
|
|
"pages" => (new Book("content/pages"))->getContents(),
|
|
|
|
];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $view->render($response, "dash/start.twig", $pageOptions);
|
|
|
|
}
|
|
|
|
}
|