Diff for /loncom/interface/lonsyllabus.pm between versions 1.1 and 1.4

version 1.1, 2002/08/27 12:48:46 version 1.4, 2002/08/27 16:49:20
Line 47  sub handler { Line 47  sub handler {
 <title>The LearningOnline Network with CAPA</title>  <title>The LearningOnline Network with CAPA</title>
 </head>  </head>
 ENDDOCUMENT  ENDDOCUMENT
     $r->print(&Apache::loncommon::bodytag("Syllabus"));      my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri);
 # does this user have privileges to post, etc?  # Is this even a course?
     my $allowed=0;      if (&Apache::lonnet::homeserver($cnum,$cdom) eq 'no_host') {
     if ($ENV{'request.course.id'}) {   $r->print('<body>No syllabus available</body>');
        $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'});          return OK;
     }      }
   # ------------------------------------- There is such a course, get environment
       my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum);
       $r->print(&Apache::loncommon::bodytag("Syllabus",'','','',$cdom));
       $r->print('<h1>'.$courseenv{'description'}.'</h1><h3>'.
                 $Apache::lonnet::domaindescription{$cdom}.'</h3>');
       my %syllabus=&Apache::lonnet::dump('syllabus',$cdom,$cnum);
   
   # This handler might be called anonymously ...
   # ----------------------------------------------------- Only if not public call
       if ($ENV{'user.environment'}) {
   # does this user have privileges to post, etc?
          my $allowed=0;
          if ($ENV{'request.course.id'}) {
             $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'});
          }
       }
   # ---------------------------------------------------------------- Get syllabus
       if ($ENV{'uploaded.lastmodified'}) {
          $r->print('<table><tr><td>Uploaded:</td><td>'.
    &Apache::loncommon::plainname($syllabus{'uploaded.name'},
                        $syllabus{'uploaded.domain'}).
    '</td></tr><tr><td>Last updated</td><td>'.
                        localtime($syllabus{'uploaded.lastmodified'}).
                        '</td></tr></table>');
           $r->print('<blockquote>'.$syllabus{'description'}.'</blockquote>');
       } else {
          $r->print('<p>No syllabus information provided.</p>');
       }
     $r->print('</body></html>');      $r->print('</body></html>');
     return OK;      return OK;
 }   } 

Removed from v.1.1  
changed lines
  Added in v.1.4


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