Diff for /loncom/interface/lonsyllabus.pm between versions 1.40 and 1.45

version 1.40, 2005/04/07 06:56:23 version 1.45, 2006/03/06 22:17:48
Line 41  use Apache::lonspeller(); Line 41  use Apache::lonspeller();
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
   
   # --------------------------------------------------- Get course info from URL
       my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri);
   # ----------------------------------------------------- Is this even a course?
       my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom);
       if ($homeserver eq 'no_host') {
           &Apache::loncommon::content_type($r,'text/html');
           $r->send_http_header;
           $r->print('<html><body>'.&mt('No syllabus available').'</body></html>');
           return OK;
       }
   # ------------------------------------- There is such a course, get environment
       my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum);
       
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
     return OK if $r->header_only;      return OK if $r->header_only;
   
 # ------------------------------------------------------------ Print the screen  # ------------------------------------------------------------ Print the screen
     my $target=$env{'form.grade_target'};      my $target=$env{'form.grade_target'};
       my $feedurl='feed://'.$ENV{'HTTP_HOST'}.'/public/'.$cdom.'/'.$cnum.'/Course_Announcements.rss';
     if ($target ne 'tex') {      if ($target ne 'tex') {
  my $html=&Apache::lonxml::xmlbegin();   my $html=&Apache::lonxml::xmlbegin();
  $r->print(<<ENDDOCUMENT);   $r->print(<<ENDDOCUMENT);
 $html  $html
 <head>  <head>
 <title>The LearningOnline Network with CAPA</title>  <title>The LearningOnline Network with CAPA</title>
   <link rel="alternate" type="application/rss+xml" title="Course Announcements" href="$feedurl" />
 ENDDOCUMENT  ENDDOCUMENT
     } else {      } 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,$cdom,$cnum)=split(/\//,$r->uri);  
 # Is this even a course?  
     my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom);   
     if ($homeserver eq 'no_host') {  
  $r->print('</head><body>'.&mt('No syllabus available').'</body></html>');  
         return OK;  
     }  
 # --------------------------------------------------------- The syllabus fields  # --------------------------------------------------------- The syllabus fields
     my %syllabusfields=&Apache::lonlocal::texthash(      my %syllabusfields=&Apache::lonlocal::texthash(
        'aaa_instructorinfo' => 'Instructor Information',         'aaa_instructorinfo' => 'Instructor Information',
Line 98  ENDDOCUMENT Line 107  ENDDOCUMENT
     my $forceedit='';      my $forceedit='';
     if ($env{'form.forceedit'}) { $forceedit='edit'; }      if ($env{'form.forceedit'}) { $forceedit='edit'; }
                 
 # ------------------------------------- There is such a course, get environment  # ----------------------------------------------------------------- Make header 
     my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum);  
     if ($target ne 'tex') {      if ($target ne 'tex') {
  $r->print(&Apache::lonhtmlcommon::htmlareaheaders().   $r->print(&Apache::lonhtmlcommon::htmlareaheaders().
   '</head>'.&Apache::loncommon::bodytag    '</head>'.&Apache::loncommon::bodytag
Line 113  ENDDOCUMENT Line 121  ENDDOCUMENT
 # -------------------------------------------------------------- Announcements?  # -------------------------------------------------------------- Announcements?
     if ($target ne 'tex') {      if ($target ne 'tex') {
  $r->print(&Apache::lonannounce::showday(time,2,   $r->print(&Apache::lonannounce::showday(time,2,
                          &Apache::lonannounce::readcalendar($cdom.'_'.$cnum)));         &Apache::lonannounce::readcalendar($cdom.'_'.$cnum)).
                          &Apache::lonrss::advertisefeeds($cnum,$cdom));
     } else {      } else {
  $r->print(&Apache::lonxml::xmlparse($r,'tex',   $r->print(&Apache::lonxml::xmlparse($r,'tex',
        &Apache::lonannounce::showday(time,2,         &Apache::lonannounce::showday(time,2,
Line 285  ENDDOCUMENT Line 294  ENDDOCUMENT
                   $r->print($message);                    $r->print($message);
                  }                    } 
               } else {                } else {
                  $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;
  if ($allowed) {   if ($allowed) {

Removed from v.1.40  
changed lines
  Added in v.1.45


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