--- loncom/interface/lonmeta.pm 2004/04/13 14:42:24 1.64
+++ loncom/interface/lonmeta.pm 2004/04/13 16:03:46 1.66
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.64 2004/04/13 14:42:24 matthew Exp $
+# $Id: lonmeta.pm,v 1.66 2004/04/13 16:03:46 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -104,7 +104,9 @@ sub authordisplay {
# Pretty display
sub evalgraph {
my $value=shift;
- unless ($value) { return ''; }
+ if (! $value) {
+ return '';
+ }
my $val=int($value*10.+0.5)-10;
my $output='
';
if ($val>=20) {
@@ -126,7 +128,9 @@ sub evalgraph {
sub diffgraph {
my $value=shift;
- unless ($value) { return ''; }
+ if (! $value) {
+ return '';
+ }
my $val=int(40.0*$value+0.5);
my @colors=('#FF9933','#EEAA33','#DDBB33','#CCCC33',
'#BBDD33','#CCCC33','#DDBB33','#EEAA33');
@@ -142,7 +146,10 @@ sub diffgraph {
return $output;
}
+#
# Turn MySQL row into hash
+# This routine is here for historic reasons. Probably should be moved to
+# a more generic place since it has nothing to do with metadata
sub metadata_col_to_hash {
my @cols=@_;
my %hash=();
@@ -200,7 +207,9 @@ sub fieldnames {
sub prettyprint {
my ($type,$value)=@_;
- unless (defined($value)) { return ' '; }
+ if (! defined($value)) {
+ return ' ';
+ }
# Title
if ($type eq 'title') {
return ''.$value.'';
@@ -239,7 +248,9 @@ sub prettyprint {
return &Apache::loncommon::gradeleveldescription($value);
}
# Only for advance users below
- unless ($ENV{'user.adv'}) { return '- '.&mt('not displayed').' -' };
+ if (! $ENV{'user.adv'}) {
+ return '- '.&mt('not displayed').' -';
+ }
# File
if (($type eq 'customdistributionfile') ||
($type eq 'obsoletereplacement') ||
@@ -284,7 +295,9 @@ sub direct {
sub selectbox {
my ($name,$value,$functionref,@idlist)=@_;
- unless (defined($functionref)) { $functionref=\&direct; }
+ if (! defined($functionref)) {
+ $functionref=\&direct;
+ }
my $selout='