--- loncom/interface/lonbulletin.pm 2009/11/19 18:05:32 1.49 +++ loncom/interface/lonbulletin.pm 2025/01/28 19:49:20 1.70 @@ -1,7 +1,7 @@ # The LearningOnline Network # Bulletin Board Handler # -# $Id: lonbulletin.pm,v 1.49 2009/11/19 18:05:32 bisitz Exp $ +# $Id: lonbulletin.pm,v 1.70 2025/01/28 19:49:20 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,9 +33,12 @@ use Apache::Constants qw(:common); use Apache::loncommon; use Apache::lonnet; use Apache::lontexconvert; -use Apache::lonfeedback; +use Apache::lonfeedback; +use Apache::lonhtmlgateway; use Apache::lonlocal; use Apache::lonhtmlcommon; +use Apache::longroup; +use Apache::lonnavmaps; use HTML::Entities(); use LONCAPA; @@ -78,7 +81,7 @@ sub handler { # ------------------------------------------------------------ Get Query String &Apache::loncommon::get_unprocessed_cgi - ($ENV{'QUERY_STRING'},['forcestudent','forceedit','register', + ($ENV{'QUERY_STRING'},['forceedit','register','todocs', 'origpage','group','ref']); # ----------------------------------------------------- Force menu registration my %addentries; @@ -86,11 +89,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,21 +128,17 @@ 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); + my $registered; if ($group ne '' && $env{'form.group'} eq $group) { + unless ($env{'form.ref'} eq 'grouplist') { + $registered = $env{'form.register'}; + } my $gpterm = &Apache::loncommon::group_term(); my $ucgpterm = $gpterm; $ucgpterm =~ s/^(\w)/uc($1)/e; @@ -149,10 +148,28 @@ sub handler { if ((ref($groupboards) eq 'ARRAY') && (@{$groupboards} > 0)) { $boardtitle = $$boards{$$groupboards[0]}{'title'}; } - $boardurl .= '?register=1&group='.$group; - $r->print(&groupboard_breadcrumbs($dom,$crs,$group,$refarg,$gpterm, - $ucgpterm,$grp_desc,$boardurl,$boardtitle)); + $boardurl .= '?group='.$group; + if ($registered) { + $boardurl .= '®ister='.$env{'form.register'}; + } else { + $brcrum = + &groupboard_breadcrumbs($dom,$crs,$group,$refarg,$gpterm, + $ucgpterm,$grp_desc,$boardurl, + $boardtitle); + } + } else { + $registered = $env{'form.register'}; + $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' => $registered} + ); + $r->print($start_page); } my ($allowed); if ($group ne '') { @@ -173,31 +190,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(' |