[LON-CAPA-cvs] cvs: rat / lonambiguous.pm

www lon-capa-cvs@mail.lon-capa.org
Sat, 12 Apr 2003 15:43:59 -0000


www		Sat Apr 12 11:43:59 2003 EDT

  Modified files:              
    /rat	lonambiguous.pm 
  Log:
  Bug 1355 - update to use new routines.
  
  
Index: rat/lonambiguous.pm
diff -u rat/lonambiguous.pm:1.8 rat/lonambiguous.pm:1.9
--- rat/lonambiguous.pm:1.8	Tue Jan 14 13:47:50 2003
+++ rat/lonambiguous.pm	Sat Apr 12 11:43:58 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to resolve ambiguous file locations
 #
-# $Id: lonambiguous.pm,v 1.8 2003/01/14 18:47:50 www Exp $
+# $Id: lonambiguous.pm,v 1.9 2003/04/12 15:43:58 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -37,6 +37,7 @@
 use Apache::lonnet;
 use Apache::Constants qw(:common REDIRECT);
 use GDBM_File;
+use Apache::loncommon;
 
 my %bighash;
 
@@ -56,8 +57,9 @@
     $r->content_type('text/html');
     $r->send_http_header;
     $r->print(
- '<head><title>Unknown Error</title></head><body bgcolor="#FFFFFF"><h1>'.
- 'LON-CAPA</h1>Could not handle ambiguous resource reference.<p>'.$errmsg.
+ '<head><title>Unknown Error</title></head>'.
+  &Apache::loncommon::bodytag('Could not handle ambiguous resource reference').
+  $errmsg.
  '</body></html>');
 }
 
@@ -162,10 +164,11 @@
 # ----------------------------------------------- Okay, really multiple choices
                $r->content_type('text/html');
                $r->send_http_header;
+               my $bodytag=
+                      &Apache::loncommon::bodytag('Pick Instance of Resource');
                $r->print(<<ENDSTART);
 <head><title>Choose Location</title></head>
-<body bgcolor="#FFFFFF">
-<h1>LON-CAPA</h1>
+$bodytag
 The resource you had been accessing appears more than once in this course,
 and LON-CAPA has insufficient session information to determine which instance
 of the resource you meant.
@@ -183,8 +186,10 @@
                    $r->print('<tr><td><input type=submit value=Select name="'.
                               $_.'"></td><td>'.$bighash{'title_'.$_}.
                               '</td><td>'.$bighash{'type_'.$_}.
-                              '</td><td><a href="'.$mapurl.'">'.$mapurl.
-			      '</a></td></tr>');
+                              '</td><td>'.
+                              ($mapurl=~/^\/uploaded\//?'':'<a href="'.$mapurl.'">').
+                              &Apache::lonnet::gettitle($mapurl).'&nbsp;'.
+			      ($mapurl=~/^\/uploaded\//?'':'</a>').'</td></tr>');
                } @possibilities;
                $r->print('</table></form></body></html>');
 	       untie(%bighash);