--- loncom/interface/lonbulletin.pm 2009/12/03 02:13:28 1.52 +++ loncom/interface/lonbulletin.pm 2009/12/07 14:23:43 1.53 @@ -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.53 2009/12/07 14:23:43 wenzelju Exp $ # # Copyright Michigan State University Board of Trustees # @@ -177,7 +177,6 @@ sub handler { if (($syllabus{'uploaded.lastmodified'}) && (!$forceedit)) { $forcestudent='student'; } - if ($target ne 'tex') { $r->print('
'); } if ($forcestudent or $target eq 'tex') { $allowed=0; } if ($allowed) { @@ -185,17 +184,24 @@ sub handler { 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')).'
'.&mt('Show Student View').''. - &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'

'); - } elsif ($privileged and $target ne 'tex') { + #Function Box for Edit Mode. + my $functionbox = &Apache::lonhtmlcommon::start_funclist(); + $functionbox .= &Apache::lonhtmlcommon::add_item_funclist( + ''.&mt('Show Student View').''. + &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView')); + $functionbox.=&Apache::lonhtmlcommon::end_funclist(); + $r->print(&Apache::loncommon::head_subbox($functionbox).&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes'))); + } elsif ($privileged and $target ne 'tex') { my $query_str = 'forceedit=edit'; if (($group ne '') && ($env{'form.group'} eq $group)) { $query_str.='&group='.$group.'&'.$refarg; } - $r->print('' - .&mt('Edit').''); + #Functionbox for Student view. + my $functionbox = &Apache::lonhtmlcommon::start_funclist(); + $functionbox .= &Apache::lonhtmlcommon::add_item_funclist( + "".&mt('Edit').""); + $functionbox.=&Apache::lonhtmlcommon::end_funclist(); + $r->print(&Apache::loncommon::head_subbox($functionbox)); } if (($env{'form.uploaddoc.filename'}) && @@ -233,19 +239,22 @@ sub handler { if ($syllabus{'uploaded.photourl'}) { &Apache::lonnet::allowuploaded('/adm/syllabus', $syllabus{'uploaded.photourl'}); - $r->print(''); } + #Outputbox and Inputbox for Image upload if ($allowed) { + &Apache::lontemplate::print_template($r, &mt('Upload a Photo'), '',$allowed,'LC_Box'); $r->print( '
'. ''. - '

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

'. ''. ''. '
'. ''); } + #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}; @@ -258,35 +267,27 @@ sub handler { } $message=&Apache::lontexconvert::msgtexconverted($message); unless ($field eq 'aaa_title') { - if (($field ne 'bbb_content') || ($allowed)) { - if ($target ne 'tex') { - $r->print('

'.$syllabusfields{$field}.'

'); - } else { - $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'); - } - } + #Outputbox if ($target ne 'tex') { - $r->print('
'. - $message.'
'); + &Apache::lontemplate::print_template($r, $syllabusfields{$field}, $message,$allowed,'LC_Box'); } else { - $r->print(' '.&Apache::lonxml::xmlparse($r,'tex',$message).' '); + $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'.&Apache::lonxml::xmlparse($r,'tex',$message)); } + #Inputbox if ($allowed) { - $r->print('
'); + &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) { - $r->print( - '
'.&mt('Topic').'
'); + &Apache::lontemplate::print_template($r, $syllabusfields{$field}, $message,$allowed,'LC_Box'); + &Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field); } } } @@ -294,11 +295,10 @@ sub handler { if ($allowed) { $r->print('
'); } - if ($target ne 'tex') {$r->print('

');} else {$r->print('\\\\');} } else { $r->print('

'.&mt('No page information provided.').'

'); } - if ($target ne 'tex') { $r->print('
'); } + #Lists discussion posts and box for a new discussion post. if ($target ne 'tex') { $r->print(&Apache::lonfeedback::list_discussion ('board','OPEN','bulletin___'.$marker.'___'.