View Issue Details

IDProjectCategoryView StatusLast Update
0007420mantisbtcustomizationpublic2006-09-11 05:17
Reporterstoft Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
Status newResolutionopen 
PlatformIntel WorkstationOSw2k 
Product Version1.0.5 
Summary0007420: Project menu bar current project highlight
Description

This customization is the same as described in the thread: http://forums.mantisbugtracker.com/viewtopic.php?t=1936

The description below differs slightly from the thread mentioned above; I have replaced the class attribute with an ID attribute.

Addition of highlighting of the current project in the project menu bar. The customization adds an html attribute (class/id) to the current project. The attribute may then be defined in the CSS thus highlighting the current project.

A) In core\html_api.php, anywhere after the require_once:s :

#---CUSTOMIZATION---
function get_project_menu_item_id($t_id) {
$t_current_project_id = helper_get_current_project();
if ($t_current_project_id == $t_id ) {
$t_id_attrib = " id=\"project_menu_bar_highlight\" ";
} else {
$t_id_attrib = "";
}
return $t_id_attrib;
}
#---END CUSTOMIZATION---

B) Modification of the print_project_menu_bar and print_subproject_menu_bar functions (modifications between triple hyphen comment):

function print_project_menu_bar() {
$t_project_ids = current_user_get_accessible_projects();

  # ---CUSTOMIZATION--- 
  $t_id_attrib = get_project_menu_item_id( ALL_PROJECTS ); 
  # --- END CUSTOMIZATION--- 

  PRINT '<table class="width100" cellspacing="0">'; 
  PRINT '<tr>'; 
     PRINT '<td class="menu">'; 
     PRINT 'set_project.php?project_id=' . ALL_PROJECTS . ''; 

     foreach ( $t_project_ids as $t_id ) { 
        # ---CUSTOMIZATION--- 
        $t_id_attrib = get_project_menu_item_id( $t_id ); 
        PRINT " | <a href=\"set_project.php?project_id=$t_id\" $t_id_attrib >" . string_display( project_get_field( $t_id, 'name' ) ) . '</a>'; 
        # --- END CUSTOMIZTION--- 
        print_subproject_menu_bar( $t_id, $t_id . ';' ); 
     } 

     PRINT '</td>'; 
  PRINT '</tr>'; 
  PRINT '</table>'; 

}

--------------------

Print the menu bar with a list of projects to which the user has access

function print_subproject_menu_bar( $p_project_id, $p_parents = '' ) {
$t_subprojects = current_user_get_accessible_subprojects( $p_project_id );

  $t_char = ':'; 
  foreach ( $t_subprojects as $t_subproject ) { 

     # ---CUSTOMIZATION--- 
     $t_id_attrib = get_project_menu_item_id( $t_subproject ); 
     PRINT "$t_char <a href=\"set_project.php?project_id=$p_parents$t_subproject\" $t_id_attrib >" . string_display( project_get_field( $t_subproject, 'name' ) ) . '</a>'; 
     # --- END CUSTOMIZATION--- 
     print_subproject_menu_bar( $t_subproject, $p_parents . $t_subproject . ';' ); 
     $t_char = ','; 
  } 

}

C) Addition of CSS tag:

#project_menu_bar_highlight { color: red; }

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2006-09-11 05:17 stoft New Issue