Skip to content

Commit

Permalink
feat: added fallback URLs for admin main navigation links, closes #3074
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Jul 3, 2024
1 parent 3b67117 commit 62e2c97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions phpmyfaq/admin/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use phpMyFAQ\Template;
use phpMyFAQ\Template\TwigWrapper;
use phpMyFAQ\Translation;
use phpMyFAQ\User\CurrentUser;
use Twig\Extension\DebugExtension;

if (!defined('IS_VALID_PHPMYFAQ')) {
Expand All @@ -41,6 +42,7 @@
$configurationPage = false;

$faqConfig = Configuration::getConfigurationInstance();
$user = CurrentUser::getCurrentUser($faqConfig);

$adminHelper = new AdministrationHelper();
$adminHelper->setUser($user);
Expand Down
12 changes: 6 additions & 6 deletions phpmyfaq/assets/templates/admin/header.twig
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

<!-- User -->
{% if secondLevelEntries['user'] != '' %}
<a class="nav-link {{ userPage ? '' : 'collapsed' }}" href="#" data-bs-toggle="collapse"
<a class="nav-link {{ userPage ? '' : 'collapsed' }}" href="?action=user" data-bs-toggle="collapse"
data-bs-target="#collapseUsers" aria-expanded="false" aria-controls="collapseUsers">
<div class="pmf-admin-nav-link-icon"><i aria-hidden="true" class="bi bi-person h6"></i></div>
{{ menuUsers }}
Expand All @@ -116,7 +116,7 @@

<!-- Content -->
{% if secondLevelEntries['content'] != '' %}
<a class="nav-link {{ contentPage ? '' : 'collapsed' }}" href="#" data-bs-toggle="collapse"
<a class="nav-link {{ contentPage ? '' : 'collapsed' }}" href="?action=faqs-overview" data-bs-toggle="collapse"
data-bs-target="#collapseContent" aria-expanded="false" aria-controls="collapseContent">
<div class="pmf-admin-nav-link-icon"><i aria-hidden="true" class="bi bi-pencil-square h6"></i></div>
{{ menuContent }}
Expand All @@ -132,7 +132,7 @@

<!-- Statistics -->
{% if secondLevelEntries['statistics'] != '' %}
<a class="nav-link {{ statisticsPage ? '' : 'collapsed' }}" href="#" data-bs-toggle="collapse"
<a class="nav-link {{ statisticsPage ? '' : 'collapsed' }}" href="?action=statistics" data-bs-toggle="collapse"
data-bs-target="#collapseStatistics" aria-expanded="false" aria-controls="collapseStatistics">
<div class="pmf-admin-nav-link-icon"><i aria-hidden="true" class="bi bi-graph-up-arrow h6"></i></div>
{{ menuStatistics }}
Expand All @@ -148,7 +148,7 @@

<!-- Exports -->
{% if secondLevelEntries['imports_exports'] != '' %}
<a class="nav-link {{ exportsPage ? '' : 'collapsed' }}" href="#" data-bs-toggle="collapse"
<a class="nav-link {{ exportsPage ? '' : 'collapsed' }}" href="?action=export" data-bs-toggle="collapse"
data-bs-target="#collapseExports" aria-expanded="false" aria-controls="collapseExports">
<div class="pmf-admin-nav-link-icon">
<i aria-hidden="true" class="bi bi-archive h6"></i>
Expand All @@ -166,7 +166,7 @@

<!-- Backup -->
{% if secondLevelEntries['backup'] != '' %}
<a class="nav-link {{ backupPage ? '' : 'collapsed' }}" href="#" data-bs-toggle="collapse"
<a class="nav-link {{ backupPage ? '' : 'collapsed' }}" href="?action=backup" data-bs-toggle="collapse"
data-bs-target="#collapseBackupAdmin" aria-expanded="false" aria-controls="collapseBackupAdmin">
<div class="pmf-admin-nav-link-icon">
<i aria-hidden="true" class="bi bi-cloud-download"></i>
Expand All @@ -184,7 +184,7 @@

<!-- Config -->
{% if secondLevelEntries['config'] != '' %}
<a class="nav-link {{ configurationPage ? '' : 'collapsed' }}" href="#"
<a class="nav-link {{ configurationPage ? '' : 'collapsed' }}" href="?action=config"
data-bs-toggle="collapse" data-bs-target="#collapseConfigAdmin" aria-expanded="false"
aria-controls="collapseConfigAdmin">
<div class="pmf-admin-nav-link-icon"><i aria-hidden="true" class="bi bi-wrench"></i></div>
Expand Down

0 comments on commit 62e2c97

Please sign in to comment.