View Issue Details

IDProjectCategoryView StatusLast Update
0024590mantisbtplug-inspublic2019-08-25 12:36
Reporterjamesvii Assigned Todregad  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
Product Version2.15.0 
Target Version2.22.0Fixed in Version2.22.0 
Summary0024590: Add EVENT_MENU_MAIN_FILTER to allow complete customisation of main menu
Description

See https://github.com/mantisbt/mantisbt/pull/1365

This patch modifies the way the main sidebar menu is built; menu items are all assembled in an array first, which is then given the chance to be altered by plugins using a new chain filter EVENT_MENU_MAIN_FILTER.

This allows plugins to do a few things that currently isn't possible, especially to the hard-coded items (My View, View Bugs), such as re-order the items, change the icon, or remove them. It also allows plugins to insert new items anywhere in the menu (not just the start or end). Additionally, by returning an empty array, plugins can get rid of the sidebar entirely.

This is partly inspired by the way Wordpress allows plugins to alter admin menu item, and by our need to remove the My View item in certain circumstances.

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master fc6c2a9c

2019-07-15 14:58

dregad


Details Diff
Add new chain event EVENT_MENU_MAIN_FILTER

Allow plugins to customize the complete main sidebar menu before being
output.

Fixes 0024590, PR https://github.com/mantisbt/mantisbt/pull/1365
Affected Issues
0024590
mod - core/events_inc.php Diff File
mod - core/layout_api.php Diff File
mod - docbook/Developers_Guide/en-US/Events_Reference_Output.xml Diff File