version 1.495, 2007/01/15 11:53:50
|
version 1.498, 2007/04/20 20:13:58
|
Line 48 my %perm;
|
Line 48 my %perm;
|
my %parmhash; |
my %parmhash; |
my $resources_printed; |
my $resources_printed; |
|
|
|
# Fetch the contents of a resource, uninterpreted. |
|
# This is used here to fetch a latex file to be included |
|
# verbatim into the printout< |
|
# NOTE: Ask Guy if there is a lonnet function similar to this? |
|
# |
|
# Parameters: |
|
# URL of the file |
|
# |
|
sub fetch_raw_resource { |
|
my ($url) = @_; |
|
|
|
my $filename = &Apache::lonnet::filelocation("", $url); |
|
# |
|
# fetch if needed: |
|
# |
|
if (! -e $filename) { |
|
my $repcopy_result = &Apache::lonnet::repcopy($filename); |
|
|
|
if ($repcopy_result ne 'ok') { |
|
return "File open failed for $filename"; # This will bomb the print. |
|
} |
|
} |
|
my $contents = &Apache::lonnet::readfile($filename); |
|
|
|
return $contents; |
|
|
|
} |
|
|
# |
# |
# printf_style_subst item format_string repl |
# printf_style_subst item format_string repl |
# |
# |
Line 723 my %page_formats=
|
Line 751 my %page_formats=
|
'2' => ['3.66 in','9.8 in', '-0.57 in','-0.57 in','0.275 in'] |
'2' => ['3.66 in','9.8 in', '-0.57 in','-0.57 in','0.275 in'] |
}, |
}, |
'album' => { |
'album' => { |
'1' => [ '8.8 in', '6.8 in','-0.55 in', '-0.55 in','1.0 in'], |
'1' => [ '8.8 in', '6.8 in','-0.55 in', '-0.55 in','0.394 in'], |
'2' => [ '4.8 in', '6.8 in','-0.5 in', '-1.0 in','3.5 in'] |
'2' => [ '4.8 in', '6.8 in','-0.5 in', '-1.0 in','3.5 in'] |
}, |
}, |
}, |
}, |
Line 780 my %page_formats=
|
Line 808 my %page_formats=
|
'a4' => { |
'a4' => { |
'book' => { |
'book' => { |
'1' => ['17.6 cm','27.2 cm','-1.397 cm','-2.11 cm','-1.27 cm'], |
'1' => ['17.6 cm','27.2 cm','-1.397 cm','-2.11 cm','-1.27 cm'], |
'2' => [ '9.1 cm','27.2 cm','-1.397 c,','-2.11 cm','-1.27 cm'] |
'2' => [ '9.1 cm','27.2 cm','-1.397 cm','-2.11 cm','-1.27 cm'] |
}, |
}, |
'album' => { |
'album' => { |
'1' => ['21.59 cm','19.558 cm','-1.27 cm','-2.11 cm','0 cm'], |
'1' => ['21.59 cm','19.558 cm','-1.397cm','-2.11 cm','0 cm'], |
'2' => ['9.91 cm','19.558 cm','-1.397 cm','-2.11 cm','0 cm'] |
'2' => ['9.91 cm','19.558 cm','-1.397 cm','-2.11 cm','0 cm'] |
}, |
}, |
}, |
}, |
Line 1455 ENDPART
|
Line 1483 ENDPART
|
$resources_printed .= $currentURL.':'; |
$resources_printed .= $currentURL.':'; |
my $texversion=&Apache::lonnet::ssi($currentURL,%form); |
my $texversion=&Apache::lonnet::ssi($currentURL,%form); |
$result .= $texversion; |
$result .= $texversion; |
|
} elsif ($cleanURL =~/.tex$/) { |
|
# For this sort of print of a single LaTeX file, |
|
# We can just print the LaTeX file as it is uninterpreted in any way: |
|
# |
|
|
|
$result = &fetch_raw_resource($currentURL); |
|
|
} else { |
} else { |
$result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'}, |
$result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'}, |
$helper->{'VARS'}->{'symb'}); |
$helper->{'VARS'}->{'symb'}); |
Line 2798 CHOOSE_FROM_ANY_SEQUENCE
|
Line 2833 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'>Print: </td><td>"); |
addMessage("<hr width='33%' /><table><tr><td align='right'>". |
|
'<label for="ANSWER_TYPE_forminput">'. |
|
&mt('Print'). |
|
"</label>: </td><td>"); |
$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 2814 CHOOSE_FROM_ANY_SEQUENCE
|
Line 2852 CHOOSE_FROM_ANY_SEQUENCE
|
|
|
if ($perm{'pav'}) { |
if ($perm{'pav'}) { |
if (!$startedTable) { |
if (!$startedTable) { |
addMessage("<hr width='33%' /><table><tr><td align='right'>LaTeX mode: </td><td>"); |
addMessage("<hr width='33%' /><table><tr><td align='right'>". |
|
'<label for="LATEX_TYPE_forminput">'. |
|
&mt('LaTeX mode'). |
|
"</label>: </td><td>"); |
$startedTable = 1; |
$startedTable = 1; |
} else { |
} else { |
addMessage("<tr><td align='right'>LaTeX mode: </td><td>"); |
addMessage("<tr><td align='right'>". |
|
'<label for="LATEX_TYPE_forminput">'. |
|
&mt('LaTeX mode'). |
|
"</label>: </td><td>"); |
} |
} |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash->{'variable'} = 'LATEX_TYPE'; |
$paramHash->{'variable'} = 'LATEX_TYPE'; |
Line 2833 CHOOSE_FROM_ANY_SEQUENCE
|
Line 2877 CHOOSE_FROM_ANY_SEQUENCE
|
} |
} |
Apache::lonhelper::dropdown->new(); |
Apache::lonhelper::dropdown->new(); |
|
|
addMessage("</td></tr><tr><td align='right'>Print Table of Contents: </td><td>"); |
addMessage("</td></tr><tr><td align='right'>". |
|
'<label="TABLE_CONTENTS_forminput">'. |
|
&mt('Print Table of Contents'). |
|
"</label>: </td><td>"); |
$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 2844 CHOOSE_FROM_ANY_SEQUENCE
|
Line 2891 CHOOSE_FROM_ANY_SEQUENCE
|
addMessage("</td></tr>"); |
addMessage("</td></tr>"); |
|
|
if (not $helper->{VARS}->{'construction'}) { |
if (not $helper->{VARS}->{'construction'}) { |
addMessage("<tr><td align='right'>Print Index: </td><td>"); |
addMessage("<tr><td align='right'>". |
|
'<label for="TABLE_INDEX_forminput">'. |
|
&mt('Print Index'). |
|
"</label>: </td><td>"); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash->{'variable'} = 'TABLE_INDEX'; |
$paramHash->{'variable'} = 'TABLE_INDEX'; |
$helper->declareVar('TABLE_INDEX'); |
$helper->declareVar('TABLE_INDEX'); |
Line 2853 CHOOSE_FROM_ANY_SEQUENCE
|
Line 2903 CHOOSE_FROM_ANY_SEQUENCE
|
['Yes', 'yes'] ]; |
['Yes', 'yes'] ]; |
Apache::lonhelper::dropdown->new(); |
Apache::lonhelper::dropdown->new(); |
addMessage("</td></tr>"); |
addMessage("</td></tr>"); |
addMessage("<tr><td align='right'>Print Discussions: </td><td>"); |
addMessage("<tr><td align='right'>". |
|
'<label for="PRINT_DISCUSSIONS_forminput">'. |
|
&mt('Print Discussions'). |
|
"</label>: </td><td>"); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash->{'variable'} = 'PRINT_DISCUSSIONS'; |
$paramHash->{'variable'} = 'PRINT_DISCUSSIONS'; |
$helper->declareVar('PRINT_DISCUSSIONS'); |
$helper->declareVar('PRINT_DISCUSSIONS'); |
Line 2875 CHOOSE_FROM_ANY_SEQUENCE
|
Line 2928 CHOOSE_FROM_ANY_SEQUENCE
|
|
|
if ($helper->{'VARS'}->{'construction'}) { |
if ($helper->{'VARS'}->{'construction'}) { |
my $stylevalue=$env{'construct.style'}; |
my $stylevalue=$env{'construct.style'}; |
|
my $randseedtext=&mt("Use random seed"); |
|
my $stylefiletext=&mt("Use style file"); |
|
|
my $xmlfrag .= <<"RNDSEED"; |
my $xmlfrag .= <<"RNDSEED"; |
<message><tr><td align='right'>Use random seed: </td><td></message> |
<message><tr><td align='right'> |
|
<label for="curseed_forminput">$randseedtext</label>: |
|
</td><td></message> |
<string variable="curseed" size="15" maxlength="15"> |
<string variable="curseed" size="15" maxlength="15"> |
<defaultvalue> |
<defaultvalue> |
return $helper->{VARS}->{'curseed'}; |
return $helper->{VARS}->{'curseed'}; |
</defaultvalue> |
</defaultvalue> |
</string> |
</string> |
<message></td></tr><tr><td align="right">Use style file:</td><td></message> |
<message></td></tr><tr><td align="right"> |
|
<label for="style_file_value">$stylefiletext</label>: |
|
</td><td></message> |
<message><input type="text" size="40" name="style_file_value" value="$stylevalue" /> <a href="javascript:openbrowser('helpform','style_file_value','sty')">Select style file</a> </td><tr><td></message> |
<message><input type="text" size="40" name="style_file_value" value="$stylevalue" /> <a href="javascript:openbrowser('helpform','style_file_value','sty')">Select style file</a> </td><tr><td></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">Show all foils?</choice> |