From: Sam H. v. a. <we...@ma...> - 2006-01-22 02:45:42
|
Log Message: ----------- Don't output DIV tag in info() unless there's something to display. Tags: ---- rel-2-2-dev Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Home.pm Revision Data ------------- Index: Home.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Home.pm,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -Llib/WeBWorK/ContentGenerator/Home.pm -Llib/WeBWorK/ContentGenerator/Home.pm -u -r1.13.2.1 -r1.13.2.2 --- lib/WeBWorK/ContentGenerator/Home.pm +++ lib/WeBWorK/ContentGenerator/Home.pm @@ -46,18 +46,21 @@ } if (-f $site_info) { - $result .= CGI::h2("Site Information"); - my $text = eval { readFile($site_info) }; if ($@) { - $result .= CGI::div({class=>"ResultsWithError"}, $@); + $result = CGI::div({class=>"ResultsWithError"}, $@); } elsif ($text =~ /\S/) { - $result .= $text; + $result = $text; } } } - return CGI::div({class=>"info-box", id=>"InfoPanel"}, $result); + if (defined $result and $result ne "") { + return CGI::div({class=>"info-box", id=>"InfoPanel"}, + CGI::h2("Site Information"), $result); + } else { + return ""; + } } sub body { |