--- loncom/interface/lonbulletin.pm 2009/12/07 14:23:43 1.53 +++ loncom/interface/lonbulletin.pm 2010/10/27 01:00:38 1.62 @@ -1,7 +1,7 @@ # The LearningOnline Network # Bulletin Board Handler # -# $Id: lonbulletin.pm,v 1.53 2009/12/07 14:23:43 wenzelju Exp $ +# $Id: lonbulletin.pm,v 1.62 2010/10/27 01:00:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -184,6 +184,9 @@ sub handler { if (($group ne '') && ($env{'form.group'} eq $group)) { $query_str.='&group='.$group.'&'.$refarg; } + if ($env{'form.register'}) { + $query_str .= '&register='.$env{'form.register'}; + } #Function Box for Edit Mode. my $functionbox = &Apache::lonhtmlcommon::start_funclist(); $functionbox .= &Apache::lonhtmlcommon::add_item_funclist( @@ -196,6 +199,9 @@ sub handler { if (($group ne '') && ($env{'form.group'} eq $group)) { $query_str.='&group='.$group.'&'.$refarg; } + if ($env{'form.register'}) { + $query_str .= '&register='.$env{'form.register'}; + } #Functionbox for Student view. my $functionbox = &Apache::lonhtmlcommon::start_funclist(); $functionbox .= &Apache::lonhtmlcommon::add_item_funclist( @@ -212,11 +218,11 @@ sub handler { } if ($group ne '') { $syllabus{'uploaded.photourl'}= - &Apache::lonnet::userfileupload('uploaddoc',1, + &Apache::lonnet::userfileupload('uploaddoc','coursedoc', 'bulletin/'.$group.'/'.$marker); } else { $syllabus{'uploaded.photourl'}= - &Apache::lonnet::userfileupload('uploaddoc',1, + &Apache::lonnet::userfileupload('uploaddoc','coursedoc', 'bulletin/'.$marker); } } @@ -234,69 +240,66 @@ sub handler { &Apache::lonnet::put('bulletinpage_'.$marker,\%syllabus,$dom,$crs); } -# ---------------------------------------------------------------- Get syllabus +# ---------------------------------------------------------------- Get discussion board if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) { + #Print Topic as Heading + my $titletext=&HTML::Entities::encode($syllabus{'aaa_title'},'<>&"');; + if ($target ne 'tex') { + $r->print('

'.$titletext.'

'); + } else { + $r->print('\\\\\textbf{'.&Apache::lonxml::xmlparse($r,'tex',$titletext).'}\\\\'); + } + #Outputbox and Inputbox for Topic + if ($allowed) { + $r->print('
'); + &Apache::lontemplate::print_start_template($r,&mt('Title'),'LC_Box'); + $r->print($titletext); + $r->print("
"); + &Apache::lontemplate::print_textarea_template($r, $syllabus{'aaa_title'}, + 'aaa_title', Apache::lontemplate->RICH_TEXT_ALWAYS_OFF); + &Apache::lontemplate::print_saveall_template($r); + $r->print("
"); + &Apache::lontemplate::print_end_template($r); + } if ($syllabus{'uploaded.photourl'}) { &Apache::lonnet::allowuploaded('/adm/syllabus', $syllabus{'uploaded.photourl'}); } #Outputbox and Inputbox for Image upload if ($allowed) { - &Apache::lontemplate::print_template($r, &mt('Upload a Photo'), '',$allowed,'LC_Box'); + my $message = ''.&mt('Image').''; + &Apache::lontemplate::print_start_template($r, &mt('Upload a Photo'),'LC_Box'); + $r->print($message); + $r->print("

"); $r->print( - ''. ''. ''. ''. - '
'. ''); + &Apache::lontemplate::print_end_template($r); } #Image in Student view. elsif($syllabus{'uploaded.photourl'} && $target ne 'tex'){ - $r->print(''); - } - 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); - } - $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') { - #Outputbox - if ($target ne 'tex') { - &Apache::lontemplate::print_template($r, $syllabusfields{$field}, $message,$allowed,'LC_Box'); - } else { - $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'.&Apache::lonxml::xmlparse($r,'tex',$message)); - } - #Inputbox - if ($allowed) { - &Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field); - } - } else { - #Print Topic as Heading - if ($target ne 'tex') { - $r->print('

'.$message.'

'); - } else { - $r->print('\\\\\textbf{'.&Apache::lonxml::xmlparse($r,'tex',$message).'}\\\\'); - } - #Outputbox and Inputbox for Topic - if ($allowed) { - &Apache::lontemplate::print_template($r, $syllabusfields{$field}, $message,$allowed,'LC_Box'); - &Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field); - } - } - } + $r->print(''.&mt('Image').''); } + + my %custom_handlers = ( 'aaa_title' => sub {} ); + &Apache::lontemplate::print_template_fields($r, \%syllabus, \%syllabusfields, + $target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_handlers); if ($allowed) { - $r->print('
'); + $r->print(''. + &Apache::lonhtmlcommon::htmlareaselectactive()); + } + 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.').'

'); + } } #Lists discussion posts and box for a new discussion post. if ($target ne 'tex') {