Diff for /loncom/interface/lonprintout.pm between versions 1.114 and 1.115

version 1.114, 2003/02/14 00:23:37 version 1.115, 2003/02/14 02:21:35
Line 1355  sub handler { Line 1355  sub handler {
         
 }   } 
   
   use Apache::lonwizard;
   
   sub printWizard {
       my $r = shift;
   
       if ($ENV{'request.course.id'}) {
    my $fn=$ENV{'request.course.fn'};
    tie(%hash,'GDBM_File',"$fn.db",&GDBM_READER(),0640);
       }
   
       if ($r->header_only) {
           if ($ENV{'browser.mathml'}) {
               $r->content_type('text/xml');
           } else {
               $r->content_type('text/html');
           }
           $r->send_http_header;
           return OK;
       }
   
       # Send header, nocache
       if ($ENV{'browser.mathml'}) {
           $r->content_type('text/xml');
       } else {
           $r->content_type('text/html');
       }
       &Apache::loncommon::no_cache($r);
       $r->send_http_header;
       $r->rflush();
   
       my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu;
   
       my $wizard = Apache::lonwizard->new("Printing Wizard");
       # PRINT_TYPE: What the user wants to print (current docs,
       #  whole sequence, etc.
       $wizard->declareVars(['PRINT_TYPE']);
   
       my $subdir = $ENV{'form.postdata'};
       $subdir =~ s|http://[^/]+||;
       $subdir =~ m/\/([^\/]+)$/;
       $subdir =~ s/\Q$1\E//;
   
       # This code also shows up above... which is prefered? Is one
       # right for this context?
       #my $subdir = &Apache::lonnet::filelocation("",$ENV{'form.url'});
       #$subdir =~ s/\/[^\/]+$//;
       
       Apache::lonwizard::switch_state->new($wizard, "START", "Selecting Resources to Print", "PRINT_TYPE", [
              ['current_document', "<b>$resourceTitle</b> (exactly what was on the screen)", 'CHOOSE_FORMAT'],
              ['map_problems', "Problems from <b>$sequenceTitle</b>", 'CHOOSE_FORMAT'],
              ['map_problems_pages', "All of <b>$sequenceTitle</b>", 'CHOOSE_FORMAT'],
              ['problems_for_students', "Problems from <b>$sequenceTitle</b> for selected students", 'CHOOSE_FORMAT'],
              ['problems_from_directory', "Problems from <b>$subdir</b>", 'CHOOSE_FORMAT'] ],
              "What do you want to print?");
       
       $r->print($wizard->display());
   
       untie %hash;
   
       return OK;
   
   }
   
   
 1;  1;
 __END__  __END__

Removed from v.1.114  
changed lines
  Added in v.1.115


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>