version 1.20, 2006/08/18 20:24:53
|
version 1.24, 2012/10/04 12:40:29
|
Line 26
|
Line 26
|
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
|
|
|
|
|
|
package Apache::lonambiguous; |
package Apache::lonambiguous; |
|
|
use strict; |
use strict; |
Line 95 sub handler {
|
Line 97 sub handler {
|
$resurl => [$resurl,$resid]); |
$resurl => [$resurl,$resid]); |
untie(%bighash); |
untie(%bighash); |
$r->header_out(Location => |
$r->header_out(Location => |
&Apache::loncommon::absolute_url().$resurl); |
&Apache::lonnet::absolute_url().$resurl); |
return REDIRECT; |
return REDIRECT; |
} |
} |
} |
} |
Line 134 sub handler {
|
Line 136 sub handler {
|
# ----------------------------------- Okay, this should have appeared on a page |
# ----------------------------------- Okay, this should have appeared on a page |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->header_out(Location => |
$r->header_out(Location => |
&Apache::loncommon::absolute_url(). |
&Apache::lonnet::absolute_url(). |
&Apache::lonnet::clutter($page)); |
&Apache::lonnet::clutter($page)); |
return REDIRECT; |
return REDIRECT; |
} else { |
} else { |
Line 147 sub handler {
|
Line 149 sub handler {
|
if ($env{'request.enc'}) { |
if ($env{'request.enc'}) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->header_out(Location => |
$r->header_out(Location => |
&Apache::loncommon::absolute_url().'/adm/navmaps'); |
&Apache::lonnet::absolute_url().'/adm/navmaps'); |
return REDIRECT; |
return REDIRECT; |
} |
} |
# ------------------------------------------------ Would be standalone resource |
# ------------------------------------------------ Would be standalone resource |
Line 180 sub handler {
|
Line 182 sub handler {
|
my $symb=&make_symb($id); |
my $symb=&make_symb($id); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->header_out(Location => |
$r->header_out(Location => |
&Apache::loncommon::absolute_url(). |
&Apache::lonnet::absolute_url(). |
$resurl.'?symb='.$symb); |
$resurl.'?symb='.$symb); |
return REDIRECT; |
return REDIRECT; |
} |
} |
Line 190 sub handler {
|
Line 192 sub handler {
|
$r->send_http_header; |
$r->send_http_header; |
my $start_page= |
my $start_page= |
&Apache::loncommon::start_page('Pick Instance of Resource'); |
&Apache::loncommon::start_page('Pick Instance of Resource'); |
$r->print(<<ENDSTART); |
$r->print( |
$start_page |
$start_page |
The resource you had been accessing appears more than once in this course, |
.'<p class="LC_warning">' |
and LON-CAPA has insufficient session information to determine which instance |
.&mt('The resource you had been accessing appears more than' |
of the resource you meant. |
.' once in this course, and LON-CAPA has insufficient' |
<p> |
.' session information to determine which instance' |
Please click on the instance of the resource you intended to access: |
.' of the resource you meant.') |
</p> |
.'</p>' |
<table border="2"> |
.'<p>' |
<tr><th>Title</th><th>Part of ...</th></tr> |
.&mt('Please click on the instance of the resource you' |
ENDSTART |
.' intended to access:') |
|
.'</p>' |
|
); |
|
$r->print( |
|
&Apache::loncommon::start_data_table() |
|
.&Apache::loncommon::start_data_table_header_row() |
|
.'<th>'.&mt('Title').'</th>' |
|
.'<th>'.&mt('Part of ...').'</th>' |
|
.&Apache::loncommon::end_data_table_header_row() |
|
.&Apache::loncommon::start_data_table_row() |
|
); |
map { |
map { |
my $resurl=$bighash{'src_'.$_}; |
my $resurl=$bighash{'src_'.$_}; |
my $mapurl=$bighash{'map_id_'.(split(/\./,$_))[0]}; |
my $mapurl=$bighash{'map_id_'.(split(/\./,$_))[0]}; |
my $symb=&make_symb($_); |
my $symb=&make_symb($_); |
$r->print('<tr><td><a href="'.$resurl.'?symb='.$symb.'">'. |
$r->print( |
&Apache::lonnet::gettitle($symb). |
&Apache::loncommon::start_data_table_row() |
'</a></td><td>'. |
.'<td><a href="'.$resurl.'?symb='.$symb.'">' |
&Apache::lonnet::gettitle($mapurl).' '. |
.&Apache::lonnet::gettitle($symb) |
'</td></tr>'); |
.'</a></td>' |
|
.'<td>'.&Apache::lonnet::gettitle($mapurl).' </td>' |
|
.&Apache::loncommon::end_data_table_row() |
|
); |
} @possibilities; |
} @possibilities; |
$r->print('</table>'.&Apache::loncommon::end_page()); |
$r->print( |
untie(%bighash); |
&Apache::loncommon::end_data_table() |
|
.&Apache::loncommon::end_page() |
|
); |
|
untie(%bighash); |
return OK; |
return OK; |
} |
} |
} |
} |
Line 230 __END__
|
Line 248 __END__
|
|
|
|
|
|
|
|
=head1 NAME |
|
|
|
Apache::lonambiguous |
|
|
|
=head1 SYNOPSIS |
|
|
|
Handler to resolve ambiguous file locations. |
|
|
|
This is part of the LearningOnline Network with CAPA project |
|
described at http://www.lon-capa.org. |
|
|
|
=head1 HANDLER SUBROUTINE |
|
|
|
make_symb() |
|
|
|
and |
|
|
|
handler() |
|
|
|
=head1 OTHER SUBROUTINES |
|
|
|
=over |
|
|
|
=item * |
|
|
|
cleanup() |
|
|
|
=item * |
|
|
|
getlost() |
|
|
|
=back |
|
|
|
=cut |
|
|
|
|
|
|