[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

bowersj2 lon-capa-cvs@mail.lon-capa.org
Thu, 06 Mar 2003 18:16:04 -0000


bowersj2		Thu Mar  6 13:16:04 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  If there is no title for the resource, use the file name.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.127 loncom/interface/lonprintout.pm:1.128
--- loncom/interface/lonprintout.pm:1.127	Mon Mar  3 16:53:15 2003
+++ loncom/interface/lonprintout.pm	Thu Mar  6 13:16:04 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.127 2003/03/03 21:53:15 albertel Exp $
+# $Id: lonprintout.pm,v 1.128 2003/03/06 18:16:04 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1312,6 +1312,10 @@
     $r->rflush();
 
     my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu;
+    if (!$resourceTitle) { # if the resource doesn't have a title, use the filename
+        my $url = $ENV{'form.postdata'};
+        $resourceTitle = substr($url, rindex($url, '/') + 1);
+    }
 
     my $wizard = Apache::lonwizard->new("Printing Wizard", $ENV{QUERY_STRING});
     # PRINT_TYPE: What the user wants to print (current docs,