diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2017-09-20 12:18:08 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2017-09-20 12:18:08 +0200 |
commit | 945fcb079a219fa29e8f6ee1afc3f1c0c5c822cb (patch) | |
tree | 7f03157616509fe583b1b0aea6e2d06c53bd9c89 /includes/view | |
parent | c6ef1120f82839cbb9d5abee12ab3e4803d5e2cd (diff) |
Added registration_enabled configuration
Diffstat (limited to 'includes/view')
-rw-r--r-- | includes/view/AngelTypes_view.php | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php index f75cc616..baf0e04a 100644 --- a/includes/view/AngelTypes_view.php +++ b/includes/view/AngelTypes_view.php @@ -475,13 +475,27 @@ function AngelTypes_about_view_angeltype($angeltype) */ function AngelTypes_about_view($angeltypes, $user_logged_in) { + global $privileges; + + $buttons = []; + + if ($user_logged_in) { + $buttons[] = button(page_link_to('angeltypes'), angeltypes_title(), 'back'); + } else { + if (in_array('register', $privileges) && config('registration_enabled')) { + $buttons[] = button(page_link_to('register'), register_title()); + } + + $buttons[] = button(page_link_to('login'), login_title()); + } + + $faqUrl = config('faq_url'); + if (!empty($faqUrl)) { + $buttons[] = button($faqUrl, _('FAQ'), 'btn-primary'); + } + $content = [ - buttons([ - !$user_logged_in ? button(page_link_to('register'), register_title()) : '', - !$user_logged_in ? button(page_link_to('login'), login_title()) : '', - $user_logged_in ? button(page_link_to('angeltypes'), angeltypes_title(), 'back') : '', - button(config('faq_url'), _('FAQ'), 'btn-primary') - ]), + buttons($buttons), '<p>' . _('Here is the list of teams and their tasks. If you have questions, read the FAQ.') . '</p>', '<hr />' ]; |