[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm
raeburn
raeburn@source.lon-capa.org
Fri, 19 Dec 2008 21:00:06 -0000
raeburn Fri Dec 19 21:00:06 2008 EDT
Modified files:
/loncom/interface lonnavmaps.pm
Log:
- Check that navmap object could be created to avoid ISE.
- Display link to roles page to re-select the course if no navmap object.
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.422 loncom/interface/lonnavmaps.pm:1.423
--- loncom/interface/lonnavmaps.pm:1.422 Fri Dec 12 20:33:39 2008
+++ loncom/interface/lonnavmaps.pm Fri Dec 19 21:00:06 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.422 2008/12/12 20:33:39 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.423 2008/12/19 21:00:06 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1269,7 +1269,7 @@
if (!defined($navmap)) {
$navmap = Apache::lonnavmaps::navmap->new();
if (!defined($navmap)) {
- # no londer in course
+ # no longer in course
return '<span class="LC_error">'.&mt('No course selected').'</span><br />
<a href="/adm/roles">'.&mt('Select a course').'</a><br />';
}
@@ -1337,6 +1337,11 @@
# Step 1: Check to see if we have a navmap
if (!defined($navmap)) {
$navmap = Apache::lonnavmaps::navmap->new();
+ if (!defined($navmap)) {
+ # no longer in course
+ return '<span class="LC_error">'.&mt('No course selected').'</span><br />
+ <a href="/adm/roles">'.&mt('Select a course').'</a><br />';
+ }
}
# See if we're being passed a specific map