Changeset 4073


Ignore:
Timestamp:
2003-04-02T00:10:06+12:00 (21 years ago)
Author:
dana
Message:

solved the paragraph problem, general interface tidying, code tidying

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/cgi-bin/readresults.cgi

    r3961 r4073  
    11#!/usr/bin/perl
    22
     3use usabcgi;
     4
    35print "Content-type:text/html\n\n";
    4 
    5 open(FILEIN, "gsdlsite.cfg") or die "Could not open site configuration file\n";
    6 @config=<FILEIN>;
    7 close(FILEIN);
    8 
    9 foreach $line (@config)
    10 {
    11     if($line=~/(gsdlhome)\s+(\S+)/)
    12     {
    13     $etcfileloc=$2;
    14     $etcfileloc =~ s/\"//g;
    15     if(!($etcfileloc=~ /\/$/)) {$etcfileloc.="/"; }
    16     $etcfileloc.= "etc/usability.txt";
    17     }
    18     elsif($line=~/(httpimg)\s+(\S+)/)
    19     {
    20         $imageloc =$2;
    21         if(!($2=~/http/)){
    22             $imageloc="http://".$ENV{HTTP_HOST}."\/".$2;
    23         }
    24     }
    25 
    26 }
    27 
    28 if(!($etcfileloc=~/etc\/usability\.txt/))
    29 {
    30     die "Could not open log file etc/usability.txt\n";
    31 }
    326
    337
     
    3711    print "<style type=\"text/css\">\n";
    3812    print "\th1 \{font-family: sans-serif; font-size: 20px}\n";
    39     print "\th2 \{font-family: sans-serif; font-size: 14px; color: #009966\}\n";
    40     print "\ttd.sans {font-family:sans-serif; width: 50%}\n";
     13    print "\th2 \{font-family: sans-serif; font-size: 14px; color: #009966\}\n";     
     14    print "\ttd.sans {font-family:sans-serif; width: 50%; vertical-align:top}\n";   
    4115    print "</style>\n"
    4216}
    4317print "</head><body>\n";
     18
     19($imageloc) = usabcgi::get_config_info("httpimg");
     20if(!($imageloc =~ "http")) {$imageloc="http://".$ENV{HTTP_HOST}.$imageloc;}
    4421
    4522print "<table width=\"100%\"><tr>\n<td><h1>Greenstone Usability - Report Details</h1></td>\n";
     
    5330}
    5431
     32($etcfileloc) = usabcgi::get_config_info("gsdlhome");
     33if(!($etcfileloc =~/\/$/)) {$etcfileloc.="/";}
     34$etcfileloc .= "etc/usability.txt";
    5535open (FILEIN, $etcfileloc) or die "could not open usability.txt\n";
    5636while(<FILEIN>){
     
    6040
    6141if(!($etcfile=~ /$ENV{QUERY_STRING}/)) {
    62     print "<h2>Each report sent has an ID number.  This program needs one of those ID numbers to work, and the ID number provided wans't found</h2></body></html>";
     42    print "<h2>Each report sent has an ID number.  This program needs one of those ID numbers to work, and the ID number provided wans't found</h2></body></html>"; 
    6343    die;
    6444}
    6545
    6646#get the report for whjich details are to be viewed.
    67 $etcfile=~/report-id := $ENV{QUERY_STRING}\n/;
    68 $report =$&;
     47$etcfile=~/report-id := $ENV{QUERY_STRING}\&usabend\;\n/;
     48$report = $&;
    6949$tmp=$';
    70 $tmp=~/----------------------/;
     50$tmp=~/----------------------?/;
    7151$report.=$`;
    72 @pairs=split(/\n/,$report);
     52@pairs=split(/\&usabend\;\n/,$report);
    7353foreach $pair (@pairs) {
    7454    ($name, $value)= split(/ := /,$pair);
     55    #this adds html tags for breaks
     56    $value =~ s/\n/\<br\>/g;
    7557    $reportvals{$name}=$value;
    7658}
     59
    7760
    7861
     
    126109    print "<td>$reportvals{$entry}</td></tr>\n";
    127110    delete $reportvals{$entry};
     111
    128112}
    129113
Note: See TracChangeset for help on using the changeset viewer.