[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonexttool.pm
raeburn
raeburn at source.lon-capa.org
Mon Dec 18 11:11:19 EST 2017
raeburn Mon Dec 18 16:11:19 2017 EDT
Modified files:
/loncom/interface lonexttool.pm loncommon.pm
Log:
- Option to suppress menu when displaying loncommon::simple_error_page()
within a wrapped page.
Index: loncom/interface/lonexttool.pm
diff -u loncom/interface/lonexttool.pm:1.10 loncom/interface/lonexttool.pm:1.11
--- loncom/interface/lonexttool.pm:1.10 Thu Dec 7 16:06:04 2017
+++ loncom/interface/lonexttool.pm Mon Dec 18 16:11:18 2017
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Launch External Tool Provider (LTI)
#
-# $Id: lonexttool.pm,v 1.10 2017/12/07 16:06:04 raeburn Exp $
+# $Id: lonexttool.pm,v 1.11 2017/12/18 16:11:18 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -67,7 +67,8 @@
# Is this even in a course?
unless ($env{'request.course.id'}) {
if ($target ne 'tex') {
- &Apache::loncommon::simple_error_page($r,'','Not in a course');
+ &Apache::loncommon::simple_error_page($r,'','Not in a course',
+ {'only_body' => 1});
} else {
$r->print('\textbf{Not in a course}\end{document}');
}
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1303 loncom/interface/loncommon.pm:1.1304
--- loncom/interface/loncommon.pm:1.1303 Mon Dec 18 15:49:11 2017
+++ loncom/interface/loncommon.pm Mon Dec 18 16:11:18 2017
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1303 2017/12/18 15:49:11 raeburn Exp $
+# $Id: loncommon.pm,v 1.1304 2017/12/18 16:11:18 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -9188,14 +9188,21 @@
sub simple_error_page {
my ($r,$title,$msg,$args) = @_;
+ my %displayargs;
if (ref($args) eq 'HASH') {
if (!$args->{'no_auto_mt_msg'}) { $msg = &mt($msg); }
+ if ($args->{'only_body'}) {
+ $displayargs{'only_body'} = 1;
+ }
+ if ($args->{'no_nav_bar'}) {
+ $displayargs{'no_nav_bar'} = 1;
+ }
} else {
$msg = &mt($msg);
}
my $page =
- &Apache::loncommon::start_page($title).
+ &Apache::loncommon::start_page($title,'',\%displayargs).
'<p class="LC_error">'.$msg.'</p>'.
&Apache::loncommon::end_page();
if (ref($r)) {
More information about the LON-CAPA-cvs
mailing list