[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
sakharuk
lon-capa-cvs@mail.lon-capa.org
Wed, 11 Sep 2002 18:07:35 -0000
sakharuk Wed Sep 11 14:07:35 2002 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
Changes for mwnu - titles appears in menu items.
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.59 loncom/interface/lonprintout.pm:1.60
--- loncom/interface/lonprintout.pm:1.59 Tue Sep 10 16:14:35 2002
+++ loncom/interface/lonprintout.pm Wed Sep 11 14:07:35 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.59 2002/09/10 20:14:35 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.60 2002/09/11 18:07:35 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -49,6 +49,10 @@
use Apache::edit;
use Apache::File();
use POSIX qw(strftime);
+use GDBM_File;
+
+
+my %hash;
sub headerform {
@@ -67,27 +71,27 @@
sub menu_for_output {
my $r = shift;
- my $symbolic = &Apache::lonnet::symbread($ENV{'form.postdata'});
-# $symbolic =~ m/([^_]+)_/;
-# my $primary_sequence = '/res/'.$1;
+ my ($title_for_single_resource,$title_for_sequence) = &details_for_menu;
+ if ($title_for_single_resource ne '') {$title_for_single_resource = '"'.$title_for_single_resource.'"';}
+ if ($title_for_sequence ne '') {$title_for_sequence = '"'.$title_for_sequence.'"';}
$r->print(<<ENDMENUOUT1);
<h1>What do you want to print? Make a choice.</h1><br />
<input type="hidden" name="phase" value="two">
<input type="hidden" name="url" value="$ENV{'form.postdata'}">
-<input type="radio" name="choice" value="Standard LaTeX output for current document" checked> Current document
+<input type="radio" name="choice" value="Standard LaTeX output for current document" checked> Current document <b>$title_for_single_resource</b>
(you will print what you see on the screen)<br />
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 primary sequence<br />
-<input type="radio" name="choice" value="Standard LaTeX output for whole primary sequence"> The whole primary sequence (problems plus all html and xml files)<br />
+<input type="radio" name="choice" value="Standard LaTeX output for the primary sequence"> All problems from the primary sequence <b>$title_for_sequence</b><br />
+<input type="radio" name="choice" value="Standard LaTeX output for whole primary sequence"> The whole primary sequence <b>$title_for_sequence</b> (problems plus all html and xml files)<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 from the top level sequence<br />
<br />
-<input type="radio" name="choice" value="All class print"> Print assignment (all problems from the primary sequence) for group of students<br /><br />
+<input type="radio" name="choice" value="All class print"> Print assignment <b>$title_for_sequence</b> (all problems from the primary sequence) for group of students<br /><br />
ENDMENUOUT6
}
my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
@@ -186,8 +190,8 @@
}
}
</script>
-<input type=button onClick="checkall()" value="Check for All">
-<input type=button onClick="uncheckall()" value="Check for None">
+<input type=button onClick="checkall()" value="Check All">
+<input type=button onClick="uncheckall()" value="Uncheck">
<p>
ENDMENUOUT1
my $i;
@@ -249,10 +253,10 @@
}
}
</script>
-<input type=button onClick="checkall()" value="Check for All">
-<input type=button onClick="checksec()" value="Check for Section/Group">
+<input type=button onClick="checkall()" value="Check All">
+<input type=button onClick="checksec()" value="Check Section/Group">
<input type=text size=5 name=chksec>
-<input type=button onClick="uncheckall()" value="Check for None">
+<input type=button onClick="uncheckall()" value="Uncheck">
<p>
ENDDISHEADER
my $i = 0;
@@ -1003,6 +1007,18 @@
}
+sub details_for_menu {
+
+ my $name_of_resourse = $hash{'title_'.$hash{'ids_'.$ENV{'form.postdata'}}};
+ my $symbolic = &Apache::lonnet::symbread($ENV{'form.postdata'});
+ $symbolic =~ m/([^_]+)_/;
+ my $primary_sequence = '/res/'.$1;
+ my $name_of_sequence = $hash{'title_'.$hash{'ids_'.$primary_sequence}};
+
+ return $name_of_resourse,$name_of_sequence;
+
+}
+
sub handler {
@@ -1011,6 +1027,11 @@
$r->send_http_header;
$r->print(&Apache::loncommon::bodytag("Printing"));
+ if ($ENV{'request.course.id'}) {
+ my $fn=$ENV{'request.course.fn'};
+ tie(%hash,'GDBM_File',"$fn.db",&GDBM_READER(),0640);
+ }
+
#-- start form
&headerform($r);
#-- menu for output
@@ -1038,10 +1059,12 @@
#-- core part
if ($ENV{'form.phase'} eq 'four') {
&output_data($r);
- }
+ }
+ untie %hash;
return OK;
-
+
}
+
1;
__END__