merge
This commit is contained in:
parent
d5dccdc55c
commit
1b8d5934a6
@ -58,8 +58,6 @@ class MainHandler extends request_handler {
|
||||
|
||||
function GET_post() {
|
||||
global $config;
|
||||
ensure_admin();
|
||||
|
||||
list($name, $input_lang) = input('name, lang');
|
||||
|
||||
$lang = null;
|
||||
@ -74,7 +72,7 @@ class MainHandler extends request_handler {
|
||||
$lang = PostLanguage::getDefault();
|
||||
|
||||
$post = posts::getByName($name);
|
||||
if (!$post)
|
||||
if (!$post || (!$post->visible && !is_admin()))
|
||||
not_found();
|
||||
|
||||
if ($lang == PostLanguage::getDefault() && $input_lang == $lang->value)
|
||||
@ -149,8 +147,6 @@ class MainHandler extends request_handler {
|
||||
}
|
||||
|
||||
function GET_articles() {
|
||||
ensure_admin();
|
||||
|
||||
list($lang) = input('lang');
|
||||
if ($lang) {
|
||||
$lang = PostLanguage::tryFrom($lang);
|
||||
|
@ -432,15 +432,6 @@ HTML;
|
||||
}
|
||||
|
||||
|
||||
function books($ctx) {
|
||||
return <<<HTML
|
||||
{$ctx->bc([
|
||||
['text' => $ctx->lang('admin_title'), 'url' => '/admin/'],
|
||||
['text' => $ctx->lang('admin_books')],
|
||||
])}
|
||||
|
||||
HTML;
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------
|
||||
|
@ -221,9 +221,7 @@ function renderHeader(SkinContext $ctx,
|
||||
bool $show_subtitle): string {
|
||||
$icons = svg();
|
||||
$items = [];
|
||||
if (is_admin()) {
|
||||
$items[] = ['url' => '/articles/'.($articles_lang ? '?lang='.$articles_lang : ''), 'label' => 'articles', 'selected' => $section === 'articles'];
|
||||
}
|
||||
$items[] = ['url' => '/articles/'.($articles_lang ? '?lang='.$articles_lang : ''), 'label' => 'articles', 'selected' => $section === 'articles'];
|
||||
$items[] = ['url' => '/files/', 'label' => 'files', 'selected' => $section === 'files'];
|
||||
$items[] = ['url' => '/info/', 'label' => 'about', 'selected' => $section === 'about'];
|
||||
if (is_admin())
|
||||
|
Loading…
x
Reference in New Issue
Block a user