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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 12 Sep 2002 15:25:49 -0000


albertel		Thu Sep 12 11:25:49 2002 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - more menu corrections, also now if the title is blank it prints the filename
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.62 loncom/interface/lonprintout.pm:1.63
--- loncom/interface/lonprintout.pm:1.62	Thu Sep 12 11:08:43 2002
+++ loncom/interface/lonprintout.pm	Thu Sep 12 11:25:49 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.62 2002/09/12 15:08:43 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.63 2002/09/12 15:25:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -91,15 +91,15 @@
 ENDMENUOUT1
     if ((not $ENV{'request.role'}=~m/^au\./) and (not $ENV{'request.role'}=~m/^ca\./)) {
 	$r->print(<<ENDMENUOUT2);
-<input type="radio" name="choice" value="Standard LaTeX output for the primary sequence">  All problems from the sequence <b>$title_for_sequence</b><br />
-<input type="radio" name="choice" value="Standard LaTeX output for whole primary sequence">  All problems plus any html/xml files from the sequence <b>$title_for_sequence</b><br />
+<input type="radio" name="choice" value="Standard LaTeX output for the primary sequence">  All problems from <b>$title_for_sequence</b><br />
+<input type="radio" name="choice" value="Standard LaTeX output for whole primary sequence">  All problems plus any html/xml files from <b>$title_for_sequence</b><br />
 ENDMENUOUT2
     }
     if ($ENV{'request.role'}=~m/^cc\./ or $ENV{'request.role'}=~m/^in\./ or $ENV{'request.role'}=~m/^ta\./) { 
 	$r->print(<<ENDMENUOUT6);
 <input type="radio" name="choice" value="Standard LaTeX output for the top level sequence">  All problems in this course (<b>warning:</b> this may be time consuming) <br />
 <br />
-<input type="radio" name="choice" value="All class print">  All problems from the sequence <b>$title_for_sequence</b> for selected students<br /><br />
+<input type="radio" name="choice" value="All class print">  All problems from <b>$title_for_sequence</b> for selected students<br /><br />
 ENDMENUOUT6
     }
       my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
@@ -1036,11 +1036,18 @@
 
     my $name_of_resourse = $hash{'title_'.$hash{'ids_'.$ENV{'form.postdata'}}};
     my $symbolic = &Apache::lonnet::symbread($ENV{'form.postdata'});
-    $symbolic =~ m/([^_]+)_/;
-    my $name_of_sequence = $hash{'title_'.$hash{'ids_/res/'.$1}};
+    my ($map,$id,$resource)=split(/___/,$symbolic);
+    my $name_of_sequence = $hash{'title_'.$hash{'ids_/res/'.$map}};
+    if ($name_of_sequence =~ /^\s*$/) {
+      $map =~ m|([^/]+)$|;
+      $name_of_sequence = $1;
+    }
     my $name_of_map = $hash{'title_'.$hash{'ids_/res/'.$ENV{'request.course.uri'}}};
-
-    return $name_of_resourse,$name_of_sequence,$name_of_map;
+    if ($name_of_map =~ /^\s*$/) {
+      $ENV{'request.course.uri'} =~ m|([^/]+)$|;
+      $name_of_map = $1;
+    }
+    return ($name_of_resourse,$name_of_sequence,$name_of_map);
 
 }