Path to current document: $ENV{'form.postdata'}
+ENDHEADER1
+ }
}
sub menu_for_output {
my $r = shift;
- my ($title_for_single_resource,$title_for_sequence) = &details_for_menu;
+ my ($title_for_single_resource,$title_for_sequence,$title_for_main_map) = &details_for_menu;
+ my $assignment = $title_for_sequence;
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.'"';}
+ if ($title_for_main_map ne '') {$title_for_main_map = '"'.$title_for_main_map.'"';}
+ $ENV{'form.postdata'} =~ s|http://[^/]+||;
+ my $subdir_to_print = $ENV{'form.postdata'};
+ $subdir_to_print =~ m/\/([^\/]+)$/;
+ $subdir_to_print =~ s/\Q$1\E//;
$r->print(<What do you want to print? Make a choice.
+
Current document $title_for_single_resource
-(you will print what you see on the screen)
+(prints what you just saw on the screen)
ENDMENUOUT1
- if ((not $ENV{'request.role'}=~m/^au\./) and (not $ENV{'request.role'}=~m/^ca\./)) {
+ if ($ENV{'form.postdata'}=~/\/res\//) {
$r->print(< All problems from the primary sequence $title_for_sequence
- The whole primary sequence $title_for_sequence (problems plus all html and xml files)
+ Problem(s) from $title_for_sequence
+ Problem(s) plus page(s) or html/xml file(s) from $title_for_sequence
ENDMENUOUT2
}
- if ($ENV{'request.role'}=~m/^cc\./ or $ENV{'request.role'}=~m/^in\./ or $ENV{'request.role'}=~m/^ta\./) {
+ if (($ENV{'request.role'}=~m/^cc\./ or $ENV{'request.role'}=~m/^in\./ or $ENV{'request.role'}=~m/^ta\./) and ($ENV{'form.postdata'}=~/\/res\//)) {
$r->print(< All problems from the top level sequence
+ All problems in this course (warning: this may be time consuming)
- Print assignment $title_for_sequence (all problems from the primary sequence) for group of students
+ All problems from $title_for_sequence for selected students
ENDMENUOUT6
}
my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
$subdirtoprint =~ s/\/[^\/]+$//;
- if (&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') {
+ if ((&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') and ($ENV{'form.postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/)) {
$r->print(< All problems from current subdirectory (where this particular problem is)
+ Problems from current subdirectory $subdir_to_print
ENDMENUOUT4
}
$r->print(<
Paper size (format [width x height]): |