[ Index ] |
|
Code source de Mantis 1.1.0rc3 |
1 <?php 2 # Mantis - a php based bugtracking system 3 4 # Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org 5 # Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net 6 7 # Mantis is free software: you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation, either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # Mantis is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with Mantis. If not, see <http://www.gnu.org/licenses/>. 19 20 # -------------------------------------------------------- 21 # $Id: icon_api.php,v 1.15.2.1 2007-10-13 22:35:32 giallu Exp $ 22 # -------------------------------------------------------- 23 24 ### Icon API ### 25 26 # -------------------- 27 # prints the staus icon 28 function icon_get_status_icon( $p_icon ) { 29 $t_icon_path = config_get( 'icon_path' ); 30 $t_status_icon_arr = config_get( 'status_icon_arr' ); 31 $t_priotext = get_enum_element( 'priority', $p_icon ); 32 if ( isset( $t_status_icon_arr[$p_icon] ) && !is_blank( $t_status_icon_arr[$p_icon] ) ) { 33 return "<img src=\"$t_icon_path$t_status_icon_arr[$p_icon]\" alt=\"\" title=\"$t_priotext\" />"; 34 } else { 35 return " "; 36 } 37 } 38 # -------------------- 39 function print_status_icon( $p_icon ) { 40 PRINT icon_get_status_icon( $p_icon ); 41 } 42 # -------------------- 43 # The input $p_dir is either ASC or DESC 44 # The inputs $p_sort_by and $p_field are compared to see if they match 45 # If the fields match then the sort icon is printed 46 # This is a convenience feature to push the comparison code into this 47 # function instead of in the page(s) 48 # $p_field is a constant and $p_sort_by is whatever the page happens to 49 # be sorting by at the moment 50 # Multiple sort keys are not supported 51 function print_sort_icon( $p_dir, $p_sort_by, $p_field ) { 52 $t_icon_path = config_get( 'icon_path' ); 53 $t_sort_icon_arr = config_get( 'sort_icon_arr' ); 54 55 if ( $p_sort_by != $p_field ) { 56 return; 57 } 58 59 if ( ( 'DESC' == $p_dir ) || ( DESCENDING == $p_dir ) ) { 60 $t_dir = DESCENDING; 61 } else { 62 $t_dir = ASCENDING; 63 } 64 65 $t_none = NONE; 66 if ( !is_blank( $t_sort_icon_arr[$t_dir] ) ) { 67 PRINT "<img src=\"$t_icon_path$t_sort_icon_arr[$t_dir]\" alt=\"\" />"; 68 } else { 69 PRINT "<img src=\"$t_icon_path$t_status_icon_arr[$t_none]\" alt=\"\" />"; 70 } 71 } 72 # -------------------- 73 # prints the unread icon if the parameter is UNREAD 74 # @@@ UNUSED 75 function print_unread_icon( $p_unread = READ ) { 76 $t_icon_path = config_get( 'icon_path' ); 77 $t_unread_icon_arr = config_get( 'unread_icon_arr' ); 78 79 $t_none = NONE; 80 if ( !is_blank( $t_unread_icon_arr[$p_unread] ) ) { 81 PRINT "<img src=\"$t_icon_path$t_unread_icon_arr[$p_unread]\" alt=\"\" />"; 82 } else { 83 PRINT "<img src=\"$t_icon_path$t_status_icon_arr[$t_none]\" alt=\"\" />"; 84 } 85 } 86 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 09:42:17 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |