version 1.29, 2015/03/01 20:42:08
|
version 1.33, 2016/04/02 04:30:21
|
Line 38 use Apache::lonhtmlcommon();
|
Line 38 use Apache::lonhtmlcommon();
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::londocs(); |
use Apache::londocs(); |
|
use Apache::lonuserstate; |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
Line 48 sub real_handler {
|
Line 49 sub real_handler {
|
my $r = shift; |
my $r = shift; |
# Handle header-only request |
# Handle header-only request |
if ($r->header_only) { |
if ($r->header_only) { |
if ($env{'browser.mathml'}) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/xml'); |
|
} else { |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
} |
|
$r->send_http_header; |
$r->send_http_header; |
return OK; |
return OK; |
} |
} |
Line 65 sub real_handler {
|
Line 62 sub real_handler {
|
return REDIRECT; |
return REDIRECT; |
} |
} |
|
|
|
# Check if course needs to be re-initialized |
|
my $loncaparev = $r->dir_config('lonVersion'); |
|
my ($result,@reinit) = &Apache::loncommon::needs_coursereinit($loncaparev); |
|
|
|
if ($result eq 'switch') { |
# Send header, don't cache this page |
|
if ($env{'browser.mathml'}) { |
|
&Apache::loncommon::content_type($r,'text/xml'); |
|
} else { |
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
$r->print(&Apache::loncommon::check_release_result(@reinit)); |
|
return OK; |
|
} elsif ($result eq 'update') { |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my ($furl,$ferr) = &Apache::lonuserstate::readmap("$cdom/$cnum"); |
|
if ($ferr) { |
|
my $requrl = $r->uri; |
|
$env{'user.error.msg'}="$requrl:bre:0:0:Course not initialized"; |
|
$env{'user.reinit'} = 1; |
|
return HTTP_NOT_ACCEPTABLE; |
|
} |
} |
} |
&Apache::loncommon::no_cache($r); |
|
|
|
my %toplinkitems=(); |
my $course_type = &Apache::loncommon::course_type(); |
|
if (($course_type eq 'Placement') && (!$env{'request.role.adv'})) { |
|
my $furl = &Apache::lonpageflip::first_accessible_resource(); |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->header_out(Location => $furl); |
|
return REDIRECT; |
|
} |
|
|
# Create the nav map |
# Create the nav map |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
Line 86 sub real_handler {
|
Line 100 sub real_handler {
|
$env{'user.reinit'} = 1; |
$env{'user.reinit'} = 1; |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
|
|
|
# Send header, don't cache this page |
|
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
# ------------------------------------------------------------ Get query string |
# ------------------------------------------------------------ Get query string |
Line 125 sub real_handler {
|
Line 142 sub real_handler {
|
return OK; |
return OK; |
} |
} |
|
|
|
my %toplinkitems=(); |
my @resources = $navmap->retrieveResources(); |
my @resources = $navmap->retrieveResources(); |
my $sequenceCount = 0; |
my $sequenceCount = 0; |
my $problemCount = 0; |
my $problemCount = 0; |