View Issue Details

IDProjectCategoryView StatusLast Update
0022397mantisbtplug-inspublic2017-02-17 05:10
Reportermsoragni 
Assigned To 
PrioritylowSeveritytweakReproducibilityalways
Status newResolutionopen 
Product Version2.1.0 
Target VersionFixed in Version 
Summary0022397: Plugins menu link not highlighted as active
Description

When adding a link to a plugin page to the main menu, via the EVENT_MENU_MAIN hook inside the plugin, the menu link itself isn't highlighted as active when you visit that link.
I've provided a small patch in attach to fix this.

TagsNo tags attached.

Relationships

Activities

msoragni

msoragni

2017-02-17 05:10

reporter  

layout_api.php.diff (562 bytes)
--- mantisbt-2.1.0/core/layout_api.php	2017-01-31 09:53:59.000000000 +0100
+++ mantisbt-2.1.0-fix/core/layout_api.php	2017-02-17 11:02:37.945723377 +0100
@@ -917,7 +917,8 @@
  */
 function layout_sidebar_menu( $p_page, $p_title, $p_icon, $p_active_sidebar_page = null ) {
 	if( $p_page == $p_active_sidebar_page ||
-		$p_page == basename( $_SERVER['SCRIPT_NAME'] ) ) {
+		$p_page == basename( $_SERVER['SCRIPT_NAME'] ) ||
+		$p_page == plugin_page( basename( $p_active_sidebar_page ) ) ) {
 		echo '<li class="active">' . "\n";
 	} else {
 		echo '<li>' . "\n";
layout_api.php.diff (562 bytes)

Issue History

Date Modified Username Field Change
2017-02-17 05:10 msoragni New Issue
2017-02-17 05:10 msoragni File Added: layout_api.php.diff