[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm lonsyllabus.pm
www
lon-capa-cvs@mail.lon-capa.org
Mon, 06 Mar 2006 22:17:48 -0000
www Mon Mar 6 17:17:48 2006 EDT
Modified files:
/loncom/interface lonparmset.pm lonsyllabus.pm
Log:
Working on external URL setting for Syllabus
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.277 loncom/interface/lonparmset.pm:1.278
--- loncom/interface/lonparmset.pm:1.277 Sat Mar 4 17:17:36 2006
+++ loncom/interface/lonparmset.pm Mon Mar 6 17:17:48 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.277 2006/03/04 22:17:36 www Exp $
+# $Id: lonparmset.pm,v 1.278 2006/03/06 22:17:48 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2197,10 +2197,13 @@
'disableexampointprint'
=> '<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>',
'tthoptions'
=> '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>'
);
my @Display_Order = ('url','description','courseid','cloners','grading',
+ 'externalsyllabus',
'default_xml_style','pageseparators',
'question.email','comment.email','policy.email',
'student_classlist_view',
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.44 loncom/interface/lonsyllabus.pm:1.45
--- loncom/interface/lonsyllabus.pm:1.44 Fri Nov 18 08:35:30 2005
+++ loncom/interface/lonsyllabus.pm Mon Mar 6 17:17:48 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Syllabus
#
-# $Id: lonsyllabus.pm,v 1.44 2005/11/18 13:35:30 www Exp $
+# $Id: lonsyllabus.pm,v 1.45 2006/03/06 22:17:48 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -41,13 +41,25 @@
sub handler {
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');
$r->send_http_header;
return OK if $r->header_only;
-
# ------------------------------------------------------------ Print the screen
my $target=$env{'form.grade_target'};
- my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri);
my $feedurl='feed://'.$ENV{'HTTP_HOST'}.'/public/'.$cdom.'/'.$cnum.'/Course_Announcements.rss';
if ($target ne 'tex') {
my $html=&Apache::lonxml::xmlbegin();
@@ -61,12 +73,6 @@
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}));
}
-# 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
my %syllabusfields=&Apache::lonlocal::texthash(
'aaa_instructorinfo' => 'Instructor Information',
@@ -101,8 +107,7 @@
my $forceedit='';
if ($env{'form.forceedit'}) { $forceedit='edit'; }
-# ------------------------------------- There is such a course, get environment
- my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum);
+# ----------------------------------------------------------------- Make header
if ($target ne 'tex') {
$r->print(&Apache::lonhtmlcommon::htmlareaheaders().
'</head>'.&Apache::loncommon::bodytag