From: <vb...@us...> - 2003-02-23 04:26:22
|
Update of /cvsroot/mantisbt/mantisbt In directory sc8-pr-cvs1:/tmp/cvs-serv20676 Modified Files: config_defaults_inc.php proj_doc_page.php Log Message: Enhancement: Added file type icons next to project documents and bug file attachments. Also provided a set of standard icons. More or better icons are welcome! M config_defaults_inc.php - New config option (file_type_icons): provides mapping between file extensions and icons to be used for file types. M core/print_api.php - (print_file_icon): Prints the icon corresponding to the specified filename. M core/file_api.php - (file_get_extension): Extracts the file extension given the filename. - (file_list_attachments): Now prints file type icons next to attached files. M proj_doc_page.php - Now prints file type icons next to project documents. M doc/ChangeLog - Updated the change log. A images/excel2icon.gif A images/fileicon.gif A images/gificon.gif A images/htmlicon.gif A images/jpgicon.gif A images/mailicon.gif A images/pdf2icon.gif A images/pdficon.gif A images/pngicon.gif A images/ppticon.gif A images/texticon.gif A images/unknownicon.gif A images/word2icon.gif A images/zipicon.gif - Added some more standard document file type icons. Index: config_defaults_inc.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/config_defaults_inc.php,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- config_defaults_inc.php 22 Feb 2003 23:01:39 -0000 1.92 +++ config_defaults_inc.php 23 Feb 2003 04:26:19 -0000 1.93 @@ -951,4 +951,41 @@ # Whether to start editng a custom field immediately after creating it $g_custom_field_edit_after_create = ON; + + ########## + # Icons + ########## + + # Maps a file extension to a file type icon. These icons are printed + # next to project documents and bug attachments. + # Note: + # - Extensions must be in lower case + # - All icons will be displayed as 16x16 pixels. + $g_file_type_icons = array( 'pdf' => 'pdficon.gif', + 'doc' => 'wordicon.gif', + 'dot' => 'wordicon.gif', + 'rtf' => 'wordicon.gif', + 'xls' => 'excelicon.gif', + 'xlk' => 'excelicon.gif', + 'csv' => 'excelicon.gif', + 'ppt' => 'ppticon.gif', + 'htm' => 'htmlicon.gif', + 'html' => 'htmlicon.gif', + 'css' => 'htmlicon.gif', + 'gif' => 'gificon.gif', + 'jpg' => 'jpgicon.gif', + 'png' => 'pngicon.gif', + 'zip' => 'zipicon.gif', + 'tar' => 'zipicon.gif', + 'gz' => 'zipicon.gif', + 'tgz' => 'zipicon.gif', + 'rar' => 'zipicon.gif', + 'arj' => 'zipicon.gif', + 'lzh' => 'zipicon.gif', + 'uc2' => 'zipicon.gif', + 'ace' => 'zipicon.gif', + 'txt' => 'texticon.gif', + 'log' => 'texticon.gif', + 'eml' => 'mailicon.gif', + '?' => 'fileicon.gif' ); ?> Index: proj_doc_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/proj_doc_page.php,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- proj_doc_page.php 18 Feb 2003 02:18:01 -0000 1.33 +++ proj_doc_page.php 23 Feb 2003 04:26:19 -0000 1.34 @@ -50,8 +50,11 @@ <tr valign="top" <?php echo helper_alternate_class( $i ) ?>> <td> <?php - PRINT '<a href="file_download.php?file_id='.$v_id.'&type=doc">'.$v_title.'</a> ('.$v_filesize.' bytes)'; - + $t_href = '<a href="file_download.php?file_id='.$v_id.'&type=doc">'; + echo $t_href; + print_file_icon( $v_filename ); + echo '</a> '; + echo $t_href . $v_title . '</a> ('.$v_filesize.' bytes)'; if ( access_has_project_level( MANAGER ) ) { print_bracket_link( 'proj_doc_edit_page.php?file_id='.$v_id, 'edit' ); } |