Diff for /loncom/interface/lonbulletin.pm between versions 1.38 and 1.48

version 1.38, 2006/07/20 22:50:50 version 1.48, 2009/04/04 21:47:40
Line 36  use Apache::lontexconvert; Line 36  use Apache::lontexconvert;
 use Apache::lonfeedback;  use Apache::lonfeedback;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonhtmlcommon;  use Apache::lonhtmlcommon;
   use HTML::Entities();
 use LONCAPA;  use LONCAPA;
   
 sub handler {  sub handler {
Line 124  sub handler { Line 125  sub handler {
                 
 # --------------------------------------- There is such a user, get environment  # --------------------------------------- There is such a user, get environment
     if ($target ne 'tex') {        if ($target ne 'tex') {  
    my $course_or_group;
    if($group eq ''){
       $course_or_group="Course";
    }else{
       $course_or_group="Group";
    } 
  my $start_page =   my $start_page =
     &Apache::loncommon::start_page("Bulletin Board/Discussion",undef,      &Apache::loncommon::start_page("$course_or_group Discussion Board",undef,
    {'function'       => $forcestudent,     {'function'       => $forcestudent,
     'add_entries'    => \%addentries,      'add_entries'    => \%addentries,
     'domain'         => $dom,      'domain'         => $dom,
Line 180  sub handler { Line 187  sub handler {
           }            }
           $r->print(            $r->print(
   '<p>'.    '<p>'.
 &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'<br /><a href="'.$r->uri.'?'.$query_str.'"><font size="+1">'.&mt('Show Student View').'</font></a>'.  &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).'<br /><a href="'.$r->uri.'?'.$query_str.'"><font size="+1">'.&mt('Show Student View').'</font></a>'.
  &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>');   &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>');
       }  elsif ($privileged and $target ne 'tex') {        }  elsif ($privileged and $target ne 'tex') {
           my $query_str = 'forceedit=edit';            my $query_str = 'forceedit=edit';
Line 211  sub handler { Line 218  sub handler {
           &Apache::lonnet::put('bulletinpage_'.$marker,\%syllabus,$dom,$crs);            &Apache::lonnet::put('bulletinpage_'.$marker,\%syllabus,$dom,$crs);
        }         }
        if (($allowed) && ($env{'form.storesyl'})) {         if (($allowed) && ($env{'form.storesyl'})) {
    foreach (keys %syllabusfields) {     foreach my $syl_field (keys(%syllabusfields)) {
                my $field=$env{'form.'.$_};                 my $field=$env{'form.'.$syl_field};
                $field=~s/\s+$//s;                 $field=~s/\s+$//s;
                $field=&Apache::lonfeedback::clear_out_html($field,1);                 $field=&Apache::lonfeedback::clear_out_html($field,1);
        $syllabus{$_}=$field;         $syllabus{$syl_field}=$field;
            }             }
            $syllabus{'uploaded.lastmodified'}=time;             $syllabus{'uploaded.lastmodified'}=time;
            &Apache::lonnet::put('bulletinpage_'.$marker,\%syllabus,$dom,$crs);             &Apache::lonnet::put('bulletinpage_'.$marker,\%syllabus,$dom,$crs);
Line 234  sub handler { Line 241  sub handler {
  '<form method="post" enctype="multipart/form-data">'.   '<form method="post" enctype="multipart/form-data">'.
   '<input type="hidden" name="forceedit" value="edit" />'.    '<input type="hidden" name="forceedit" value="edit" />'.
          '<h3>'.&mt('Upload a Photo').'</h3>'.           '<h3>'.&mt('Upload a Photo').'</h3>'.
          '<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').'" />'.
  '</form><form method="post">');   '</form><form method="post">'.
            '<input type="hidden" name="forceedit" value="edit" />');
        }         }
        foreach (sort keys %syllabusfields) {         foreach my $field (sort(keys(%syllabusfields))) {
           if (($syllabus{$_}) || ($allowed)) {            if (($syllabus{$field}) || ($allowed)) {
               my $message=$syllabus{$_};                my $message=$syllabus{$field};
       &Apache::lonfeedback::newline_to_br(\$message);        &Apache::lonfeedback::newline_to_br(\$message);
       $message        $message
         =~s/(https*\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g;          =~s/(https*\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g;
Line 248  sub handler { Line 256  sub handler {
   $message=&Apache::lonspeller::markeduptext($message);    $message=&Apache::lonspeller::markeduptext($message);
       }        }
       $message=&Apache::lontexconvert::msgtexconverted($message);        $message=&Apache::lontexconvert::msgtexconverted($message);
       unless ($_ eq 'aaa_title') {        unless ($field eq 'aaa_title') {
  if (($_ ne 'bbb_content') || ($allowed)) {   if (($field ne 'bbb_content') || ($allowed)) {
     if ($target ne 'tex') {      if ($target ne 'tex') {
  $r->print('<h3>'.$syllabusfields{$_}.'</h3>');   $r->print('<h3>'.$syllabusfields{$field}.'</h3>');
     } else {      } else {
  $r->print('\\\\\textbf{'.$syllabusfields{$_}.'}\\\\');   $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\');
     }      }
  }   }
  if ($target ne 'tex') {   if ($target ne 'tex') {
Line 263  sub handler { Line 271  sub handler {
     $r->print(' '.&Apache::lonxml::xmlparse($r,'tex',$message).' ');      $r->print(' '.&Apache::lonxml::xmlparse($r,'tex',$message).' ');
  }   }
                  if ($allowed) {                   if ($allowed) {
                 $r->print('<br /><textarea cols="80" rows="10" name="'.$_.'">'.                  $r->print('<br /><textarea cols="80" rows="10" name="'.$field.'">'.
    $syllabus{$_}.    &HTML::Entities::encode($syllabus{$field},'&"<>').
            '</textarea><input type="submit" name="storesyl" value="'.&mt('Store').'" />');             '</textarea><input type="submit" name="storesyl" value="'.&mt('Save').'" />');
         }          }
     } else {      } else {
                 if ($target ne 'tex') {                  if ($target ne 'tex') {
Line 275  sub handler { Line 283  sub handler {
  }   }
                 if ($allowed) {                  if ($allowed) {
                  $r->print(                   $r->print(
                 '<br />'.&mt('Topic').'<br /><textarea cols="80" rows="2" name="'.$_.'">'.                  '<br />'.&mt('Topic').'<br /><textarea cols="80" rows="2" name="'.$field.'">'.
    $syllabus{$_}.    &HTML::Entities::encode($syllabus{$field},'&"<>').
            '</textarea><input type="submit" name="storesyl" value="'.&mt('Store').'" />');             '</textarea><input type="submit" name="storesyl" value="'.&mt('Save').'" />');
                 }                  }
             }              }
   }    }

Removed from v.1.38  
changed lines
  Added in v.1.48


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