version 1.22.4.7, 2017/04/02 13:35:30
|
version 1.29, 2015/03/01 20:42:08
|
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 49 sub real_handler {
|
Line 48 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) { |
&Apache::loncommon::content_type($r,'text/html'); |
if ($env{'browser.mathml'}) { |
|
&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; |
} |
} |
|
|
# Check for critical messages and redirect if present. |
# Check for critical messages and redirect if present. |
my ($redirect,$url) = &Apache::loncommon::critical_redirect(300); |
my ($redirect,$url) = &Apache::loncommon::critical_redirect(300); |
if ($redirect) { |
if ($redirect) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
Line 62 sub real_handler {
|
Line 65 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=(); |
|
|
# Create the nav map |
# Create the nav map |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
Line 92 sub real_handler {
|
Line 86 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 117 sub real_handler {
|
Line 108 sub real_handler {
|
$start_page = &Apache::loncommon::start_page($title,undef,$args); |
$start_page = &Apache::loncommon::start_page($title,undef,$args); |
} |
} |
$r->print($start_page. |
$r->print($start_page. |
'<script type="text/javascript">window.focus();</script>'); |
'<script type="text/javascript">'."\n". |
|
'// <![CDATA['."\n". |
|
'window.focus();'."\n". |
|
'// ]]>'."\n". |
|
'</script>'); |
&startContentScreen($r,'navmaps'); |
&startContentScreen($r,'navmaps'); |
$r->rflush(); |
$r->rflush(); |
|
|
Line 130 sub real_handler {
|
Line 125 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; |
Line 320 sub startContentScreen {
|
Line 314 sub startContentScreen {
|
$r->print('<li '.(($mode eq 'supplemental')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>'); |
$r->print('<li '.(($mode eq 'supplemental')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>'); |
} |
} |
$r->print('<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b> '.&mt('Content Search').' </b></a></li>'."\n"); |
$r->print('<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b> '.&mt('Content Search').' </b></a></li>'."\n"); |
|
$r->print('<li'.(($mode eq 'courseindex')?' class="active"':'').'><a href="/adm/indexcourse"><b> '.&mt('Content Index').' </b></a></li>'."\n"); |
$r->print("\n".'</ul>'."\n"); |
$r->print("\n".'</ul>'."\n"); |
$r->print('<div class="LC_Box" style="clear:both;margin:0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;"><div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">'); |
$r->print('<div class="LC_Box" style="clear:both;margin:0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;"><div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">'); |
} |
} |