--- loncom/interface/lonbulletin.pm 2006/07/20 22:50:50 1.38 +++ loncom/interface/lonbulletin.pm 2009/02/02 14:31:58 1.47 @@ -1,7 +1,7 @@ # The LearningOnline Network # Bulletin Board Handler # -# $Id: lonbulletin.pm,v 1.38 2006/07/20 22:50:50 raeburn Exp $ +# $Id: lonbulletin.pm,v 1.47 2009/02/02 14:31:58 schafran Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,6 +36,7 @@ use Apache::lontexconvert; use Apache::lonfeedback; use Apache::lonlocal; use Apache::lonhtmlcommon; +use HTML::Entities(); use LONCAPA; sub handler { @@ -124,8 +125,14 @@ sub handler { # --------------------------------------- There is such a user, get environment if ($target ne 'tex') { + my $course_or_group; + if($group eq ''){ + $course_or_group="Course"; + }else{ + $course_or_group="Group"; + } my $start_page = - &Apache::loncommon::start_page("Bulletin Board/Discussion",undef, + &Apache::loncommon::start_page("$course_or_group Discussion Board",undef, {'function' => $forcestudent, 'add_entries' => \%addentries, 'domain' => $dom, @@ -180,7 +187,7 @@ sub handler { } $r->print( '

'. -&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'
'.&mt('Show Student View').''. +&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).'
'.&mt('Show Student View').''. &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'

'); } elsif ($privileged and $target ne 'tex') { my $query_str = 'forceedit=edit'; @@ -211,11 +218,11 @@ sub handler { &Apache::lonnet::put('bulletinpage_'.$marker,\%syllabus,$dom,$crs); } if (($allowed) && ($env{'form.storesyl'})) { - foreach (keys %syllabusfields) { - my $field=$env{'form.'.$_}; + foreach my $syl_field (keys(%syllabusfields)) { + my $field=$env{'form.'.$syl_field}; $field=~s/\s+$//s; $field=&Apache::lonfeedback::clear_out_html($field,1); - $syllabus{$_}=$field; + $syllabus{$syl_field}=$field; } $syllabus{'uploaded.lastmodified'}=time; &Apache::lonnet::put('bulletinpage_'.$marker,\%syllabus,$dom,$crs); @@ -236,11 +243,12 @@ sub handler { '

'.&mt('Upload a Photo').'

'. ''. ''. - '
'); + '
'. + ''); } - foreach (sort keys %syllabusfields) { - if (($syllabus{$_}) || ($allowed)) { - my $message=$syllabus{$_}; + foreach my $field (sort(keys(%syllabusfields))) { + if (($syllabus{$field}) || ($allowed)) { + my $message=$syllabus{$field}; &Apache::lonfeedback::newline_to_br(\$message); $message =~s/(https*\:\/\/[^\s]+)/\\$1\<\/tt\>\<\/a\>/g; @@ -248,12 +256,12 @@ sub handler { $message=&Apache::lonspeller::markeduptext($message); } $message=&Apache::lontexconvert::msgtexconverted($message); - unless ($_ eq 'aaa_title') { - if (($_ ne 'bbb_content') || ($allowed)) { + unless ($field eq 'aaa_title') { + if (($field ne 'bbb_content') || ($allowed)) { if ($target ne 'tex') { - $r->print('

'.$syllabusfields{$_}.'

'); + $r->print('

'.$syllabusfields{$field}.'

'); } else { - $r->print('\\\\\textbf{'.$syllabusfields{$_}.'}\\\\'); + $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'); } } if ($target ne 'tex') { @@ -263,9 +271,9 @@ sub handler { $r->print(' '.&Apache::lonxml::xmlparse($r,'tex',$message).' '); } if ($allowed) { - $r->print('
'); + $r->print('
'); } } else { if ($target ne 'tex') { @@ -275,9 +283,9 @@ sub handler { } if ($allowed) { $r->print( - '
'.&mt('Topic').'
'); + '
'.&mt('Topic').'
'); } } }