Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Replaced $g_<status>_color variables with $g_status_colors['<status…
… color>']

array in the configuration.  For example, $g_new_color is replaced with
$g_status_colors['new'].  The old $g_xxx_color variables are still supported
but they may be dropped soon.
- Changed the status color legend to have equal columns for all statuses rather
than widths that are proportional to the string length of the status name.


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1142 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed Jun 17, 2002
1 parent 872053a commit 8985f02
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 11 additions & 5 deletions core_helper_API.php
Expand Up @@ -5,11 +5,11 @@
# See the files README and LICENSE for details

# --------------------------------------------------------
# $Revision: 1.47 $
# $Revision: 1.48 $
# $Author: vboctor $
# $Date: 2002-06-13 12:11:05 $
# $Date: 2002-06-17 22:40:53 $
#
# $Id: core_helper_API.php,v 1.47 2002-06-13 12:11:05 vboctor Exp $
# $Id: core_helper_API.php,v 1.48 2002-06-17 22:40:53 vboctor Exp $
# --------------------------------------------------------

###########################################################################
Expand Down Expand Up @@ -342,7 +342,7 @@ function alternate_colors( $p_num, $p_color1='', $p_color2='' ) {
# --------------------
# get the color string for the given status
function get_status_color( $p_status ) {
global $g_status_enum_string;
global $g_status_enum_string, $g_status_colors;

# This code creates the appropriate variable name
# then references that color variable
Expand All @@ -362,7 +362,13 @@ function get_status_color( $p_status ) {

$t_color_variable_name = 'g_'.$t_color_str.'_color';
global $$t_color_variable_name;
return $$t_color_variable_name;
if ( isset( $$t_color_variable_name ) ) {
return $$t_color_variable_name;
} elseif ( isset ( $g_status_colors[$t_color_str] ) ) {
return $g_status_colors[$t_color_str];
}

return '#ffffff';
}
# --------------------
# Get the default project of a user
Expand Down
15 changes: 4 additions & 11 deletions core_html_API.php
Expand Up @@ -517,27 +517,20 @@ function print_mantis_error( $p_error_num=0 ) {
# --------------------
# Print the color legend for the colors
function print_status_colors() {
global $g_status_enum_string,
$g_new_color, $g_feedback_color,
$g_acknowledged_color, $g_confirmed_color,
$g_assigned_color, $g_resolved_color,
$g_closed_color;
global $g_status_enum_string;

PRINT '<p>';
PRINT '<table class="width100" cellspacing="1">';
PRINT '<tr>';
$t_arr = explode_enum_string( $g_status_enum_string );
$enum_count = count( $t_arr );
$width = (integer) (100 / $enum_count);
for ($i=0;$i<$enum_count;$i++) {
$t_s = explode_enum_arr( $t_arr[$i] );
$t_val = get_enum_element( 'status', $t_s[0] );

$t_color = '#ffffff';
$t_color_variable_name = 'g_'.$t_s[1].'_color';
if ( isset( $$t_color_variable_name ) ) {
$t_color = $$t_color_variable_name;
}
PRINT "<td class=\"small-caption\" bgcolor=\"$t_color\">$t_val</td>";
$t_color = get_status_color( $t_s[0] );
PRINT "<td class=\"small-caption\" width=\"$width%\" bgcolor=\"$t_color\">$t_val</td>";
}
PRINT '</tr>';
PRINT '</table>';
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -67,6 +67,7 @@ Mantis ChangeLog
* Added $g_handle_bug_threshold to allow controlling the access level required for a user to appear in the assign to list and be able to handle bugs.
* Added support for custom_constants_inc.php, if this file is found in main directory it gets included after constants_inc.php. It is useful to define constants for custom enumerations.
* Added support for custom_config_inc.php, this is to replace config_inc.php. Although config_inc.php is still supported, it is recommended to use the new name.
* Replaced $g_<status>_color variables with $g_status_colors['<status color>'] array in the configuration. For example, $g_new_color is replaced with $g_status_colors['new'].

2002.05.19 - 0.17.3

Expand Down

0 comments on commit 8985f02

Please sign in to comment.