--- loncom/interface/lonbulletin.pm 2009/12/03 02:13:28 1.52 +++ loncom/interface/lonbulletin.pm 2012/11/08 22:01:00 1.64 @@ -1,7 +1,7 @@ # The LearningOnline Network # Bulletin Board Handler # -# $Id: lonbulletin.pm,v 1.52 2009/12/03 02:13:28 www Exp $ +# $Id: lonbulletin.pm,v 1.64 2012/11/08 22:01:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -78,7 +78,7 @@ sub handler { # ------------------------------------------------------------ Get Query String &Apache::loncommon::get_unprocessed_cgi - ($ENV{'QUERY_STRING'},['forcestudent','forceedit','register', + ($ENV{'QUERY_STRING'},['forceedit','register', 'origpage','group','ref']); # ----------------------------------------------------- Force menu registration my %addentries; @@ -86,11 +86,11 @@ sub handler { $addentries{'onload'} = "document.location='#newpost';"; } # --------------------------------------------------------------- Force Student - my $forcestudent=''; - if ($env{'form.forcestudent'}) { $forcestudent='student'; } - - my $forceedit=''; - if ($env{'form.forceedit'}) { $forceedit='edit'; } + my ($forceedit,$forcestudent); + $forceedit = $env{'form.forceedit'}; + if (!$forceedit) { + $forcestudent=1; + } my $refarg = ''; if (exists($env{'form.ref'})) { $refarg = 'ref='.$env{'form.ref'}; } @@ -125,20 +125,12 @@ sub handler { # --------------------------------------- There is such a user, get environment if ($target ne 'tex') { - my $course_or_group; + my ($course_or_group,$brcrum); if($group eq '') { $course_or_group="Course"; } else { $course_or_group="Group"; } - my $start_page = - &Apache::loncommon::start_page("$course_or_group Discussion Board",undef, - {'function' => $forcestudent, - 'add_entries' => \%addentries, - 'domain' => $dom, - 'force_register' => - $env{'form.register'}}); - $r->print($start_page); if ($group ne '' && $env{'form.group'} eq $group) { my $gpterm = &Apache::loncommon::group_term(); my $ucgpterm = $gpterm; @@ -150,9 +142,21 @@ sub handler { $boardtitle = $$boards{$$groupboards[0]}{'title'}; } $boardurl .= '?register=1&group='.$group; - $r->print(&groupboard_breadcrumbs($dom,$crs,$group,$refarg,$gpterm, - $ucgpterm,$grp_desc,$boardurl,$boardtitle)); + $brcrum = + &groupboard_breadcrumbs($dom,$crs,$group,$refarg,$gpterm, + $ucgpterm,$grp_desc,$boardurl,$boardtitle); + } else { + $brcrum = []; } + my $start_page = + &Apache::loncommon::start_page("$course_or_group Discussion Board",undef, + {'add_entries' => \%addentries, + 'domain' => $dom, + 'bread_crumbs' => $brcrum, + 'group' => $group, + 'force_register' => + $env{'form.register'}}); + $r->print($start_page); } my ($allowed); if ($group ne '') { @@ -173,31 +177,8 @@ sub handler { $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'}); } - my $privileged=$allowed; - if (($syllabus{'uploaded.lastmodified'}) && (!$forceedit)) { - $forcestudent='student'; - } - if ($target ne 'tex') { $r->print('
'); }
if ($forcestudent or $target eq 'tex') { $allowed=0; }
- if ($allowed) {
- my $query_str = 'forcestudent=1';
- if (($group ne '') && ($env{'form.group'} eq $group)) {
- $query_str.='&group='.$group.'&'.$refarg;
- }
- $r->print(
- ' '.
- &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).' '.$titletext.''); + } else { + $r->print('\\\\\textbf{'.&Apache::lonxml::xmlparse($r,'tex',$titletext).'}\\\\'); + } + #Outputbox and Inputbox for Topic + if ($allowed) { + $r->print(''); } - if ($target ne 'tex') {$r->print('');} else {$r->print('\\\\');} + if ($target ne 'tex'){ + $r->print(''); + } + else { + $r->print(&Apache::lonxml::xmlparse($r,'tex',' ')); + } } else { - $r->print(' '.&mt('No page information provided.').' '); + if ($target ne 'tex') { + $r->print(''.&mt('No page information provided.').' '); + } } - if ($target ne 'tex') { $r->print(' |