version 1.22.4.11, 2024/07/02 02:17:56
|
version 1.38, 2021/02/18 14:48:02
|
Line 39 use Apache::lonnet;
|
Line 39 use Apache::lonnet;
|
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::londocs(); |
use Apache::londocs(); |
use Apache::lonuserstate; |
use Apache::lonuserstate; |
|
use LONCAPA::ltiutils; |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
Line 54 sub real_handler {
|
Line 55 sub real_handler {
|
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,'contents'); |
if ($redirect) { |
if ($redirect) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->header_out(Location => $url); |
$r->header_out(Location => $url); |
Line 65 sub real_handler {
|
Line 66 sub real_handler {
|
# ------------------------------------------------------------ Get query string |
# ------------------------------------------------------------ Get query string |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['sort', |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['sort', |
'showOnlyHomework', |
'showOnlyHomework', |
'postsymb']); |
'postsymb','register']); |
# Check if course needs to be re-initialized |
# Check if course needs to be re-initialized |
my $loncaparev = $r->dir_config('lonVersion'); |
my $loncaparev = $r->dir_config('lonVersion'); |
my ($result,@reinit) = &Apache::loncommon::needs_coursereinit($loncaparev); |
my ($result,@reinit) = &Apache::loncommon::needs_coursereinit($loncaparev); |
Line 111 ENDCLOSE
|
Line 112 ENDCLOSE
|
} |
} |
} |
} |
|
|
|
my $course_type = &Apache::loncommon::course_type(); |
|
if (($course_type eq 'Placement') && (!$env{'request.role.adv'})) { |
|
my $furl = &Apache::lonpageflip::first_accessible_resource(); |
|
if ($result eq 'update') { |
|
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
|
$r->print($closure.&Apache::loncommon::end_page()); |
|
return OK; |
|
} else { |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->header_out(Location => $furl); |
|
return REDIRECT; |
|
} |
|
} |
|
|
|
if ($env{'request.lti.login'}) { |
|
if ($env{'request.lti.uri'} ne '') { |
|
my $cid = $env{'request.course.id'}; |
|
my $cnum = $env{'course.'.$cid.'.num'}; |
|
my $cdom = $env{'course.'.$cid.'.domain'}; |
|
my ($scope,$url) = &LONCAPA::ltiutils::lti_provider_scope($env{'request.lti.uri'},$cdom,$cnum); |
|
if (($scope eq 'map') || ($scope eq 'resource')) { |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->header_out(Location => $url); |
|
return REDIRECT; |
|
} |
|
} |
|
} |
|
|
# Create the nav map |
# Create the nav map |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
|
Line 229 ENDCLOSE
|
Line 258 ENDCLOSE
|
} |
} |
} else { |
} else { |
my $link = '/adm/navmaps?jumpToFirstHomework'; |
my $link = '/adm/navmaps?jumpToFirstHomework'; |
|
if ($env{'form.register'}) { |
|
$link .= '&register='.$env{'form.register'}; |
|
} |
unless ($notools) { |
unless ($notools) { |
&Apache::lonnavmaps::add_linkitem(\%toplinkitems,'firsthomework', |
&Apache::lonnavmaps::add_linkitem(\%toplinkitems,'firsthomework', |
'location.href="'.$link.'"', |
'location.href="'.$link.'"', |
Line 249 ENDCLOSE
|
Line 281 ENDCLOSE
|
return $res->completable() || $res->is_map(); |
return $res->completable() || $res->is_map(); |
}; |
}; |
my $link = '/adm/navmaps?sort='.$env{'form.sort'}; |
my $link = '/adm/navmaps?sort='.$env{'form.sort'}; |
|
if ($env{'form.register'}) { |
|
$link .= '&register='.$env{'form.register'}; |
|
} |
&Apache::lonnavmaps::add_linkitem(\%toplinkitems,'everything', |
&Apache::lonnavmaps::add_linkitem(\%toplinkitems,'everything', |
'location.href="'.$link.'"', |
'location.href="'.$link.'"', |
'Show everything'); |
'Show everything'); |
Line 258 ENDCLOSE
|
Line 293 ENDCLOSE
|
$resource_no_folder_link = 1; |
$resource_no_folder_link = 1; |
} else { |
} else { |
my $link = '/adm/navmaps?sort='.$env{'form.sort'}.'&showOnlyHomework=1'; |
my $link = '/adm/navmaps?sort='.$env{'form.sort'}.'&showOnlyHomework=1'; |
|
if ($env{'form.register'}) { |
|
$link .= '&register='.$env{'form.register'}; |
|
} |
unless ($notools) { |
unless ($notools) { |
&Apache::lonnavmaps::add_linkitem(\%toplinkitems,'uncompleted', |
&Apache::lonnavmaps::add_linkitem(\%toplinkitems,'uncompleted', |
'location.href="'.$link.'"', |
'location.href="'.$link.'"', |
Line 279 ENDCLOSE
|
Line 317 ENDCLOSE
|
<option value="duedate"'.$selected{'duedate'}.'>'.&mt('Due Date').'</option> |
<option value="duedate"'.$selected{'duedate'}.'>'.&mt('Due Date').'</option> |
<option value="discussion"'.$selected{'discussion'}.'>'.&mt('Has New Discussion').'</option> |
<option value="discussion"'.$selected{'discussion'}.'>'.&mt('Has New Discussion').'</option> |
</select> |
</select> |
|
<input type="hidden" name="register" value="'.$env{'form.register'}.'" /> |
</span> |
</span> |
</form>'); |
</form>'); |
} |
} |
Line 321 sub startpage {
|
Line 360 sub startpage {
|
# Header |
# Header |
my $course_type = &Apache::loncommon::course_type(); |
my $course_type = &Apache::loncommon::course_type(); |
my $title = $course_type . ' Contents'; |
my $title = $course_type . ' Contents'; |
my $brcrum = [{href => '/adm/navmaps', |
my ($start_page,$args); |
text => &mt($course_type . ' Contents'), |
if ($env{'form.register'}) { |
no_mt => 1}, |
$args = {'force_register' => $env{'form.register'}}; |
]; |
$start_page = &Apache::loncommon::start_page($title,undef,$args); |
my $args = {'bread_crumbs' => $brcrum}; |
} else { |
$r->print(&Apache::loncommon::start_page($title,undef,$args). |
my $brcrum = [{href => '/adm/navmaps', |
|
text => &mt($course_type . ' Contents'), |
|
no_mt => 1}, |
|
]; |
|
$args = {'bread_crumbs' => $brcrum}; |
|
$start_page = &Apache::loncommon::start_page($title,undef,$args); |
|
} |
|
$r->print($start_page. |
'<script type="text/javascript">'."\n". |
'<script type="text/javascript">'."\n". |
'// <![CDATA['."\n". |
'// <![CDATA['."\n". |
'window.focus();'."\n". |
'window.focus();'."\n". |
Line 351 sub startContentScreen {
|
Line 397 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;">'); |
} |
} |