Diff for /loncom/interface/lonprintout.pm between versions 1.543 and 1.544

version 1.543, 2008/10/02 17:12:18 version 1.544, 2008/10/31 18:02:33
Line 1281  sub recently_generated { Line 1281  sub recently_generated {
     $cuid,$cgid,$crdev,$csize,      $cuid,$cgid,$crdev,$csize,
     $catime,$cmtime,$cctime,      $catime,$cmtime,$cctime,
     $cblksize,$cblocks)=stat($prtspool.'/'.$filename);      $cblksize,$cblocks)=stat($prtspool.'/'.$filename);
  my $result="<a href='/prtspool/$filename'>".          my $ext_text = 'pdf' ? &mt('PDF File'):&mt('Zip File');
     &mt('Generated [_1] ([_2] bytes)',   my $result=&Apache::loncommon::start_data_table_row()
  &Apache::lonlocal::locallocaltime($cctime),$csize).                    .'<td>'
  '</a><br />';                    .'<a href="/prtspool/'.$filename.'">'.$ext_text.'</a>'
                     .'</td>'
                     .'<td>'.&Apache::lonlocal::locallocaltime($cctime).'</td>'
                     .'<td align="right">'.$csize.'</td>'
                     .&Apache::loncommon::end_data_table_row();
  if ($ext eq 'pdf') { $pdf_result .= $result; }   if ($ext eq 'pdf') { $pdf_result .= $result; }
  if ($ext eq 'zip') { $zip_result .= $result; }   if ($ext eq 'zip') { $zip_result .= $result; }
     }      }
       if ($zip_result || $pdf_result) {
           $r->print('<hr />');
       }
     if ($zip_result) {      if ($zip_result) {
  $r->print('<h4>'.&mt('Recently generated printout zip files')."</h4>\n"   $r->print('<h3>'.&mt('Recently generated printout zip files')."</h3>\n"
   .$zip_result);                    .&Apache::loncommon::start_data_table()
                     .&Apache::loncommon::start_data_table_header_row()
                     .'<th>'.&mt('Download').'</th>'
                     .'<th>'.&mt('Creation Date').'</th>'
                     .'<th>'.&mt('File Size (Bytes)').'</th>'
                     .&Apache::loncommon::end_data_table_header_row()
                     .$zip_result
                     .&Apache::loncommon::end_data_table()
           );
     }      }
     if ($pdf_result) {      if ($pdf_result) {
  $r->print('<h4>'.&mt('Recently generated printouts')."</h4>\n"   $r->print('<h3>'.&mt('Recently generated printouts')."</h3>\n"
   .$pdf_result);                    .&Apache::loncommon::start_data_table()
                     .&Apache::loncommon::start_data_table_header_row()
                     .'<th>'.&mt('Download').'</th>'
                     .'<th>'.&mt('Creation Date').'</th>'
                     .'<th>'.&mt('File Size (Bytes)').'</th>'
                     .&Apache::loncommon::end_data_table_header_row()
                     .$pdf_result
                     .&Apache::loncommon::end_data_table()
           );
     }      }
 }  }
   
Line 3128  CHOOSE_FROM_ANY_SEQUENCE Line 3151  CHOOSE_FROM_ANY_SEQUENCE
   
     if (($perm{'pav'} and &Apache::lonnet::allowed('vgr',$env{'request.course.id'})) or       if (($perm{'pav'} and &Apache::lonnet::allowed('vgr',$env{'request.course.id'})) or 
  ($helper->{VARS}->{'construction'} eq '1')) {   ($helper->{VARS}->{'construction'} eq '1')) {
  addMessage("<hr width='33%' /><table><tr><td align='right'>".   &addMessage('<br />'
                    '<label for="ANSWER_TYPE_forminput">'.                     .'<h3>'.&mt('Print Options').'</h3>'
                    &mt('Print').                     .&Apache::lonhtmlcommon::start_pick_box()
                    "</label>: </td><td>");  #                  .&Apache::lonhtmlcommon::row_headline()
   #                  .'<h3>'.&mt('Print Options').'</h3>'
   #                  .&Apache::lonhtmlcommon::row_closure()
                      .&Apache::lonhtmlcommon::row_title(
                          '<label for="ANSWER_TYPE_forminput">'
                         .&mt('Print Answers')
                         .'</label>'
                       )
           );
         $paramHash = Apache::lonhelper::getParamHash();          $paramHash = Apache::lonhelper::getParamHash();
  $paramHash->{'variable'} = 'ANSWER_TYPE';      $paramHash->{'variable'} = 'ANSWER_TYPE';   
  $helper->declareVar('ANSWER_TYPE');            $helper->declareVar('ANSWER_TYPE');         
Line 3141  CHOOSE_FROM_ANY_SEQUENCE Line 3172  CHOOSE_FROM_ANY_SEQUENCE
                                    ['Only Answers', 'only']                                     ['Only Answers', 'only']
                                 ];                                  ];
         Apache::lonhelper::dropdown->new();          Apache::lonhelper::dropdown->new();
  addMessage("</td></tr>");   &addMessage(&Apache::lonhtmlcommon::row_closure());
  $startedTable = 1;   $startedTable = 1;
     }      }
   
Line 3153  CHOOSE_FROM_ANY_SEQUENCE Line 3184  CHOOSE_FROM_ANY_SEQUENCE
                        "</label>: </td><td>");                         "</label>: </td><td>");
     $startedTable = 1;      $startedTable = 1;
  } else {   } else {
     addMessage("<tr><td align='right'>".      &addMessage(&Apache::lonhtmlcommon::row_title(
                        '<label for="LATEX_TYPE_forminput">'.                             '<label for="LATEX_TYPE_forminput">'
                         &mt('LaTeX mode').                             .&mt('LaTeX mode')
                        "</label>: </td><td>");                             .'</label>'
                           )
               );
  }   }
         $paramHash = Apache::lonhelper::getParamHash();          $paramHash = Apache::lonhelper::getParamHash();
  $paramHash->{'variable'} = 'LATEX_TYPE';      $paramHash->{'variable'} = 'LATEX_TYPE';   
Line 3172  CHOOSE_FROM_ANY_SEQUENCE Line 3205  CHOOSE_FROM_ANY_SEQUENCE
  }   }
         Apache::lonhelper::dropdown->new();          Apache::lonhelper::dropdown->new();
     
  addMessage("</td></tr><tr><td align='right'>".   &addMessage(&Apache::lonhtmlcommon::row_closure()
                    '<label for="TABLE_CONTENTS_forminput">'.                     .&Apache::lonhtmlcommon::row_title(
                    &mt('Print Table of Contents').                          '<label for="TABLE_CONTENTS_forminput">'
                    "</label>: </td><td>");                         .&mt('Print Table of Contents')
                          .'</label>'
                       )
           );
         $paramHash = Apache::lonhelper::getParamHash();          $paramHash = Apache::lonhelper::getParamHash();
  $paramHash->{'variable'} = 'TABLE_CONTENTS';      $paramHash->{'variable'} = 'TABLE_CONTENTS';   
  $helper->declareVar('TABLE_CONTENTS');            $helper->declareVar('TABLE_CONTENTS');         
Line 3183  CHOOSE_FROM_ANY_SEQUENCE Line 3219  CHOOSE_FROM_ANY_SEQUENCE
                                    ['No', 'no'],                                     ['No', 'no'],
                                    ['Yes', 'yes'] ];                                     ['Yes', 'yes'] ];
         Apache::lonhelper::dropdown->new();          Apache::lonhelper::dropdown->new();
  addMessage("</td></tr>");   &addMessage(&Apache::lonhtmlcommon::row_closure());
                   
  if (not $helper->{VARS}->{'construction'}) {   if (not $helper->{VARS}->{'construction'}) {
     addMessage("<tr><td align='right'>".      addMessage("<tr><td align='right'>".
Line 3242  CHOOSE_FROM_ANY_SEQUENCE Line 3278  CHOOSE_FROM_ANY_SEQUENCE
             my $stylefiletext=&mt("Use style file");              my $stylefiletext=&mt("Use style file");
             my $selectfiletext=&mt("Select style file");              my $selectfiletext=&mt("Select style file");
   
     my $xmlfrag .= <<"RNDSEED";      my $xmlfrag .= '<message>'
     <message><tr><td align='right'>              .&Apache::lonhtmlcommon::row_title('<label for="curseed_forminput">'
             <label for="curseed_forminput">$randseedtext</label>:                                                .$randseedtext
             </td><td></message>                                                .'</label>'
     <string variable="curseed" size="15" maxlength="15">               )
  <defaultvalue>              .'</message>
             return $helper->{VARS}->{'curseed'};              <string variable="curseed" size="15" maxlength="15">
         </defaultvalue>                  <defaultvalue>
     </string>                     return '.$helper->{VARS}->{'curseed'}.';
      <message></td></tr><tr><td align="right">                  </defaultvalue>'
              <label for="style_file">$stylefiletext</label>:              .'</string>'
              </td><td></message>              .'<message>'
               .&Apache::lonhtmlcommon::row_closure()
               .&Apache::lonhtmlcommon::row_title('<label for="style_file">'
                                                 .$stylefiletext
                                                 .'</label>'
                )
               .'</message>
              <string variable="style_file" size="40">               <string variable="style_file" size="40">
  <defaultvalue>                  <defaultvalue>
             return $stylevalue;                      return '.$stylevalue.';
         </defaultvalue>                  </defaultvalue>
              </string><message>&nbsp; <a href="javascript:openbrowser('helpform','style_file_forminput','sty')">$selectfiletext</a> </td></tr><tr><td></td><td align="left"></message>               </string><message>&nbsp;'
   .qq|<a href="javascript:openbrowser('helpform','style_file_forminput','sty')">|
   .$selectfiletext.'</a>'
               .&Apache::lonhtmlcommon::row_closure()
               .&Apache::lonhtmlcommon::row_title(&mt('Show all foils'))
               .'</message>
      <choices allowempty="1" multichoice="true" variable="showallfoils">       <choices allowempty="1" multichoice="true" variable="showallfoils">
                 <choice computer="1">Show all foils</choice>                  <choice computer="1">&nbsp;</choice>
              </choices>               </choices>'
      <message></td></tr></message>      .'<message>'
 RNDSEED              .&Apache::lonhtmlcommon::row_closure()
               .'</message>';
             &Apache::lonxml::xmlparse($r, 'helper', $xmlfrag);              &Apache::lonxml::xmlparse($r, 'helper', $xmlfrag);
   
   
     addMessage("<tr><td>Problem Type:</td><td>");              &addMessage(&Apache::lonhtmlcommon::row_title(&mt('Problem Type')));
     #      #
     # Initial value from construction space:      # Initial value from construction space:
     #      #
Line 3286  RNDSEED Line 3334  RNDSEED
 PROBTYPE  PROBTYPE
             &Apache::lonxml::xmlparse($r, 'helper', $xmlfrag);              &Apache::lonxml::xmlparse($r, 'helper', $xmlfrag);
           
     addMessage("</td></tr>");               &addMessage(&Apache::lonhtmlcommon::row_closure(1));
   
  }           }
     }      }
   
   
   
   
     if ($startedTable) {      if ($startedTable) {
  addMessage("</table>");          &addMessage(&Apache::lonhtmlcommon::end_pick_box());
     }      }
   
     Apache::lonprintout::page_format_state->new("FORMAT");      Apache::lonprintout::page_format_state->new("FORMAT");
Line 3397  sub render { Line 3445  sub render {
     my $pdfFormLabel=&mt('PDF-Formfields');      my $pdfFormLabel=&mt('PDF-Formfields');
     my $with=&mt('with Formfields');      my $with=&mt('with Formfields');
     my $without=&mt('without Formfields');      my $without=&mt('without Formfields');
     $result .= <<STATEHTML;      $result.='<h3>'.&mt('Layout Options').'</h3>'
               .&Apache::loncommon::start_data_table()
               .&Apache::loncommon::start_data_table_header_row()
               .'<th>'.$PageLayout.'</th>'
               .'<th>'.$NumberOfColumns.'</th>'
               .'<th>'.$PaperType.'</th>'
               .'<th>'.$pdfFormLabel.'</th>'
               .&Apache::loncommon::end_data_table_header_row()
               .&Apache::loncommon::start_data_table_row()
       .'<td>'
       .'<label><input type="radio" name="'.${var}.'.layout" value="L" />'.$landscape.'</label><br />'
       .'<label><input type="radio" name="'.${var}.'.layout" value="P" checked="checked" />'.$portrait.'</label>'
       .'</td>';
   
 <hr width="33%" />      $result.='<td align="center">'
 <table cellpadding="3">              .'<select name="'.${var}.'.cols">';
   <tr>  
     <td align="center"><b>$PageLayout</b></td>  
     <td align="center"><b>$NumberOfColumns</b></td>  
     <td align="center"><b>$PaperType</b></td>  
     <td align="center"><b>$pdfFormLabel</b></td>  
   </tr>  
   <tr>  
     <td>  
       <label><input type="radio" name="${var}.layout" value="L" /> $landscape </label><br />  
       <label><input type="radio" name="${var}.layout" value="P" checked='1'  /> $portrait </label>  
     </td>  
     <td align="center">  
       <select name="${var}.cols">  
 STATEHTML  
   
     my $i;      my $i;
     for ($i = 1; $i <= $maxColumns; $i++) {      for ($i = 1; $i <= $maxColumns; $i++) {
Line 3452  STATEHTML Line 3498  STATEHTML
             <option value='yes'>$with</option>              <option value='yes'>$with</option>
         </select>          </select>
     </td>      </td>
   </tr></table>  
 HTML  HTML
       $result.=&Apache::loncommon::end_data_table_row()
               .&Apache::loncommon::end_data_table();
   
     return $result;      return $result;
 }  }

Removed from v.1.543  
changed lines
  Added in v.1.544


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