hide articles link for non-admins

This commit is contained in:
E. S. 2024-02-02 01:48:48 +00:00
parent 8f644da144
commit 4b52ddd95f

View File

@ -188,11 +188,13 @@ function getStaticVersion(string $name): string {
function renderHeader(SkinContext $ctx, string $theme): string { function renderHeader(SkinContext $ctx, string $theme): string {
$items = [ $items = [];
['url' => '/articles/', 'label' => 'articles'], if (is_admin())
$items[] = ['url' => '/articles/', 'label' => 'articles'];
array_push($items,
['url' => 'https://files.4in1.ws', 'label' => 'materials'], ['url' => 'https://files.4in1.ws', 'label' => 'materials'],
['url' => '/info/', 'label' => 'about'] ['url' => '/info/', 'label' => 'about']
]; );
if (is_admin()) if (is_admin())
$items[] = ['url' => '/admin/', 'label' => $ctx->renderSettingsIcon(), 'type' => 'settings']; $items[] = ['url' => '/admin/', 'label' => $ctx->renderSettingsIcon(), 'type' => 'settings'];
$items[] = ['url' => 'javascript:void(0)', 'label' => $ctx->renderMoonIcons(), 'type' => 'theme-switcher', 'type_opts' => $theme]; $items[] = ['url' => 'javascript:void(0)', 'label' => $ctx->renderMoonIcons(), 'type' => 'theme-switcher', 'type_opts' => $theme];