View Issue Details

IDProjectCategoryView StatusLast Update
0026659mantisbtbugtrackerpublic2020-02-02 12:41
Reporterdregad Assigned To 
Status confirmedResolutionopen 
Summary0026659: Standardize handling of plugin events to add menu items

Currently there are 2 ways for plugins hooking events to add menu items (e.g. EVENT_MENU_MAIN, EVENT_MENU_ISSUE, etc), to provide the necessary input data:

  • via "cooked" links (i.e. the plugin's callback returns a HTML link <a href=url>label</a> with the necessary CSS
  • an array of links

Moreover, when working with menu/submenu structures where the currently active item/page needs to be highlighted, the plugins themselves are forced to handle this logic (see MantisGraph for example) but this task really belongs in core.

Following discussion with @vboctor in PR 1567, at some point we need to

  1. standardize the menu items input format, to rely on classes instead of arrays (or cooked links)
  2. throw an error when the menu item data received is not in the expected format
  3. make sure menu item events all expect their arguments in the same order

Fixing this requires a backwards-incompatible change for plugins using these events.

TagsNo tags attached.


There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-02-02 12:40 dregad New Issue
2020-02-02 12:41 dregad Status new => confirmed