[LON-CAPA-cvs] cvs: loncom /interface lonnavdisplay.pm
raeburn
raeburn at source.lon-capa.org
Tue Jul 25 00:58:49 EDT 2023
raeburn Tue Jul 25 04:58:49 2023 EDT
Modified files:
/loncom/interface lonnavdisplay.pm
Log:
- Prevent endless redirects in empty Placement Test course.
Index: loncom/interface/lonnavdisplay.pm
diff -u loncom/interface/lonnavdisplay.pm:1.41 loncom/interface/lonnavdisplay.pm:1.42
--- loncom/interface/lonnavdisplay.pm:1.41 Sat Oct 29 18:13:28 2022
+++ loncom/interface/lonnavdisplay.pm Tue Jul 25 04:58:49 2023
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Display Handler
#
-# $Id: lonnavdisplay.pm,v 1.41 2022/10/29 18:13:28 raeburn Exp $
+# $Id: lonnavdisplay.pm,v 1.42 2023/07/25 04:58:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -134,9 +134,11 @@
$r->print($closure.&Apache::loncommon::end_page());
return OK;
} else {
- &Apache::loncommon::content_type($r,'text/html');
- $r->header_out(Location => $furl);
- return REDIRECT;
+ unless ($furl eq '/adm/navmaps') {
+ &Apache::loncommon::content_type($r,'text/html');
+ $r->header_out(Location => $furl);
+ return REDIRECT;
+ }
}
}
@@ -180,7 +182,7 @@
&startpage($r);
}
- &startContentScreen($r,'navmaps');
+ &startContentScreen($r,'navmaps',$course_type);
unless ($result eq 'update') {
$r->rflush();
}
@@ -380,7 +382,7 @@
}
sub startContentScreen {
- my ($r,$mode)=@_;
+ my ($r,$mode,$course_type)=@_;
$r->print("\n".'<ul class="LC_TabContentBigger" id="mainnav">'."\n");
$r->print('<li'.(($mode eq 'navmaps')?' class="active"':'').'><a href="/adm/navmaps"><b> '.&mt('Main Content').' </b></a></li>'."\n");
@@ -395,8 +397,10 @@
if ($supptab) {
$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 'courseindex')?' class="active"':'').'><a href="/adm/indexcourse"><b> '.&mt('Content Index').' </b></a></li>'."\n");
+ unless ($course_type eq 'Placement') {
+ $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('<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;">');
}
More information about the LON-CAPA-cvs
mailing list