|
|
@ -63,17 +63,24 @@ class IndexControl
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
//check layout to see what page should be rendered
|
|
|
|
//check if page is a menu item, if not render along path as usual
|
|
|
|
$template = $settings["global"]["theme"] . "/page.twig";
|
|
|
|
$page = [];
|
|
|
|
$book = new Book();
|
|
|
|
$book = new Book();
|
|
|
|
|
|
|
|
if (is_numeric($args["first"])) {
|
|
|
|
$page = $book->findPageBySlug($args["third"]);
|
|
|
|
$page = $book->findPageBySlug($args["third"]);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$page = $book->findPageBySlug($args["first"]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$template =
|
|
|
|
|
|
|
|
$settings["global"]["theme"] . "/" . $page["layout"] . ".twig";
|
|
|
|
$pageOptions = Sorting::page($page);
|
|
|
|
$pageOptions = Sorting::page($page);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//index
|
|
|
|
//index
|
|
|
|
$template = $settings["global"]["theme"] . "/index.twig";
|
|
|
|
$template =
|
|
|
|
|
|
|
|
$settings["global"]["theme"] . "/" . $page["layout"] . ".twig";
|
|
|
|
$book = new Book("");
|
|
|
|
$book = new Book("");
|
|
|
|
$page = $book->findPageBySlug();
|
|
|
|
$page = $book->findPageBySlug();
|
|
|
|
$pageOptions = Sorting::page($page);
|
|
|
|
$pageOptions = Sorting::page($page);
|
|
|
@ -83,6 +90,7 @@ class IndexControl
|
|
|
|
$response->getBody()->write($html);
|
|
|
|
$response->getBody()->write($html);
|
|
|
|
return $response;
|
|
|
|
return $response;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//if dynamic flag is false, load up html
|
|
|
|
$view = Twig::fromRequest($request);
|
|
|
|
$view = Twig::fromRequest($request);
|
|
|
|
$html = file_get_contents("../public/index.html");
|
|
|
|
$html = file_get_contents("../public/index.html");
|
|
|
|
$response->getBody()->write($html);
|
|
|
|
$response->getBody()->write($html);
|
|
|
|