Blame Extras/Mantis/1.1.2-1.fc9/core/icon_api.php

4c79b5
4c79b5
# Mantis - a php based bugtracking system
4c79b5
4c79b5
# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
4c79b5
# Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
4c79b5
4c79b5
# Mantis is free software: you can redistribute it and/or modify
4c79b5
# it under the terms of the GNU General Public License as published by
4c79b5
# the Free Software Foundation, either version 2 of the License, or
4c79b5
# (at your option) any later version.
4c79b5
#
4c79b5
# Mantis is distributed in the hope that it will be useful,
4c79b5
# but WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4c79b5
# GNU General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
4c79b5
4c79b5
	#------------------------------
4c79b5
	#   $Revision: 2643 $
4c79b5
	#     $Author: al $    
4c79b5
	#       $Date: 2009-06-18 19:06:27 -0400 (Thu, 18 Jun 2009) $  
4c79b5
	#------------------------------
4c79b5
4c79b5
	### Icon API ###
4c79b5
4c79b5
	# --------------------
4c79b5
	# prints the staus icon
4c79b5
	function icon_get_status_icon( $p_icon ) {
4c79b5
		$t_icon_path		= config_get( 'icon_path' );
4c79b5
		$t_status_icon_arr	= config_get( 'status_icon_arr' );
4c79b5
		$t_priotext			= get_enum_element( 'priority', $p_icon );
4c79b5
		if ( isset( $t_status_icon_arr[$p_icon] ) && !is_blank( $t_status_icon_arr[$p_icon] ) ) {
4c79b5
			return "\"\"";
4c79b5
		} else {
4c79b5
			return " ";
4c79b5
		}
4c79b5
	}
4c79b5
	# --------------------
4c79b5
	function print_status_icon( $p_icon ) {
4c79b5
		PRINT icon_get_status_icon( $p_icon );
4c79b5
	}
4c79b5
	# --------------------
4c79b5
	# The input $p_dir is either ASC or DESC
4c79b5
	# The inputs $p_sort_by and $p_field are compared to see if they match
4c79b5
	# If the fields match then the sort icon is printed
4c79b5
	# This is a convenience feature to push the comparison code into this
4c79b5
	#     function instead of in the page(s)
4c79b5
	# $p_field is a constant and $p_sort_by is whatever the page happens to
4c79b5
	#     be sorting by at the moment
4c79b5
	# Multiple sort keys are not supported
4c79b5
	function print_sort_icon( $p_dir, $p_sort_by, $p_field ) {
4c79b5
		$t_icon_path		= config_get( 'icon_path' );
4c79b5
		$t_sort_icon_arr	= config_get( 'sort_icon_arr' );
4c79b5
4c79b5
		if ( $p_sort_by != $p_field ) {
4c79b5
			return;
4c79b5
		}
4c79b5
4c79b5
		if ( ( 'DESC' == $p_dir ) || ( DESCENDING == $p_dir ) ) {
4c79b5
			$t_dir = DESCENDING;
4c79b5
		} else {
4c79b5
			$t_dir = ASCENDING;
4c79b5
		}
4c79b5
4c79b5
		$t_none = NONE;
4c79b5
		if ( !is_blank( $t_sort_icon_arr[$t_dir] ) ) {
4c79b5
			PRINT "\"\"";
4c79b5
		} else {
4c79b5
			PRINT "\"\"";
4c79b5
		}
4c79b5
	}
4c79b5
	# --------------------
4c79b5
	# prints the unread icon if the parameter is UNREAD
4c79b5
	# @@@ UNUSED
4c79b5
	function print_unread_icon( $p_unread = READ ) {
4c79b5
		$t_icon_path		= config_get( 'icon_path' );
4c79b5
		$t_unread_icon_arr	= config_get( 'unread_icon_arr' );
4c79b5
4c79b5
		$t_none = NONE;
4c79b5
		if ( !is_blank( $t_unread_icon_arr[$p_unread] ) ) {
4c79b5
			PRINT "\"\"";
4c79b5
		} else {
4c79b5
			PRINT "\"\"";
4c79b5
		}
4c79b5
	}
4c79b5
?>