[LON-CAPA-cvs] cvs: loncom /interface lonbulletin.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 21 Mar 2006 20:31:08 -0000
albertel Tue Mar 21 15:31:08 2006 EDT
Modified files:
/loncom/interface lonbulletin.pm
Log:
- start_page
Index: loncom/interface/lonbulletin.pm
diff -u loncom/interface/lonbulletin.pm:1.31 loncom/interface/lonbulletin.pm:1.32
--- loncom/interface/lonbulletin.pm:1.31 Sat Oct 29 22:39:09 2005
+++ loncom/interface/lonbulletin.pm Tue Mar 21 15:31:08 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Bulletin Board Handler
#
-# $Id: lonbulletin.pm,v 1.31 2005/10/30 02:39:09 www Exp $
+# $Id: lonbulletin.pm,v 1.32 2006/03/21 20:31:08 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,27 +44,24 @@
my $target=$env{'form.grade_target'};
# ------------------------------------------------------------ Print the screen
- if ($target ne 'tex') {
- my $html=&Apache::lonxml::xmlbegin();
- $r->print(<<ENDDOCUMENT);
-$html
-<head>
-<title>The LearningOnline Network with CAPA</title>
-ENDDOCUMENT
-} else {
+ if ($target eq 'tex') {
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}));
}
my (undef,undef,undef,undef,$marker)=split(/\//,$r->uri);
# Is this even in a course?
- unless ($env{'request.course.id'}) {
- $r->print('</head><body>Not in a course</body></html>');
+ if (!$env{'request.course.id'}) {
+ $r->print(&Apache::loncommon::start_page('Not in a course').
+ &mt('Not in a course').
+ &Apache::loncommon::end_page());
return OK;
}
$marker=~s/\D//g;
- unless ($marker) {
- $r->print('<body>Invalid call</body>');
+ if (!$marker) {
+ $r->print(&Apache::loncommon::start_page('Invalid Call').
+ &mt('Invalid Call').
+ &Apache::loncommon::end_page());
return OK;
}
@@ -102,10 +99,15 @@
my %syllabus=&Apache::lonnet::dump('bulletinpage_'.$marker,$dom,$crs);
# --------------------------------------- There is such a user, get environment
- if ($target ne 'tex') {
- $r->print('</head>'.&Apache::loncommon::bodytag
- ("Bulletin Board/Discussion",$forcestudent,$addentries,'',$dom,
- $env{'form.register'}));
+ if ($target ne 'tex') {
+ my $start_page =
+ &Apache::loncommon::start_page("Bulletin Board/Discussion",undef,
+ {'function' => $forcestudent,
+ 'add_entries' => $addentries,
+ 'domain' => $domain,
+ 'force_register' =>
+ $env{'form.register'}});
+ $r->print($start_page);
}
my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
@@ -227,7 +229,11 @@
('board','OPEN','bulletin___'.$marker.'___'.
$r->uri)));
}
- if ($target ne 'tex') {$r->print('</body></html>');} else {$r->print('\end{document}');}
+ if ($target ne 'tex') {
+ $r->print(&Apache::loncommon::end_page());
+ } else {
+ $r->print('\end{document}');
+ }
return OK;
}