[LON-CAPA-cvs] cvs: loncom /interface lonsyllabus.pm

www lon-capa-cvs@mail.lon-capa.org
Tue, 27 Aug 2002 15:17:45 -0000


www		Tue Aug 27 11:17:45 2002 EDT

  Modified files:              
    /loncom/interface	lonsyllabus.pm 
  Log:
  Shows course description and picks right domain
  
  
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.1 loncom/interface/lonsyllabus.pm:1.2
--- loncom/interface/lonsyllabus.pm:1.1	Tue Aug 27 08:48:46 2002
+++ loncom/interface/lonsyllabus.pm	Tue Aug 27 11:17:45 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.1 2002/08/27 12:48:46 www Exp $
+# $Id: lonsyllabus.pm,v 1.2 2002/08/27 15:17:45 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -47,13 +47,20 @@
 <title>The LearningOnline Network with CAPA</title>
 </head>
 ENDDOCUMENT
-    $r->print(&Apache::loncommon::bodytag("Syllabus"));
+    my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri);
+    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>');
+# 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'});
+       my $allowed=0;
+       if ($ENV{'request.course.id'}) {
+          $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'});
+       }
     }
-
     $r->print('</body></html>');
     return OK;
 }