diff --git a/core/bug_group_action_api.php b/core/bug_group_action_api.php
index 3f8b029faa..42cd7ce97a 100644
--- a/core/bug_group_action_api.php
+++ b/core/bug_group_action_api.php
@@ -88,12 +88,7 @@ function bug_group_action_print_bottom() {
* @return void
*/
function bug_group_action_print_bug_list( array $p_bug_ids_array ) {
- $t_legend_position = config_get( 'status_legend_position' );
-
- if( ( $t_legend_position & STATUS_LEGEND_POSITION_TOP ) == STATUS_LEGEND_POSITION_TOP ) {
- html_status_legend();
- echo '
';
- }
+ html_status_legend( STATUS_LEGEND_POSITION_TOP );
echo '
';
echo '
';
@@ -115,10 +110,7 @@ function bug_group_action_print_bug_list( array $p_bug_ids_array ) {
echo '
';
echo '
';
- if( ( $t_legend_position & STATUS_LEGEND_POSITION_BOTTOM ) == STATUS_LEGEND_POSITION_BOTTOM) {
- echo '
';
- html_status_legend();
- }
+ html_status_legend( STATUS_LEGEND_POSITION_BOTTOM );
}
/**
diff --git a/core/html_api.php b/core/html_api.php
index 91a027e700..6165662e98 100644
--- a/core/html_api.php
+++ b/core/html_api.php
@@ -1344,11 +1344,12 @@ function print_summary_menu( $p_page = '' ) {
}
/**
- * Print the color legend for the status colors
+ * Print the color legend for the status colors at the requested position
+ * @param int $p_display_position STATUS_LEGEND_POSITION_TOP or STATUS_LEGEND_POSITION_BOTTOM
* @param bool $p_restrict_by_filter If true, only display status visible in current filter
* @return void
*/
-function html_status_legend( $p_restrict_by_filter = false ) {
+function html_status_legend( $p_display_position, $p_restrict_by_filter = false ) {
if( $p_restrict_by_filter ) {
# Don't show the legend if only one status is selected by the current filter
@@ -1403,23 +1404,31 @@ function html_status_legend( $p_restrict_by_filter = false ) {
}
}
- echo '
';
- echo '';
- echo '';
+ # Display the legend
+ $t_legend_position = config_get( 'status_legend_position' ) & $p_display_position;
- # draw the status bar
- $t_status_enum_string = config_get( 'status_enum_string' );
- foreach( $t_status_array as $t_status => $t_name ) {
- $t_val = isset( $t_status_names[$t_status] ) ? $t_status_names[$t_status] : $t_status_array[$t_status];
- $t_status_label = MantisEnum::getLabel( $t_status_enum_string, $t_status );
+ if( STATUS_LEGEND_POSITION_NONE != $t_legend_position ) {
+ echo '
';
+ echo '';
+ echo '';
- echo '' . $t_val . ' | ';
- }
+ # draw the status bar
+ $t_status_enum_string = config_get( 'status_enum_string' );
+ foreach( $t_status_array as $t_status => $t_name ) {
+ $t_val = isset( $t_status_names[$t_status] ) ? $t_status_names[$t_status] : $t_status_array[$t_status];
+ $t_status_label = MantisEnum::getLabel( $t_status_enum_string, $t_status );
- echo '
';
- echo '
';
- if( ON == config_get( 'status_percentage_legend' ) ) {
- html_status_percentage_legend();
+ echo '' . $t_val . ' | ';
+ }
+
+ echo '
';
+ echo '
';
+ if( ON == config_get( 'status_percentage_legend' ) ) {
+ html_status_percentage_legend();
+ }
+ }
+ if( STATUS_LEGEND_POSITION_TOP == $t_legend_position ) {
+ echo '
';
}
}
diff --git a/my_view_page.php b/my_view_page.php
index 51e7a5df34..42bc2ae15f 100644
--- a/my_view_page.php
+++ b/my_view_page.php
@@ -91,14 +91,7 @@
?>
-';
-}
-?>
+
@@ -182,10 +175,6 @@
+html_status_legend( STATUS_LEGEND_POSITION_BOTTOM );
-