Diff for /loncom/interface/lonbulletin.pm between versions 1.56 and 1.60

version 1.56, 2009/12/14 13:42:33 version 1.60, 2010/06/05 22:07:05
Line 184  sub handler { Line 184  sub handler {
         if (($group ne '') && ($env{'form.group'} eq $group)) {          if (($group ne '') && ($env{'form.group'} eq $group)) {
             $query_str.='&group='.$group.'&'.$refarg;              $query_str.='&group='.$group.'&'.$refarg;
         }          }
           if ($env{'form.register'}) {
               $query_str .= '&register='.$env{'form.register'};
           }
         #Function Box for Edit Mode.          #Function Box for Edit Mode.
         my $functionbox = &Apache::lonhtmlcommon::start_funclist();          my $functionbox = &Apache::lonhtmlcommon::start_funclist();
         $functionbox .=  &Apache::lonhtmlcommon::add_item_funclist(          $functionbox .=  &Apache::lonhtmlcommon::add_item_funclist(
Line 196  sub handler { Line 199  sub handler {
         if (($group ne '') && ($env{'form.group'} eq $group)) {          if (($group ne '') && ($env{'form.group'} eq $group)) {
             $query_str.='&group='.$group.'&'.$refarg;              $query_str.='&group='.$group.'&'.$refarg;
         }          }
           if ($env{'form.register'}) {
               $query_str .= '&register='.$env{'form.register'};
           }
         #Functionbox for Student view.          #Functionbox for Student view.
         my $functionbox = &Apache::lonhtmlcommon::start_funclist();          my $functionbox = &Apache::lonhtmlcommon::start_funclist();
         $functionbox .=  &Apache::lonhtmlcommon::add_item_funclist(          $functionbox .=  &Apache::lonhtmlcommon::add_item_funclist(
Line 237  sub handler { Line 243  sub handler {
 # ---------------------------------------------------------------- Get discussion board  # ---------------------------------------------------------------- Get discussion board
     if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {      if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {
         #Print Topic as Heading          #Print Topic as Heading
         my $titletext=$syllabus{'aaa_title'};          my $titletext=&HTML::Entities::encode($syllabus{'aaa_title'},'<>&"');;
         if ($target ne 'tex') {          if ($target ne 'tex') {
             $r->print('<h2>'.$titletext.'</h2>');              $r->print('<h2>'.$titletext.'</h2>');
         } else {          } else {
Line 246  sub handler { Line 252  sub handler {
         #Outputbox and Inputbox for Topic          #Outputbox and Inputbox for Topic
         if ($allowed) {          if ($allowed) {
             $r->print('<form method="post" action="" enctype="multipart/form-data">');              $r->print('<form method="post" action="" enctype="multipart/form-data">');
             &Apache::lontemplate::print_template($r, &mt('Title'), $titletext,$allowed,'LC_Box');              &Apache::lontemplate::print_start_template($r,&mt('Title'),'LC_Box');
             &Apache::lontemplate::print_editbox_template($r, $syllabus{'aaa_title'},'aaa_title');              $r->print($titletext);
    $r->print("<br /><div>");
    &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("</div>");
    &Apache::lontemplate::print_end_template($r);
         }          }
         if ($syllabus{'uploaded.photourl'}) {          if ($syllabus{'uploaded.photourl'}) {
             &Apache::lonnet::allowuploaded('/adm/syllabus',              &Apache::lonnet::allowuploaded('/adm/syllabus',
                                            $syllabus{'uploaded.photourl'});                                             $syllabus{'uploaded.photourl'});
         }          }
           my @htmlids=();
         #Outputbox and Inputbox for Image upload          #Outputbox and Inputbox for Image upload
         if ($allowed) {          if ($allowed) {
             &Apache::lontemplate::print_template($r, &mt('Upload a Photo'), '<img src="'.$syllabus{'uploaded.photourl'}.'" alt="'.&mt('Image').'"/>',$allowed,'LC_Box');          my $message = '<img src="'.$syllabus{'uploaded.photourl'}.'" alt="'.&mt('Image').'"/>';
           &Apache::lontemplate::print_start_template($r, &mt('Upload a Photo'),'LC_Box');
               $r->print($message);
               $r->print("<br /><br />");
             $r->print(              $r->print(
                 '<input type="hidden" name="forceedit" value="edit" />'.                  '<input type="hidden" name="forceedit" value="edit" />'.
                 '<input type="file" name="uploaddoc" size="50" />'.                  '<input type="file" name="uploaddoc" size="50" />'.
                 '<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'.                  '<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'.
                 '<input type="hidden" name="forceedit" value="edit" />');                  '<input type="hidden" name="forceedit" value="edit" />');
               &Apache::lontemplate::print_end_template($r);
         }          }
         #Image in Student view.          #Image in Student view.
         elsif($syllabus{'uploaded.photourl'} && $target ne 'tex'){          elsif($syllabus{'uploaded.photourl'} && $target ne 'tex'){
             $r->print('<img src="'.$syllabus{'uploaded.photourl'}.'" alt="'.&mt('Image').'"/>');              $r->print('<img src="'.$syllabus{'uploaded.photourl'}.'" alt="'.&mt('Image').'"/>');
         }          }
         foreach my $field (sort(keys(%syllabusfields))) {          
             if (($syllabus{$field}) || ($allowed)) {          my %custom_handlers = ( 'aaa_title' => sub {} );
                 my $message=$syllabus{$field};   @htmlids = &Apache::lontemplate::print_template_fields($r, \%syllabus, \%syllabusfields, 
                 if (!&Apache::lonfeedback::contains_block_html($message)) {   $target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_handlers);
                 &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);  
                     }  
                 }     
             }  
         }  
         if ($allowed) {          if ($allowed) {
             $r->print('</form>');              $r->print('</form>'.
               &Apache::lonhtmlcommon::htmlareaselectactive(@htmlids));
         }          }
         if ($target ne 'tex'){          if ($target ne 'tex'){
             $r->print('<br/><br/><hr/><br/>');              $r->print('<br/><br/><hr/><br/>');
Line 301  sub handler { Line 298  sub handler {
             $r->print(&Apache::lonxml::xmlparse($r,'tex','<br/><br/><hr/><br/>'));              $r->print(&Apache::lonxml::xmlparse($r,'tex','<br/><br/><hr/><br/>'));
         }          }
     } else {      } else {
         $r->print('<p>'.&mt('No page information provided.').'</p>');          if ($target ne 'tex') {
              $r->print('<p>'.&mt('No page information provided.').'</p>');
           }
     }      }
     #Lists discussion posts and box for a new discussion post.      #Lists discussion posts and box for a new discussion post.
     if ($target ne 'tex') {      if ($target ne 'tex') {

Removed from v.1.56  
changed lines
  Added in v.1.60


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>