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

www lon-capa-cvs@mail.lon-capa.org
Tue, 07 Mar 2006 21:36:24 -0000


www		Tue Mar  7 16:36:24 2006 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm lonsyllabus.pm 
  Log:
  Bug #2548: any page as Syllabus
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.278 loncom/interface/lonparmset.pm:1.279
--- loncom/interface/lonparmset.pm:1.278	Mon Mar  6 17:17:48 2006
+++ loncom/interface/lonparmset.pm	Tue Mar  7 16:36:19 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.278 2006/03/06 22:17:48 www Exp $
+# $Id: lonparmset.pm,v 1.279 2006/03/07 21:36:19 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2198,7 +2198,7 @@
 	         => '<b>'.&mt('Disable automatically printing point values onto exams.').'</b><br />'.
                     ' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')',
              'externalsyllabus'
-                 => '<b>'.&mt('URL of Syllabus (not using internal handler))').'</b>',
+                 => '<b>'.&mt('URL of Syllabus (not using internal handler)').'</b>',
 	     'tthoptions'
 	         => '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>'
              ); 
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.46 loncom/interface/lonsyllabus.pm:1.47
--- loncom/interface/lonsyllabus.pm:1.46	Mon Mar  6 18:02:22 2006
+++ loncom/interface/lonsyllabus.pm	Tue Mar  7 16:36:20 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.46 2006/03/06 23:02:22 www Exp $
+# $Id: lonsyllabus.pm,v 1.47 2006/03/07 21:36:20 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -50,7 +50,7 @@
     my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri);
 # ------------------------------------------------------------ Get query string
     &Apache::loncommon::get_unprocessed_cgi
-                        ($ENV{'QUERY_STRING'},['forcestudent','register','forceedit','headermode']);
+                        ($ENV{'QUERY_STRING'},['forcestudent','register','forceedit','wrapperdisplay']);
 # ----------------------------------------------------- Is this even a course?
     my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom);
     if ($homeserver eq 'no_host') {
@@ -83,9 +83,49 @@
        $r->print(&Apache::lonmenu::registerurl(1));
     }
 # -------------------------------------------------- Let's see who handles this
-    my $externalsyllabus=$courseenv{'course.'.$cdom.'_'.$cnum.'_externalsyllabus'};
+    my $externalsyllabus=$courseenv{'externalsyllabus'};
     if ($externalsyllabus=~/\w/) {
-    }
+       $r->print('</head>');
+       if ($env{'form.wrapperdisplay'} eq 'menu') {
+#
+# Producing the menu buttons
+#
+           $r->print('<body bgcolor="#FFFFFF">'.
+                &Apache::lonmenu::menubuttons(1,'web',1).'</body></html>');
+        } else {
+           if ($env{'browser.interface'} eq 'textual') {
+#
+# ssi-based rendering for text-based interface
+#
+               $r->print('<body bgcolor="#FFFFFF">'.
+                        &Apache::lonmenu::menubuttons(1).
+                        &Apache::lonnet::ssi_body($externalsyllabus).'</body></html>');
+           } elsif ($env{'environment.remote'} eq 'off') {
+#
+# This is inline remote
+# 
+               $r->print(<<ENDDOCUMENTINL);
+<frameset rows="180,*" border=0 $addentries>
+<frame src="/public/$cdom/$cnum/syllabus?wrapperdisplay=menu">
+<frame src="$externalsyllabus">
+</frameset>
+</html>
+ENDDOCUMENTINL
+          } else {
+#
+# frame-based rendering for graphical interface
+#
+               $r->print(<<ENDDOCUMENT);
+<frameset rows="1,*" border=0 $addentries>
+<frame src="/adm/rat/empty.html">
+<frame src="$externalsyllabus">
+</frameset>
+</html>
+ENDDOCUMENT
+           }
+        }
+        return OK;
+     } 
 
 # ------------------------------ The buck stops here: internal syllabus display
 # --------------------------------------------------------- The syllabus fields
@@ -190,6 +230,7 @@
 		    .' <tt>http://'.
 		    $Apache::lonnet::hostname{$homeserver}.$r->uri.'</tt>'.
                &Apache::loncommon::help_open_topic('Syllabus_ExtLink').'</p>'.
+          '<p>'.&mt('You can specify an external URL as Syllabus in the [_1].','<a href="/adm/parmset?action=crsenv">'.&mt('Course Parameters').'</a>').'</p>'.
 	  '<p><a href="'.$r->uri.'?forcestudent=1"><font size="+1">'.
 &mt('Show Public View').'</font></a>'.
           &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').