version 1.84.2.1, 2007/09/26 00:34:31
|
version 1.93, 2010/03/16 19:56:02
|
Line 27
|
Line 27
|
# |
# |
### |
### |
|
|
|
|
|
|
|
|
package Apache::lonpage; |
package Apache::lonpage; |
|
|
use strict; |
use strict; |
Line 78 sub tracetable {
|
Line 81 sub tracetable {
|
my $frid=$hash{'map_finish_'.$hash{'src_'.$rid}}; |
my $frid=$hash{'map_finish_'.$hash{'src_'.$rid}}; |
$sofar= |
$sofar= |
&tracetable($sofar,$hash{'map_start_'.$hash{'src_'.$rid}}, |
&tracetable($sofar,$hash{'map_start_'.$hash{'src_'.$rid}}, |
'&'.$frid.'&'); |
'&'.$frid.$beenhere); |
$sofar++; |
$sofar++; |
if ($hash{'src_'.$frid}) { |
if ($hash{'src_'.$frid}) { |
my $brepriv=&Apache::lonnet::allowed('bre',$hash{'src_'.$frid}); |
my $brepriv=&Apache::lonnet::allowed('bre',$hash{'src_'.$frid}); |
Line 271 sub handler {
|
Line 274 sub handler {
|
if ($target eq 'tex') { |
if ($target eq 'tex') { |
$output =~ s/^([^&]+)\\begin{document}//; |
$output =~ s/^([^&]+)\\begin{document}//; |
$output =~ s/\\end{document}//; |
$output =~ s/\\end{document}//; |
$output = '\parbox{\minipagewidth}{ '.$output.' }'; |
# $output = '\parbox{\minipagewidth}{ '.$output.' }'; |
#some additional cleanup necessary for LateX (due to limitations of table environment |
#some additional cleanup necessary for LateX (due to limitations of table environment |
$output =~ s/(\\vskip\s*\d+mm)\s*(\\\\)+/$1/g; |
$output =~ s/(\\vskip\s*\d+mm)\s*(\\\\)+/$1/g; |
} |
} |
Line 339 sub handler {
|
Line 342 sub handler {
|
} |
} |
$thisdir=~s/\/[^\/]*$//; |
$thisdir=~s/\/[^\/]*$//; |
foreach (@rlinks) { |
foreach (@rlinks) { |
unless (($_=~/^http:\/\//i) || |
unless (($_=~/^https?\:\/\//i) || |
($_=~/^\//) || |
($_=~/^\//) || |
($_=~/^javascript:/i) || |
($_=~/^javascript:/i) || |
($_=~/^mailto:/i) || |
($_=~/^mailto:/i) || |
Line 378 sub handler {
|
Line 381 sub handler {
|
$r->send_http_header; |
$r->send_http_header; |
# ------------------------------------------------------------------------ Head |
# ------------------------------------------------------------------------ Head |
if ($allscript) { |
if ($allscript) { |
$allscript .= |
$allscript = |
"\n<script type=\"text/javascript\">\n". |
"\n".'<script type="text/javascript">'."\n". |
$allscript."\n</script>\n"; |
$allscript. |
|
"\n</script>\n"; |
} |
} |
# ------------------------------------------------------------------ Start body |
# ------------------------------------------------------------------ Start body |
$r->print(&Apache::loncommon::start_page(undef,undef, |
$r->print(&Apache::loncommon::start_page(undef,$allscript, |
{'force_register' => 1, |
{'force_register' => 1, |
'bgcolor' => '#ffffff',})); |
'bgcolor' => '#ffffff',})); |
# ------------------------------------------------------------------ Start form |
# ------------------------------------------------------------------ Start form |
Line 393 sub handler {
|
Line 397 sub handler {
|
.'">'); |
.'">'); |
} |
} |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$r->print('\documentclass{article} |
# I think this is not needed as the header |
\newcommand{\keephidden}[1]{} |
# will be put in for each of the page parts |
\usepackage[dvips]{graphicx} |
# by the londefdef.pm now that we are opening up |
\usepackage{epsfig} |
# the parts of a page. |
\usepackage{calc} |
#$r->print('\documentclass{article} |
\usepackage{longtable} |
# \newcommand{\keephidden}[1]{} |
\begin{document}'); |
# \usepackage[dvips]{graphicx} |
|
# \usepackage{epsfig} |
|
# \usepackage{calc} |
|
# \usepackage{longtable} |
|
# \begin{document}'); |
} |
} |
# ----------------------------------------------------------------- Start table |
# ----------------------------------------------------------------- Start table |
if ($target eq 'tex') { |
if ($target eq 'tex') { |
$r->print('\begin{longtable}INSERTTHEHEADOFLONGTABLE\endfirsthead\endhead '); |
# # $r->print('\begin{longtable}INSERTTHEHEADOFLONGTABLE\endfirsthead\endhead '); |
if ($number_of_columns le $lcm) {$number_of_columns=$lcm;}; |
if ($number_of_columns le $lcm) {$number_of_columns=$lcm;}; |
} else { |
} else { |
$r->print('<table width="100%" cols="'.$lcm.'" border="0">'); |
$r->print('<table width="100%" cols="'.$lcm.'" border="0">'); |
Line 470 sub handler {
|
Line 478 sub handler {
|
unless ($target eq 'tex') { |
unless ($target eq 'tex') { |
$r->print('</td>'); |
$r->print('</td>'); |
} else { |
} else { |
for (my $incol=1;$incol<=$avespan;$incol++) { |
# for (my $incol=1;$incol<=$avespan;$incol++) { |
$r->print(' & '); |
# $r->print(' & '); |
} |
# } |
} |
} |
} |
} |
unless ($target eq 'tex') { |
unless ($target eq 'tex') { |
$r->print('</tr>'); |
$r->print('</tr>'); |
} else { |
} else { |
$r->print('REMOVETHEHEADOFLONGTABLE\\\\'); |
# $r->print('REMOVETHEHEADOFLONGTABLE\\\\'); |
} |
} |
} |
} |
} |
} |
unless ($target eq 'tex') { |
unless ($target eq 'tex') { |
$r->print("\n</table>"); |
$r->print("\n</table>"); |
} else { |
} else { |
$r->print('\end{longtable}\strut'); |
# $r->print('\end{longtable}\strut'); |
} |
} |
# ---------------------------------------------------------------- Submit, etc. |
# ---------------------------------------------------------------- Submit, etc. |
if ($nforms) { |
if ($nforms) { |
Line 530 sub handler {
|
Line 538 sub handler {
|
sub get_buttons { |
sub get_buttons { |
my ($hash,$rid) = @_; |
my ($hash,$rid) = @_; |
|
|
# which icons do we use? |
|
my $extension='png'; |
|
if ($env{'environment.icons'} eq 'classic') { $extension='gif'; } |
|
|
|
my $metainfo = ''; |
my $metainfo = ''; |
my $esrc=&Apache::lonnet::declutter($hash->{'src_'.$rid}); |
my $esrc=&Apache::lonnet::declutter($hash->{'src_'.$rid}); |
my ($mapid,$resid)=split(/\./,$rid); |
my ($mapid,$resid)=split(/\./,$rid); |
Line 550 sub get_buttons {
|
Line 554 sub get_buttons {
|
|| !$hash->{'encrypted_'.$rid})) { |
|| !$hash->{'encrypted_'.$rid})) { |
$metainfo .='<a name="'.&escape($symb).'" />'. |
$metainfo .='<a name="'.&escape($symb).'" />'. |
'<a href="'.$hash->{'src_'.$rid}.'.meta'.'" target="LONcatInfo">'. |
'<a href="'.$hash->{'src_'.$rid}.'.meta'.'" target="LONcatInfo">'. |
'<img src="/adm/lonMisc/cat_button.'.$extension.'" class="LC_icon" />'. |
'<img src="/adm/lonMisc/cat_button.png" class="LC_icon" />'. |
'</a>'; |
'</a>'; |
} |
} |
$metainfo .= '<a href="/adm/evaluate?postdata='. |
$metainfo .= '<a href="/adm/evaluate?postdata='. |
&escape($esrc). |
&escape($esrc). |
'" target="LONcatInfo">'. |
'" target="LONcatInfo">'. |
'<img src="/adm/lonMisc/eval_button.'.$extension.'" class="LC_icon" />'. |
'<img src="/adm/lonMisc/eval_button.png" class="LC_icon" />'. |
'</a>'; |
'</a>'; |
if (($hash->{'src_'.$rid}=~/\.(problem|exam|quiz|assess|survey|form)$/) && |
if (($hash->{'src_'.$rid}=~/\.(problem|exam|quiz|assess|survey|form)$/) && |
($hash->{'src_'.$rid} !~ m-^/uploaded/-)) { |
($hash->{'src_'.$rid} !~ m-^/uploaded/-)) { |
Line 566 sub get_buttons {
|
Line 570 sub get_buttons {
|
'<a href="/adm/grades?symb='.&escape($symb). |
'<a href="/adm/grades?symb='.&escape($symb). |
# '&command=submission" target="LONcatInfo">'. |
# '&command=submission" target="LONcatInfo">'. |
'&command=submission">'. |
'&command=submission">'. |
'<img src="/adm/lonMisc/subm_button.'.$extension.'" class="LC_icon" />'. |
'<img src="/adm/lonMisc/subm_button.png" class="LC_icon" />'. |
'</a>'. |
'</a>'. |
'<a href="/adm/grades?symb='.&escape($symb). |
'<a href="/adm/grades?symb='.&escape($symb). |
# '&command=gradingmenu" target="LONcatInfo">'. |
# '&command=gradingmenu" target="LONcatInfo">'. |
'&command=gradingmenu">'. |
'&command=gradingmenu">'. |
'<img src="/adm/lonMisc/pgrd_button.'.$extension.'" class="LC_icon" />'. |
'<img src="/adm/lonMisc/pgrd_button.png" class="LC_icon" />'. |
'</a>'; |
'</a>'; |
} |
} |
if (&Apache::lonnet::allowed('opa',$env{'request.course.id'})) { |
if (&Apache::lonnet::allowed('opa',$env{'request.course.id'})) { |
Line 579 sub get_buttons {
|
Line 583 sub get_buttons {
|
'<a href="/adm/parmset?symb='.&escape($symb). |
'<a href="/adm/parmset?symb='.&escape($symb). |
# '" target="LONcatInfo">'. |
# '" target="LONcatInfo">'. |
'" >'. |
'" >'. |
'<img src="/adm/lonMisc/pprm_button.'.$extension.'" class="LC_icon" />'. |
'<img src="/adm/lonMisc/pprm_button.png" class="LC_icon" />'. |
'</a>'; |
'</a>'; |
} |
} |
} |
} |
Line 589 sub get_buttons {
|
Line 593 sub get_buttons {
|
1; |
1; |
__END__ |
__END__ |
|
|
|
|
=head1 NAME |
=head1 NAME |
|
|
Apache::lonpage - Page Handler |
Apache::lonpage - Page Handler |
Line 690 tracetable() : Build page table.
|
Line 695 tracetable() : Build page table.
|
=cut |
=cut |
|
|
|
|
|
|
|
|