version 1.31, 2005/10/30 02:39:09
|
version 1.35, 2006/04/10 19:59:53
|
Line 44 sub handler {
|
Line 44 sub handler {
|
my $target=$env{'form.grade_target'}; |
my $target=$env{'form.grade_target'}; |
|
|
# ------------------------------------------------------------ Print the screen |
# ------------------------------------------------------------ Print the screen |
if ($target ne 'tex') { |
if ($target eq 'tex') { |
my $html=&Apache::lonxml::xmlbegin(); |
|
$r->print(<<ENDDOCUMENT); |
|
$html |
|
<head> |
|
<title>The LearningOnline Network with CAPA</title> |
|
ENDDOCUMENT |
|
} else { |
|
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); |
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); |
} |
} |
my (undef,undef,undef,undef,$marker)=split(/\//,$r->uri); |
my (undef,undef,undef,undef,$marker)=split(/\//,$r->uri); |
# Is this even in a course? |
# Is this even in a course? |
unless ($env{'request.course.id'}) { |
if (!$env{'request.course.id'}) { |
$r->print('</head><body>Not in a course</body></html>'); |
&Apache::loncommon::simple_error_page($r,'Not in a course', |
|
'Not in a course'); |
return OK; |
return OK; |
} |
} |
|
|
$marker=~s/\D//g; |
$marker=~s/\D//g; |
|
|
unless ($marker) { |
if (!$marker) { |
$r->print('<body>Invalid call</body>'); |
&Apache::loncommon::simple_error_page($r,'Invalid Call', |
|
'Invalid Call'); |
return OK; |
return OK; |
} |
} |
|
|
Line 81 ENDDOCUMENT
|
Line 76 ENDDOCUMENT
|
&Apache::loncommon::get_unprocessed_cgi |
&Apache::loncommon::get_unprocessed_cgi |
($ENV{'QUERY_STRING'},['forcestudent','forceedit','register','origpage']); |
($ENV{'QUERY_STRING'},['forcestudent','forceedit','register','origpage']); |
# ----------------------------------------------------- Force menu registration |
# ----------------------------------------------------- Force menu registration |
my $addentries=''; |
my %addentries; |
if ($env{'form.register'}) { |
if ($env{'form.origpage'}) { |
$addentries=' onLoad="'.&Apache::lonmenu::loadevents(); |
$addentries{'onload'} = "document.location='#newpost';"; |
if ($env{'form.origpage'}) { |
|
$addentries .= "document.location='#newpost';"; |
|
} |
|
$addentries .= '" onUnload="'.&Apache::lonmenu::unloadevents().'"'; |
|
$r->print(&Apache::lonmenu::registerurl(1)); |
|
} elsif ($env{'form.origpage'}) { |
|
$addentries = "onLoad=\"document.location='#newpost';\""; |
|
} |
} |
# --------------------------------------------------------------- Force Student |
# --------------------------------------------------------------- Force Student |
my $forcestudent=''; |
my $forcestudent=''; |
Line 102 ENDDOCUMENT
|
Line 90 ENDDOCUMENT
|
my %syllabus=&Apache::lonnet::dump('bulletinpage_'.$marker,$dom,$crs); |
my %syllabus=&Apache::lonnet::dump('bulletinpage_'.$marker,$dom,$crs); |
|
|
# --------------------------------------- There is such a user, get environment |
# --------------------------------------- There is such a user, get environment |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print('</head>'.&Apache::loncommon::bodytag |
my $start_page = |
("Bulletin Board/Discussion",$forcestudent,$addentries,'',$dom, |
&Apache::loncommon::start_page("Bulletin Board/Discussion",undef, |
$env{'form.register'})); |
{'function' => $forcestudent, |
|
'add_entries' => \%addentries, |
|
'domain' => $dom, |
|
'force_register' => |
|
$env{'form.register'}}); |
|
$r->print($start_page); |
} |
} |
my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'}); |
my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'}); |
|
|
Line 227 ENDDOCUMENT
|
Line 220 ENDDOCUMENT
|
('board','OPEN','bulletin___'.$marker.'___'. |
('board','OPEN','bulletin___'.$marker.'___'. |
$r->uri))); |
$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; |
return OK; |
} |
} |
|
|