version 1.33, 2002/12/06 14:06:53
|
version 1.37, 2003/03/08 01:39:29
|
Line 50 use GDBM_File;
|
Line 50 use GDBM_File;
|
|
|
my %hash; |
my %hash; |
|
|
|
sub cleanup { |
|
if (tied(%hash)){ |
|
&Apache::lonnet::logthis('Cleanup pageflip: hash'); |
|
unless (untie(%hash)) { |
|
&Apache::lonnet::logthis('Failed cleanup pageflip: hash'); |
|
} |
|
} |
|
} |
|
|
sub addrid { |
sub addrid { |
my ($current,$new,$condid)=@_; |
my ($current,$new,$condid)=@_; |
unless ($condid) { $condid=0; } |
unless ($condid) { $condid=0; } |
Line 176 sub handler {
|
Line 185 sub handler {
|
my $redirecturl=''; |
my $redirecturl=''; |
my $next=''; |
my $next=''; |
my @possibilities=(); |
my @possibilities=(); |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['postdata']); |
if (($ENV{'form.postdata'})&&($ENV{'request.course.fn'})) { |
if (($ENV{'form.postdata'})&&($ENV{'request.course.fn'})) { |
$ENV{'form.postdata'}=~/(\w+)\:(.*)/; |
$ENV{'form.postdata'}=~/(\w+)\:(.*)/; |
my $direction=$1; |
my $direction=$1; |
Line 189 sub handler {
|
Line 199 sub handler {
|
untie(%hash); |
untie(%hash); |
} |
} |
my $newloc; |
my $newloc; |
if ($last) { |
if (($last) && (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', |
$newloc=&Apache::lonnet::clutter((split(/\_\_\_/,$last))[1]); |
&GDBM_READER(),0640))) { |
|
my ($murl,$fn)=split(/\_\_\_/,$last); |
|
my $id; |
|
($murl,$id,$fn)=split(/\_\_\_/,&Apache::lonnet::symbread($fn)); |
|
$newloc=$hash{'src_'. |
|
$hash{'map_pc_'.&Apache::lonnet::clutter($murl)}.'.'.$id}; |
|
unless ($newloc) { $newloc='/adm/noidea.html'; } |
|
untie %hash; |
} else { |
} else { |
$newloc='/adm/noidea.html'; |
$newloc='/adm/noidea.html'; |
} |
} |
Line 202 sub handler {
|
Line 219 sub handler {
|
} |
} |
$currenturl=~s/^http\:\/\///; |
$currenturl=~s/^http\:\/\///; |
$currenturl=~s/^[^\/]+//; |
$currenturl=~s/^[^\/]+//; |
unless ($currenturl=~/^\/(res|adm\/wrapper|public|adm\/coursedocs)\//) { |
# |
|
# Is the current URL on the map? If not, start with last known URL |
|
# |
|
unless (&Apache::lonnet::is_on_map($currenturl)) { |
my $last; |
my $last; |
if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', |
if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', |
&GDBM_READER(),0640)) { |
&GDBM_READER(),0640)) { |
Line 314 sub handler {
|
Line 334 sub handler {
|
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->send_http_header; |
$r->send_http_header; |
if ($#possibilities>0) { |
if ($#possibilities>0) { |
|
my $bodytag= |
|
&Apache::loncommon::bodytag('Multiple Resources'); |
$r->print(<<ENDSTART); |
$r->print(<<ENDSTART); |
<head><title>Choose Next Location</title></head> |
<head><title>Choose Next Location</title></head> |
<body bgcolor="#FFFFFF"> |
$bodytag |
<h1>LON-CAPA</h1> |
<h3>There are several possibilities of where to go next</h3> |
There are several possibilities of where to go next. |
|
<p> |
<p> |
Please click on the the resource you intend to access: |
Please click on the the resource you intend to access: |
<p> |
<p> |
Line 337 ENDSTART
|
Line 358 ENDSTART
|
$r->print('</table></body></html>'); |
$r->print('</table></body></html>'); |
return OK; |
return OK; |
} else { |
} else { |
|
my $bodytag=&Apache::loncommon::bodytag('No Resource'); |
$r->print(<<ENDNONE); |
$r->print(<<ENDNONE); |
<head><title>Choose Next Location</title></head> |
<head><title>No Resource</title></head> |
<body bgcolor="#FFFFFF"> |
$bodytag |
<img src="/adm/lonIcons/lonlogos.gif" align=right> |
<h3>Next resource could not be identified.</h3> |
<h1>Sorry!</h1> |
<p>You probably are at the <b>beginning</b> or the <b>end</b> of the |
<h2>Next resource could not be identified.</h2> |
course.</p> |
<h3>You probably are at the beginning or the end of the course.</h3> |
<ul> |
|
<li><a href="/adm/flip?postdata=return:">Go Back</a></li> |
|
<li><a href="/adm/navmaps">Navigate Course Content</a></li> |
|
</ul> |
</body> |
</body> |
</html> |
</html> |
ENDNONE |
ENDNONE |