Diff for /loncom/interface/lonbulletin.pm between versions 1.29 and 1.33

version 1.29, 2005/04/07 06:56:22 version 1.33, 2006/03/21 20:41:40
Line 44  sub handler { Line 44  sub handler {
     my $target=$env{'form.grade_target'};      my $target=$env{'form.grade_target'};
   
 # ------------------------------------------------------------ Print the screen  # ------------------------------------------------------------ Print the screen
     if ($target ne 'tex') {      if ($target eq 'tex') {
  my $html=&Apache::lonxml::xmlbegin();  
  $r->print(<<ENDDOCUMENT);  
 $html  
 <head>  
 <title>The LearningOnline Network with CAPA</title>  
 ENDDOCUMENT  
 } else {  
  $r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}));   $r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}));
     }      }
     my (undef,undef,undef,undef,$marker)=split(/\//,$r->uri);      my (undef,undef,undef,undef,$marker)=split(/\//,$r->uri);
 # Is this even in a course?  # Is this even in a course?
     unless ($env{'request.course.id'}) {      if (!$env{'request.course.id'}) {
  $r->print('</head><body>Not in a course</body></html>');   $r->print(&Apache::loncommon::start_page('Not in a course').
     &mt('Not in a course').
     &Apache::loncommon::end_page());
         return OK;          return OK;
     }      }
   
     $marker=~s/\D//g;      $marker=~s/\D//g;
   
     unless ($marker) {      if (!$marker) {
  $r->print('<body>Invalid call</body>');   $r->print(&Apache::loncommon::start_page('Invalid Call').
     &mt('Invalid Call').
     &Apache::loncommon::end_page());
         return OK;          return OK;
     }      }
   
Line 102  ENDDOCUMENT Line 99  ENDDOCUMENT
     my %syllabus=&Apache::lonnet::dump('bulletinpage_'.$marker,$dom,$crs);      my %syllabus=&Apache::lonnet::dump('bulletinpage_'.$marker,$dom,$crs);
                 
 # --------------------------------------- There is such a user, get environment  # --------------------------------------- There is such a user, get environment
     if ($target ne 'tex') {         if ($target ne 'tex') {  
  $r->print('</head>'.&Apache::loncommon::bodytag   my $start_page =
                   ("Bulletin Board/Discussion",$forcestudent,$addentries,'',$dom,      &Apache::loncommon::start_page("Bulletin Board/Discussion",undef,
                   $env{'form.register'}));     {'function'       => $forcestudent,
       'add_entries'    => $addentries,
       'domain'         => $dom,
       'force_register' =>
    $env{'form.register'}});
    $r->print($start_page);
     }      }
     my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});      my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
   
Line 169  ENDDOCUMENT Line 171  ENDDOCUMENT
        foreach (sort keys %syllabusfields) {         foreach (sort keys %syllabusfields) {
           if (($syllabus{$_}) || ($allowed)) {            if (($syllabus{$_}) || ($allowed)) {
               my $message=$syllabus{$_};                my $message=$syllabus{$_};
               $message=~s/\n/\<br \/\>/g;        &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;
       $message=&Apache::lontexconvert::msgtexconverted($message);  
       if ($allowed) {        if ($allowed) {
   $message=&Apache::lonspeller::markeduptext($message);    $message=&Apache::lonspeller::markeduptext($message);
       }        }
         $message=&Apache::lontexconvert::msgtexconverted($message);
       unless ($_ eq 'aaa_title') {        unless ($_ eq 'aaa_title') {
  if (($_ ne 'bbb_content') || ($allowed)) {   if (($_ ne 'bbb_content') || ($allowed)) {
     if ($target ne 'tex') {      if ($target ne 'tex') {
Line 227  ENDDOCUMENT Line 229  ENDDOCUMENT
            ('board','OPEN','bulletin___'.$marker.'___'.             ('board','OPEN','bulletin___'.$marker.'___'.
             $r->uri)));              $r->uri)));
     }      }
     if ($target ne 'tex') {$r->print('</body></html>');} else {$r->print('\end{document}');}      if ($target ne 'tex') {
    $r->print(&Apache::loncommon::end_page());
       } else {
    $r->print('\end{document}');
       }
     return OK;      return OK;
 }   } 
   

Removed from v.1.29  
changed lines
  Added in v.1.33


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