--- loncom/interface/lonprintout.pm 2006/08/14 10:52:04 1.478
+++ loncom/interface/lonprintout.pm 2006/08/14 22:20:20 1.479
@@ -2,7 +2,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.478 2006/08/14 10:52:04 foxr Exp $
+# $Id: lonprintout.pm,v 1.479 2006/08/14 22:20:20 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2272,6 +2272,7 @@ sub printHelper {
if (($helper->{'VARS'}->{'construction'} ne '1') &&
$helper->{VARS}->{'postdata'} &&
+ ($helper->{VARS}->{'postdata'} !~ /^\/res\//) &&
$helper->{VARS}->{'assignment'}) {
# Allow problems from sequence
push @{$printChoices}, [&mt('Selected Problems in folder [_1]',$sequenceTitle), 'map_problems', 'CHOOSE_PROBLEMS'];
@@ -2308,8 +2309,8 @@ HELPERFRAGMENT
# If the user has pfo (print for otheres) allow them to print all
# problems and resources in the entier course, optionally for selected students
if ($perm{'pfo'} &&
- ($helper->{VARS}->{'postdata'}=~/\/res\// || $helper->{VARS}->{'postdata'}=~/\/(syllabus|smppg|aboutme|bulletinboard)$/)) {
-
+ $helper->{VARS}->{'postdata'} !~/^\/res\// &&
+ $helper->{VARS}->{'postdata'}=~/\/(syllabus|smppg|aboutme|bulletinboard)$/) {
push @{$printChoices}, ['Selected Problems from entire course', 'all_problems', 'ALL_PROBLEMS'];
push @{$printChoices}, ['Selected Resources from entire course', 'all_resources', 'ALL_RESOURCES'];
&Apache::lonxml::xmlparse($r, 'helper', <
$resource_selector
CHOOSE_ANON2
- }
+}
# FIXME: That RE should come from a library somewhere.
- if ((((&Apache::lonnet::allowed('bre',$subdir) eq 'F') and ($helper->{VARS}->{'postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/)) or defined $helper->{'VARS'}->{'construction'}) and $perm{'pav'} and $subdir ne $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/') {
+ if ((((&Apache::lonnet::allowed('bre',$subdir) eq 'F') and
+ ($helper->{VARS}->{'postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/)) or
+ defined $helper->{'VARS'}->{'construction'}) and $perm{'pav'} and $subdir ne $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/') {
push @{$printChoices}, [&mt("Selected Problems from current subdirectory [_1]",$subdir), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR'];
my $f = '$filename';
@@ -2646,7 +2649,7 @@ CHOOSE_FROM_SUBDIR
# Allow the user to select any sequence in the course, feed it to
# another resource selector for that sequence
- if (!$helper->{VARS}->{'construction'}) {
+ if (!$helper->{VARS}->{'construction'} && ($helper->{VARS}->{'postdata'} !~ /^\/res\//)) {
push @$printChoices, ["Selected Resources from selected folder in course",
'select_sequences', 'CHOOSE_SEQUENCE'];
my $escapedSequenceName = $helper->{VARS}->{'SEQUENCE'};
@@ -2677,7 +2680,6 @@ CHOOSE_FROM_SUBDIR
CHOOSE_FROM_ANY_SEQUENCE
}
-
# Generate the first state, to select which resources get printed.
Apache::lonhelper::state->new("START", "Select Printing Options:");
$paramHash = Apache::lonhelper::getParamHash();