Diff for /loncom/interface/lonprintout.pm between versions 1.222 and 1.224

version 1.222, 2003/08/21 15:50:35 version 1.224, 2003/08/28 20:36:48
Line 915  ENDPART Line 915  ENDPART
     if ($helper->{'VARS'}->{'TABLE_INDEX'} eq 'yes') {      if ($helper->{'VARS'}->{'TABLE_INDEX'} eq 'yes') {
  if ($selectionmade<10) {$selectionmade*=100;} else {$selectionmade*=10;}   if ($selectionmade<10) {$selectionmade*=100;} else {$selectionmade*=10;}
     }      }
       if ($ENV{'request.role.adv'}) {$selectionmade*=10000;}
 #-- writing .tex file in prtspool   #-- writing .tex file in prtspool 
     my $temp_file;      my $temp_file;
     my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout_".time."_".rand(10000000).".tex";      my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout_".time."_".rand(10000000).".tex";
Line 971  sub handler { Line 972  sub handler {
   
 use Apache::lonhelper;  use Apache::lonhelper;
   
   sub addMessage {
       my $text = shift;
       my $paramHash = Apache::lonhelper::getParamHash();
       $paramHash->{MESSAGE_TEXT} = $text;
       Apache::lonhelper::message->new();
   }
   
 sub printHelper {  sub printHelper {
     my $r = shift;      my $r = shift;
   
Line 1155  HELPERFRAGMENT Line 1163  HELPERFRAGMENT
       </resource>        </resource>
     </state>      </state>
   
   <state name="CHOOSE_STUDENTS" title="Choose Students whose assignments you want to print">    <state name="CHOOSE_STUDENTS" title="Select Students and Resources">
     <student multichoice='1' variable="STUDENTS" nextstate="PAGESIZE" />      <student multichoice='1' variable="STUDENTS" nextstate="PAGESIZE" />
     <message><br /><big><i><b>Select resources for the assignment</b></i></big><br /></message>      <message><br /><big><i><b>Select resources for the assignment</b></i></big><br /></message>
     <resource variable="RESOURCES" multichoice="1">      <resource variable="RESOURCES" multichoice="1">
Line 1198  CHOOSE_FROM_SUBDIR Line 1206  CHOOSE_FROM_SUBDIR
     }      }
   
     # Generate the first state, to select which resources get printed.      # Generate the first state, to select which resources get printed.
     Apache::lonhelper::state->new("START", "What do you want to print? Make a choice.");      Apache::lonhelper::state->new("START", "Select Printing Options:");
     $paramHash = Apache::lonhelper::getParamHash();      $paramHash = Apache::lonhelper::getParamHash();
     $paramHash->{MESSAGE_TEXT} = "";      $paramHash->{MESSAGE_TEXT} = "";
     Apache::lonhelper::message->new();      Apache::lonhelper::message->new();
Line 1208  CHOOSE_FROM_SUBDIR Line 1216  CHOOSE_FROM_SUBDIR
     $paramHash->{CHOICES} = $printChoices;      $paramHash->{CHOICES} = $printChoices;
     Apache::lonhelper::choices->new();      Apache::lonhelper::choices->new();
   
       my $startedTable = 0; # have we started an HTML table yet? (need
                             # to close it later)
   
     if (($ENV{'request.role.adv'} and &Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) or       if (($ENV{'request.role.adv'} and &Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) or 
  ($helper->{VARS}->{'construction'} eq '1')) {   ($helper->{VARS}->{'construction'} eq '1')) {
         $paramHash = Apache::lonhelper::getParamHash();   addMessage("<hr width='33%' /><table><tr><td align='right'>Print With Answers:</td><td>");
         $paramHash->{MESSAGE_TEXT} = "<br /><table><tr><td><big><b><i>Next four options are available only for advanced users:  </i></b></big></td><td>";  
         Apache::lonhelper::message->new();  
         $paramHash = Apache::lonhelper::getParamHash();          $paramHash = Apache::lonhelper::getParamHash();
  $paramHash->{'variable'} = 'ANSWER_TYPE';      $paramHash->{'variable'} = 'ANSWER_TYPE';   
  $helper->declareVar('ANSWER_TYPE');            $helper->declareVar('ANSWER_TYPE');         
         $paramHash->{CHOICES} = [          $paramHash->{CHOICES} = [
                                    ['Print without answer', 'yes'],                                     ['Yes', 'yes'],
                                    ['Print with answers', 'no'] ];                                     ['No', 'no'] ];
         Apache::lonhelper::dropdown->new();          Apache::lonhelper::dropdown->new();
    addMessage("</td></tr>");
    $startedTable = 1;
     }      }
   
     if ($ENV{'request.role.adv'}) {      if ($ENV{'request.role.adv'}) {
         $paramHash = Apache::lonhelper::getParamHash();   if (!$startedTable) {
         $paramHash->{MESSAGE_TEXT} = "</td></tr><tr><td>&nbsp;</td><td>";      addMessage("<hr width='33%' /><table><tr><td align='right'>LaTeX mode: </td><td>");
         Apache::lonhelper::message->new();      $startedTable = 1;
    } else {
       addMessage("<tr><td align='right'>LaTeX mode: </td><td>");
    }
         $paramHash = Apache::lonhelper::getParamHash();          $paramHash = Apache::lonhelper::getParamHash();
  $paramHash->{'variable'} = 'LATEX_TYPE';      $paramHash->{'variable'} = 'LATEX_TYPE';   
  $helper->declareVar('LATEX_TYPE');     $helper->declareVar('LATEX_TYPE');  
  if ($helper->{VARS}->{'construction'} eq '1') {          if ($helper->{VARS}->{'construction'} eq '1') {       
     $paramHash->{CHOICES} = [      $paramHash->{CHOICES} = [
      ['Print in standard LaTeX mode', 'standard'],        ['standard LaTeX mode', 'standard'], 
      ['Print in LaTeX batchmode', 'batchmode'], ];       ['LaTeX batchmode', 'batchmode'], ];
  } else {   } else {
     $paramHash->{CHOICES} = [      $paramHash->{CHOICES} = [
      ['Print in LaTeX batchmode', 'batchmode'],       ['LaTeX batchmode', 'batchmode'],
      ['Print in standard LaTeX mode', 'standard'] ];       ['standard LaTeX mode', 'standard'] ];
  }   }
         Apache::lonhelper::dropdown->new();          Apache::lonhelper::dropdown->new();
     
         $paramHash = Apache::lonhelper::getParamHash();   addMessage("</td></tr><tr><td align='right'>Print Table of Contents: </td><td>");
         $paramHash->{MESSAGE_TEXT} = "</td></tr><tr><td>&nbsp;</td><td>";  
         Apache::lonhelper::message->new();  
         $paramHash = Apache::lonhelper::getParamHash();          $paramHash = Apache::lonhelper::getParamHash();
  $paramHash->{'variable'} = 'TABLE_CONTENTS';      $paramHash->{'variable'} = 'TABLE_CONTENTS';   
  $helper->declareVar('TABLE_CONTENTS');            $helper->declareVar('TABLE_CONTENTS');         
         $paramHash->{CHOICES} = [          $paramHash->{CHOICES} = [
                                    ['Print without Table of Contents', 'no'],                                     ['No', 'no'],
                                    ['Print with Table of Contents', 'yes'] ];                                     ['Yes', 'yes'] ];
         Apache::lonhelper::dropdown->new();          Apache::lonhelper::dropdown->new();
    addMessage("</td></tr>");
                   
  if (not $helper->{VARS}->{'construction'}) {   if (not $helper->{VARS}->{'construction'}) {
     $paramHash = Apache::lonhelper::getParamHash();      addMessage("<tr><td align='right'>Print Index: </td><td>");
     $paramHash->{MESSAGE_TEXT} = "</td></tr><tr><td>&nbsp;</td><td>";  
     Apache::lonhelper::message->new();  
     $paramHash = Apache::lonhelper::getParamHash();      $paramHash = Apache::lonhelper::getParamHash();
     $paramHash->{'variable'} = 'TABLE_INDEX';         $paramHash->{'variable'} = 'TABLE_INDEX';   
     $helper->declareVar('TABLE_INDEX');               $helper->declareVar('TABLE_INDEX');         
     $paramHash->{CHOICES} = [      $paramHash->{CHOICES} = [
      ['Print without Index', 'no'],       ['No', 'no'],
      ['Print with Index', 'yes'] ];       ['Yes', 'yes'] ];
     Apache::lonhelper::dropdown->new();      Apache::lonhelper::dropdown->new();
       addMessage("</td></tr>");
  }   }
   
  if ($helper->{VARS}->{'construction'}) {   if ($helper->{VARS}->{'construction'}) {
     $paramHash = Apache::lonhelper::getParamHash();      addMessage("<tr><td align='right'>Print With URL: </td><td>");
     $paramHash->{MESSAGE_TEXT} = "</td></tr><tr><td>&nbsp;</td><td>";  
     Apache::lonhelper::message->new();  
     $paramHash = Apache::lonhelper::getParamHash();      $paramHash = Apache::lonhelper::getParamHash();
     $paramHash->{'variable'} = 'CONSTR_RESOURSE_URL';         $paramHash->{'variable'} = 'CONSTR_RESOURSE_URL';   
     $helper->declareVar('CONSTR_RESOURSE_URL');               $helper->declareVar('CONSTR_RESOURSE_URL');         
     $paramHash->{CHOICES} = [      $paramHash->{CHOICES} = [
      ['Print without URL', 'no'],       ['No', 'no'],
      ['Print with UTL', 'yes'] ];       ['Yes', 'yes'] ];
     Apache::lonhelper::dropdown->new();      Apache::lonhelper::dropdown->new();
       addMessage("</td></tr>");
  }   }
       }
   
         $paramHash = Apache::lonhelper::getParamHash();      if ($startedTable) {
         $paramHash->{MESSAGE_TEXT} = "</td></tr><table>";   addMessage("</table>");
         Apache::lonhelper::message->new();  
     }      }
   
     Apache::lonprintout::page_format_state->new("FORMAT");      Apache::lonprintout::page_format_state->new("FORMAT");
Line 1370  sub render { Line 1381  sub render {
   
     $result .= <<STATEHTML;      $result .= <<STATEHTML;
   
 <p><big><i><b>What page format do you prefer?</b></i></big></p>  <hr width="33%" />
 <table cellpadding="3">  <table cellpadding="3">
   <tr>    <tr>
     <td align="center"><b>Page layout</b></td>      <td align="center"><b>Page layout</b></td>

Removed from v.1.222  
changed lines
  Added in v.1.224


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