Blame Identity/Models/Html/Mantis/1.1.2-1.fc9/core/icon_api.php

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