You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.4 KiB
63 lines
1.4 KiB
#!/usr/bin/perl -w
|
|
#
|
|
# $Id: ui.pl,v 1.2 2004/01/13 19:22:05 jeffo Exp $
|
|
#
|
|
|
|
sub msgfont {
|
|
my ($msg) = @_;
|
|
return "<b>$msg</b>";
|
|
}
|
|
|
|
|
|
sub errorformat {
|
|
my ($errmsg) = @_;
|
|
$errmsg = msgfont($errmsg);
|
|
my $ERROR = msgfont(GetLanguageElement($SESSION{lang}, 570));
|
|
$errmsg = qq{
|
|
<table bgcolor=$UI{ERROR_BG_COLOR} border=0 bordercolor=$UI{ERROR_BG_COLOR} cellpadding=0 cellspacing=0>
|
|
<tr>
|
|
<td>
|
|
<font color=$UI{ERROR_FONT_COLOR}>$ERROR $errmsg</font>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
};
|
|
|
|
return $errmsg;
|
|
}
|
|
|
|
|
|
sub okformat {
|
|
my ($okmsg) = @_;
|
|
$okmsg = msgfont($okmsg);
|
|
my $OK = msgfont(GetLanguageElement($SESSION{lang}, 571));
|
|
$okmsg = qq{
|
|
<table bgcolor=$UI{OK_BG_COLOR} border=0 bordercolor=$UI{OK_BG_COLOR} cellpadding=0 cellspacing=0>
|
|
<tr>
|
|
<td>
|
|
<font color=$UI{OK_FONT_COLOR}>$OK</font>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<font color=$UI{OK_FONT_COLOR}>$okmsg</font>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
};
|
|
|
|
return $okmsg;
|
|
}
|
|
|
|
|
|
#
|
|
# Convert .97329 into 97.3, accoring to the input format, the configuration
|
|
# format, or the default format. DOES NOT include the '%' sign.
|
|
#
|
|
sub format_percent {
|
|
my ($value, $opts) = @_;
|
|
my $fmt = $opts->{fmt} || $UI{PCNT_FMT} || "%.1f";
|
|
return sprintf($fmt, 100.0 * $value);
|
|
}
|
|
|
|
1;
|
|
|