diff --git a/config/config.default.php b/config/config.default.php index 0972a2ff..2988fc48 100644 --- a/config/config.default.php +++ b/config/config.default.php @@ -32,14 +32,22 @@ return [ // Available link placeholders: %lang% // To disable a header_item in the config.php, you can set its value to null 'header_items' => [ - //'Foo' => 'https://foo.bar/batz-%lang%.html', + // 'Name' => 'URL', + // 'Name' => ['URL', 'permission'], + // Name can be a translation string, permission is a engelsystem privilege + + //'Foo' => ['https://foo.bar/batz-%lang%.html', 'logout'], // Permission: for logged-in users ], // Footer links // To disable a footer item in the config.php, you can set its value to null 'footer_items' => [ + // 'Name' => 'URL', + // 'Name' => ['URL', 'permission'], + // Name can be a translation string, permission is a engelsystem privilege + // URL to the angel faq and job description - 'FAQ' => env('FAQ_URL', '/faq'), + 'faq.faq' => [env('FAQ_URL', '/faq'), 'faq.view'], // Contact email address, linked on every page 'Contact' => env('CONTACT_EMAIL', 'mailto:ticket@c3heaven.de'), diff --git a/resources/views/layouts/parts/footer.twig b/resources/views/layouts/parts/footer.twig index 72d9ff61..a266af5f 100644 --- a/resources/views/layouts/parts/footer.twig +++ b/resources/views/layouts/parts/footer.twig @@ -36,11 +36,15 @@ {% endif %} {% endblock %} - {% for name,url in config('footer_items') %} - - {% if '@' in url %}{{ m.icon('envelope') }}{% endif %} - {{ __(name) }} - · + {% for name,opt in config('footer_items') %} + {% set url = opt is iterable ? opt[0] : opt %} + {% set permission = opt is iterable ? opt[1] : null %} + {% if not permission or has_permission_to(permission) %} + + {% if '@' in url %}{{ m.icon('envelope') }}{% endif %} + {{ __(name) }} + · + {% endif %} {% endfor %} {{ __('footer.issues') }} · {{ __('footer.github') }} diff --git a/resources/views/layouts/parts/navbar.twig b/resources/views/layouts/parts/navbar.twig index e9eb07b2..3f8d1281 100644 --- a/resources/views/layouts/parts/navbar.twig +++ b/resources/views/layouts/parts/navbar.twig @@ -45,12 +45,18 @@ {% if config('header_items') %} {% endif %}