Skip to content

Commit

Permalink
[module_manager] Visibility of 'My Preferences' in menu reflects state (
Browse files Browse the repository at this point in the history
#8726)

The 'My Preferences' menu item is no longer visible if the my_preferences module is not Active.

Fixes #8695
  • Loading branch information
jeffersoncasimir committed Jun 7, 2023
1 parent 2399db4 commit 3c52767
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions smarty/templates/main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@
{$user.Real_name|escape} <b class="caret"></b>
</a>
<ul class="dropdown-menu">
{if $my_preferences|default}
<li>
<a href="{$baseurl}/my_preferences/">
My Preferences
</a>
</li>
{/if}
<li>
<a href="{$baseurl}/?logout=true">
Log Out
Expand Down
5 changes: 4 additions & 1 deletion src/Middleware/UserPageDecorationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ function ($a, $b) {
}
$tpl_data['userPerms'] = $realPerms;

//Display the footer links, as specified in the config file
// Do not show menu item if module not active
$tpl_data['my_preferences'] = $loris->hasModule('my_preferences');

// Display the footer links, as specified in the config file
$links = $this->Config->getExternalLinks('FooterLink');

$tpl_data['links'] = array();
Expand Down

0 comments on commit 3c52767

Please sign in to comment.