--- loncom/interface/lonsyllabus.pm 2006/10/23 18:48:47 1.55
+++ loncom/interface/lonsyllabus.pm 2007/07/27 00:21:39 1.61
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Syllabus
#
-# $Id: lonsyllabus.pm,v 1.55 2006/10/23 18:48:47 albertel Exp $
+# $Id: lonsyllabus.pm,v 1.61 2007/07/27 00:21:39 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -66,9 +66,6 @@ sub handler {
# ------------------------------------------------------------ Print the screen
- my $rss_link =
- &Apache::lonrss::rss_link('http://'.$ENV{'HTTP_HOST'}.'/public/'.$cdom.'/'.$cnum.'/Course_Announcements.rss');
-
if ($target eq 'tex') {
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}));
}
@@ -112,6 +109,7 @@ sub handler {
# ----------------------------------------------------------------- Make header
if ($target ne 'tex') {
+ my $rss_link = &Apache::lonrss::rss_link($cnum,$cdom);
my $start_page =
&Apache::loncommon::start_page("Syllabus", $rss_link,
{'function' => $forcestudent,
@@ -120,10 +118,10 @@ sub handler {
$env{'form.register'},});
$r->print($start_page.'
'.$courseenv{'description'}.'
'.
- $Apache::lonnet::domaindescription{$cdom}.'
');
+ &Apache::lonnet::domain($cdom,'description').'');
} else {
$r->print('\noindent{\large\textbf{'.$courseenv{'description'}.'}}\\\\\\\\\textbf{'.
- $Apache::lonnet::domaindescription{$cdom}.'}\\\\');
+ &Apache::lonnet::domain($cdom,'description').'}\\\\');
}
# -------------------------------------------------------------- Announcements?
my $day = &Apache::lonannounce::showday(time,2,
@@ -192,7 +190,7 @@ sub handler {
$r->print(''.
&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'
'.&mt('This syllabus can be publicly viewed at')
.' http://'.
- $Apache::lonnet::hostname{$homeserver}.$r->uri.''.
+ &Apache::lonnet::hostname($homeserver).$r->uri.''.
&Apache::loncommon::help_open_topic('Syllabus_ExtLink').'
'.
''.&mt('You can specify an external URL as Syllabus in the [_1].',''.&mt('Course Parameters').'').'
'.
''.
@@ -225,9 +223,10 @@ sub handler {
my $host = $1;
my $remainder=$2;
# remove the hostname from internal URLs
- foreach my $possible_host (keys(%Apache::lonnet::hostname)) {
- if ($possible_host =~
- /\Q$Apache::lonnet::hostname{$host}\E/i) {
+ my $hostname = &Apache::lonnet::hostname($host);
+ my %all_hostnames = &Apache::lonnet::all_hostnames();
+ foreach my $possible_host (keys(%all_hostnames)) {
+ if ($possible_host =~ /\Q$hostname\E/i) {
$url=$remainder;
}
}
@@ -260,12 +259,16 @@ sub handler {
$syllabus{'uploaded.domain'});
if ($target ne 'tex') {
$r->print(''.&mt('Last updated').': | '.
- $lastmod.' | '.&mt('by').' '.$who.
+ $lastmod.' | '.
+ ($who ? &mt('by').' '.$who
+ : '' ).
' |
');
} else {
- $r->print('\\\\ '.&mt('Last updated').': '.$lastmod.' '.&mt('by').'\\\\ '.
- &Apache::loncommon::plainname($syllabus{'uploaded.name'},
- $syllabus{'uploaded.domain'}).'\\\\');
+ $r->print('\\\\ '.&mt('Last updated').': '.$lastmod.' '.
+ ($who? &mt('by').'\\\\ '.
+ &Apache::loncommon::plainname($syllabus{'uploaded.name'},$syllabus{'uploaded.domain'})
+ :'')
+ .'\\\\');
}
if ($allowed) {
$r->print('