--- loncom/interface/lonprintout.pm 2003/08/21 15:50:35 1.222 +++ loncom/interface/lonprintout.pm 2003/08/25 17:25:05 1.223 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.222 2003/08/21 15:50:35 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.223 2003/08/25 17:25:05 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -971,6 +971,13 @@ sub handler { use Apache::lonhelper; +sub addMessage { + my $text = shift; + my $paramHash = Apache::lonhelper::getParamHash(); + $paramHash->{MESSAGE_TEXT} = $text; + Apache::lonhelper::message->new(); +} + sub printHelper { my $r = shift; @@ -1155,7 +1162,7 @@ HELPERFRAGMENT - +
Select resources for the assignment
@@ -1198,7 +1205,7 @@ CHOOSE_FROM_SUBDIR } # 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->{MESSAGE_TEXT} = ""; Apache::lonhelper::message->new(); @@ -1208,78 +1215,81 @@ CHOOSE_FROM_SUBDIR $paramHash->{CHOICES} = $printChoices; 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 ($helper->{VARS}->{'construction'} eq '1')) { - $paramHash = Apache::lonhelper::getParamHash(); - $paramHash->{MESSAGE_TEXT} = "
Next four options are available only for advanced users: "; - Apache::lonhelper::message->new(); + addMessage("
"); + $startedTable = 1; } if ($ENV{'request.role.adv'}) { - $paramHash = Apache::lonhelper::getParamHash(); - $paramHash->{MESSAGE_TEXT} = "
Print With Answers:"); $paramHash = Apache::lonhelper::getParamHash(); $paramHash->{'variable'} = 'ANSWER_TYPE'; $helper->declareVar('ANSWER_TYPE'); $paramHash->{CHOICES} = [ - ['Print without answer', 'yes'], - ['Print with answers', 'no'] ]; + ['Yes', 'yes'], + ['No', 'no'] ]; Apache::lonhelper::dropdown->new(); + addMessage("
 "; - Apache::lonhelper::message->new(); + if (!$startedTable) { + addMessage("
"); if (not $helper->{VARS}->{'construction'}) { - $paramHash = Apache::lonhelper::getParamHash(); - $paramHash->{MESSAGE_TEXT} = ""); } if ($helper->{VARS}->{'construction'}) { - $paramHash = Apache::lonhelper::getParamHash(); - $paramHash->{MESSAGE_TEXT} = ""); } + } - $paramHash = Apache::lonhelper::getParamHash(); - $paramHash->{MESSAGE_TEXT} = "
LaTeX mode: "); + $startedTable = 1; + } else { + addMessage("
LaTeX mode: "); + } $paramHash = Apache::lonhelper::getParamHash(); $paramHash->{'variable'} = 'LATEX_TYPE'; $helper->declareVar('LATEX_TYPE'); if ($helper->{VARS}->{'construction'} eq '1') { $paramHash->{CHOICES} = [ - ['Print in standard LaTeX mode', 'standard'], - ['Print in LaTeX batchmode', 'batchmode'], ]; + ['standard LaTeX mode', 'standard'], + ['LaTeX batchmode', 'batchmode'], ]; } else { $paramHash->{CHOICES} = [ - ['Print in LaTeX batchmode', 'batchmode'], - ['Print in standard LaTeX mode', 'standard'] ]; + ['LaTeX batchmode', 'batchmode'], + ['standard LaTeX mode', 'standard'] ]; } Apache::lonhelper::dropdown->new(); - $paramHash = Apache::lonhelper::getParamHash(); - $paramHash->{MESSAGE_TEXT} = "
 "; - Apache::lonhelper::message->new(); + addMessage("
Print Table of Contents: "); $paramHash = Apache::lonhelper::getParamHash(); $paramHash->{'variable'} = 'TABLE_CONTENTS'; $helper->declareVar('TABLE_CONTENTS'); $paramHash->{CHOICES} = [ - ['Print without Table of Contents', 'no'], - ['Print with Table of Contents', 'yes'] ]; + ['No', 'no'], + ['Yes', 'yes'] ]; Apache::lonhelper::dropdown->new(); + addMessage("
 "; - Apache::lonhelper::message->new(); + addMessage("
Print Index: "); $paramHash = Apache::lonhelper::getParamHash(); $paramHash->{'variable'} = 'TABLE_INDEX'; $helper->declareVar('TABLE_INDEX'); $paramHash->{CHOICES} = [ - ['Print without Index', 'no'], - ['Print with Index', 'yes'] ]; + ['No', 'no'], + ['Yes', 'yes'] ]; Apache::lonhelper::dropdown->new(); + addMessage("
 "; - Apache::lonhelper::message->new(); + addMessage("
Print With URL: "); $paramHash = Apache::lonhelper::getParamHash(); $paramHash->{'variable'} = 'CONSTR_RESOURSE_URL'; $helper->declareVar('CONSTR_RESOURSE_URL'); $paramHash->{CHOICES} = [ - ['Print without URL', 'no'], - ['Print with UTL', 'yes'] ]; + ['No', 'no'], + ['Yes', 'yes'] ]; Apache::lonhelper::dropdown->new(); + addMessage("
"; - Apache::lonhelper::message->new(); + if ($startedTable) { + addMessage("
"); } Apache::lonprintout::page_format_state->new("FORMAT"); @@ -1370,7 +1380,7 @@ sub render { $result .= <What page format do you prefer?

+
Page layout