View Issue Details

IDProjectCategoryView StatusLast Update
0011817mantisbthtmlpublic2010-04-23 14:30
ReporterPAB Assigned Tojreese  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.2.0 
Target Version1.2.1Fixed in Version1.2.1 
Summary0011817: [Patch]New event for adding raw menulinks to issues
Description

Unlike EVENT_MENU_MAIN, EVENT_MENU_ISSUE takes an array of "href"=>"caption" instead of the raw html for the link. For a new plugin, i need to add more attributes to the anchor.

Please see the attached patch for a new event EVENT_MENU_ISSUE_PREPARED, which takes a simple array of html and passes it to "print_bracket_link_prepared".

Tagspatch
Attached Files
bug_view_inc.patch (853 bytes)   
--- C:/temp/MantisBT/mantisbt-1.2.0/bug_view_inc.php	Wed Feb 24 12:44:18 2010
+++ C:/Prog/xampp/htdocs/mantis/bug_view_inc.php	Tue Apr 20 21:12:56 2010
@@ -192,6 +192,7 @@
 	$tpl_additional_information = $tpl_show_additional_information ? string_display_links( $tpl_bug->additional_information ) : '';
 
 	$tpl_links = event_signal( 'EVENT_MENU_ISSUE', $f_bug_id );
+	$tpl_links_prepared = event_signal( 'EVENT_MENU_ISSUE_PREPARED', $f_bug_id );
 
 	#
 	# Start of Template
@@ -225,6 +226,15 @@
 			foreach( $t_hook as $t_label => $t_href ) {
 				echo ' ';
 				print_bracket_link( $t_href, $t_label );
+			}
+		}
+	}
+	
+	foreach ( $tpl_links_prepared as $t_hooks ) {
+		foreach( $t_hooks as $t_hook ) {
+			foreach( $t_hook as $t_link ) {
+				echo ' ';
+				print_bracket_link_prepared( $t_link );
 			}
 		}
 	}
bug_view_inc.patch (853 bytes)   
events_inc.patch (450 bytes)   
--- C:/temp/MantisBT/mantisbt-1.2.0/core/events_inc.php	Wed Feb 24 12:44:18 2010
+++ C:/Prog/xampp/htdocs/mantis/core/events_inc.php	Tue Apr 20 20:59:20 2010
@@ -53,6 +53,7 @@
 	'EVENT_MENU_ACCOUNT' => EVENT_TYPE_DEFAULT,
 	'EVENT_MENU_FILTER' => EVENT_TYPE_DEFAULT,
 	'EVENT_MENU_ISSUE' => EVENT_TYPE_DEFAULT,
+	'EVENT_MENU_ISSUE_PREPARED' => EVENT_TYPE_DEFAULT,
 
 	# Management pages
 	'EVENT_MANAGE_OVERVIEW_INFO' => EVENT_TYPE_OUTPUT,
events_inc.patch (450 bytes)   

Activities

jreese

jreese

2010-04-22 13:33

reporter   ~0025205

Fix committed to 1.2.x and master branches.

Related Changesets

MantisBT: master-1.2.x 9dfb40e1

2010-04-22 12:24

jreese


Details Diff
Fix 0011817: Modified MENU_ISSUE for consistency

In order to be more consistent with other menu events, EVENT_MENU_ISSUE
has been modified to allow both the existing method of adding links as
well as the ability to add links the same way as for other menu events.

The existing behavior is triggered by an array with non-numeric keys
defining the link's label, while the new behavior is triggered by
numeric keys, or by not returning a single string instead of an array.

TODO: Update the other menu events to use this combined mechanism for
ultimate consistency.
Affected Issues
0011817
mod - bug_view_inc.php Diff File

MantisBT: master 9fe8a9b8

2010-04-22 12:24

jreese


Details Diff
Fix 0011817: Modified MENU_ISSUE for consistency

In order to be more consistent with other menu events, EVENT_MENU_ISSUE
has been modified to allow both the existing method of adding links as
well as the ability to add links the same way as for other menu events.

The existing behavior is triggered by an array with non-numeric keys
defining the link's label, while the new behavior is triggered by
numeric keys, or by not returning a single string instead of an array.

TODO: Update the other menu events to use this combined mechanism for
ultimate consistency.
Affected Issues
0011817
mod - bug_view_inc.php Diff File