some fixes

This commit is contained in:
E. S. 2023-12-31 00:16:09 +00:00
parent 54fce34bc3
commit 2bd379d2c5
3 changed files with 11 additions and 11 deletions

View File

@ -2,7 +2,8 @@
class Skin {
public string $title = 'title';
public string $title = '4in1';
public bool $fixedTitle = false;
public array $static = [];
public array $meta = [];
@ -28,16 +29,19 @@ class Skin {
$layout_ctx = new SkinContext('\\skin\\base');
$lang = $this->getLang();
$lang = !empty($lang) ? json_encode($lang, JSON_UNESCAPED_UNICODE) : '';
$title = $this->title;
if (!$this->fixedTitle)
$title .= ' :: 4in1';
return new Response(200, $layout_ctx->layout(
static: $this->static,
theme: $theme,
title: $this->title,
title: $title,
opts: $this->options,
js: $js,
meta: $this->meta,
unsafe_lang: $lang,
unsafe_body: $body,
//exec_time: exectime()
));
}

View File

@ -3,9 +3,10 @@
namespace handler;
use admin;
use model\Page;
use model\Post;
use model\Tag;
use NotFoundException;
use exceptions\NotFoundException;
use pages;
use posts;
use RedirectResponse;
@ -16,8 +17,6 @@ class AutoHandler extends RequestHandler {
public function get(): Response {
list($name) = $this->input('name');
if ($name == 'coreboot-mba51-flashing')
return new RedirectResponse('/coreboot-mba52-flashing/', 301);
if (is_numeric($name)) {
$post = posts::get((int)$name);
@ -96,7 +95,7 @@ class AutoHandler extends RequestHandler {
tag: $tag->tag);
}
public function getPage(\model\Page $page): Response {
public function getPage(Page $page): Response {
if (!admin::isAdmin() && !$page->visible)
throw new NotFoundException();

View File

@ -8,13 +8,10 @@ use posts;
class IndexHandler extends \RequestHandler {
public function get(): \Response {
//$posts = posts::getPosts(include_hidden: admin::isAdmin());
//$tags = posts::getAllTags(include_hidden: admin::isAdmin());
$page = \pages::getPageByName('index-wgm9Fkl');
$this->skin->title = $page->title;
$this->skin->fixedTitle = true;
//$this->skin->title = $this->skin->lang('site_title');
return $this->skin->renderPage('main/index',
unsafe_content: $page->getHtml($this->isRetina(), \themes::getUserTheme()));
}