[LON-CAPA-cvs] cvs: loncom /interface lonsearchcat.pm lonsimplepage.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 21 Mar 2006 21:07:33 -0000
albertel Tue Mar 21 16:07:33 2006 EDT
Modified files:
/loncom/interface lonsearchcat.pm lonsimplepage.pm
Log:
- using the loncommon 'simple_error_page'
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.258 loncom/interface/lonsearchcat.pm:1.259
--- loncom/interface/lonsearchcat.pm:1.258 Sun Mar 19 17:08:38 2006
+++ loncom/interface/lonsearchcat.pm Tue Mar 21 16:07:31 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Search Catalog
#
-# $Id: lonsearchcat.pm,v 1.258 2006/03/19 22:08:38 albertel Exp $
+# $Id: lonsearchcat.pm,v 1.259 2006/03/21 21:07:31 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -199,7 +199,8 @@
'We were unable to retrieve data describing your search. '.
'This is a serious error and has been logged. '.
'Please alert your LON-CAPA administrator.';
- return &error_page($r,$msg);
+ return &Apache::loncommon::simple_error_page($r,'Search Error',
+ $msg);
}
}
} else {
@@ -220,7 +221,8 @@
# This is a stupid error to give to the user.
# It really tells them nothing.
my $msg = 'Unable to tie hash to db file.';
- return &error_page($r,$msg);
+ return &Apache::loncommon::simple_error_page($r,'Search Error',
+ $msg);
}
}
##
@@ -361,14 +363,16 @@
my $msg =
'Unable to create table in which to store search results. '.
'The search has been aborted.';
- return &error_page($r,$msg);
+ return &Apache::loncommon::simple_error_page($r,'Search Error',
+ $msg);
}
delete($env{'form.launch'});
if (! &make_form_data_persistent($r,$persistent_db_file)) {
my $msg=
'Unable to properly store search information. '.
'The search has been aborted.';
- return &error_page($r,$msg);
+ return &Apache::loncommon::simple_error_page($r,'Search Error',
+ $msg);
}
##
## Print out the frames interface
@@ -380,14 +384,6 @@
return OK;
}
-sub error_page {
- my ($r,$msg) = @_;
- $r->print(&Apache::loncommon::start_page('Search Error').
- &mt($msg).
- &Apache::loncommon::end_page());
- return OK;
-}
-
#
# The mechanism used to store values away and retrieve them does not
# handle the case of missing environment variables being significant.
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.33 loncom/interface/lonsimplepage.pm:1.34
--- loncom/interface/lonsimplepage.pm:1.33 Thu Mar 16 16:30:00 2006
+++ loncom/interface/lonsimplepage.pm Tue Mar 21 16:07:31 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Simple Page Editor
#
-# $Id: lonsimplepage.pm,v 1.33 2006/03/16 21:30:00 raeburn Exp $
+# $Id: lonsimplepage.pm,v 1.34 2006/03/21 21:07:31 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,15 +38,6 @@
use Apache::lonprintout;
use Apache::lonxml;
-sub error {
- my ($r,$msg) = @_;
- $r->print(&Apache::loncommon::endheadtag().
- &Apache::loncommon::bodytag().
- &mt($msg).
- &Apache::loncommon::end_page());
- return OK;
-}
-
sub handler {
my $r = shift;
&Apache::loncommon::content_type($r,'text/html');
@@ -54,17 +45,15 @@
return OK if $r->header_only;
my $target=$env{'form.grade_target'};
# ------------------------------------------------------------ Print the screen
- if ($target ne 'tex') {
- $r->print(&Apache::lonxml::xmlbegin().
- &Apache::loncommon::headtag());
- } else {
+ if ($target eq 'tex') {
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}));
}
my (undef,undef,undef,undef,$marker,$caller)=split(/\//,$r->uri);
# Is this even in a course?
unless ($env{'request.course.id'}) {
if ($target ne 'tex') {
- return &error($r,'Not in a course');
+ return &Apache::loncommon::simple_error_page($r,'',
+ 'Not in a course');
} else {
$r->print('\textbf{Not in a course}\end{document}');
}
@@ -83,16 +72,18 @@
$namespace = 'grppage_'.$marker;
my %curr_groups;
if (!&Apache::loncommon::coursegroups(\%curr_groups,$dom,$crs,$marker)) {
- return &error($r,'Invalid group name');
+ return &Apache::loncommon::simple_error_page($r,'',
+ 'Invalid group name');
}
- %groupinfo = &Apache::loncommon::get_group_settings($curr_groups{$marker});
+ %groupinfo =
+ &Apache::loncommon::get_group_settings($curr_groups{$marker});
} else {
$marker=~s/\D//g;
$namespace = 'smppage_'.$marker;
}
if (!$marker) {
- return &error($r,'Invalid call');
+ return &Apache::loncommon::simple_error_page($r,'','Invalid call');
}
# --------------------------------------------------------- The syllabus fields