--- loncom/interface/lonbulletin.pm 2009/12/22 06:32:04 1.57 +++ loncom/interface/lonbulletin.pm 2010/01/31 06:03:55 1.58 @@ -1,7 +1,7 @@ # The LearningOnline Network # Bulletin Board Handler # -# $Id: lonbulletin.pm,v 1.57 2009/12/22 06:32:04 faziophi Exp $ +# $Id: lonbulletin.pm,v 1.58 2010/01/31 06:03:55 faziophi Exp $ # # Copyright Michigan State University Board of Trustees # @@ -277,39 +277,10 @@ sub handler { elsif($syllabus{'uploaded.photourl'} && $target ne 'tex'){ $r->print(''.&mt('Image').''); } - foreach my $field (sort(keys(%syllabusfields))) { - if (($syllabus{$field}) || ($allowed)) { - my $message=$syllabus{$field}; - if (!&Apache::lonfeedback::contains_block_html($message)) { - &Apache::lonfeedback::newline_to_br(\$message); - } else { - $message = &Apache::lonfeedback::tidy_html($message); - } - $message=&Apache::lonhtmlcommon::raw_href_to_link($message); - if ($allowed) { - $message=&Apache::lonspeller::markeduptext($message); - } - $message=&Apache::lontexconvert::msgtexconverted($message); - unless ($field eq 'aaa_title') { - if ($target ne 'tex') { - #output of syllabusfields will be generated here. - &Apache::lontemplate::print_start_template($r,$syllabusfields{$field},'LC_Box'); - $r->print($message); - if ($allowed) { - $r->print("
"); - &Apache::lontemplate::print_textarea_template($r, $syllabus{$field}, - $field, Apache::lontemplate->RICH_TEXT_DETECT_HTML); - &Apache::lontemplate::print_saveall_template($r); - $r->print("
"); - } - &Apache::lontemplate::print_end_template($r); - push(@htmlids,$field); - } else { - $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'.&Apache::lonxml::xmlparse($r,'tex',$message)); - } - } - } - } + + my %custom_handlers = ( 'aaa_title' => sub {} ); + @htmlids = &Apache::lontemplate::print_template_fields($r, \%syllabus, \%syllabusfields, + $target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_handlers); if ($allowed) { $r->print(''. &Apache::lonhtmlcommon::htmlareaselectactive(@htmlids));