--- loncom/interface/lonsyllabus.pm 2021/04/29 17:45:22 1.149 +++ loncom/interface/lonsyllabus.pm 2021/05/04 18:47:36 1.150 @@ -1,7 +1,7 @@ # The LearningOnline Network # Syllabus # -# $Id: lonsyllabus.pm,v 1.149 2021/04/29 17:45:22 raeburn Exp $ +# $Id: lonsyllabus.pm,v 1.150 2021/05/04 18:47:36 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -317,6 +317,8 @@ sub handler { my $hostname = &Apache::lonnet::hostname($homeserver); my $protocol = $Apache::lonnet::protocol{$homeserver}; $protocol = 'http' if ($protocol ne 'https'); + my $alias = &Apache::lonnet::use_proxy_alias($r,$homeserver); + $hostname = $alias if ($alias ne ''); my $link = $protocol.'://'.$hostname.$r->uri; $r->print('
' .'' @@ -326,7 +328,7 @@ sub handler { .'' .'
'."\n"); my $lonhost = $r->dir_config('lonHostID'); - $r->print(&chooser($external,$uploaded,$minimal,$cdom,$cnum,$lonhost, + $r->print(&chooser($r,$external,$uploaded,$minimal,$cdom,$cnum,$lonhost, \%syllabusfields,\%syllabus)); } } else { @@ -789,7 +791,7 @@ sub get_breadcrumbs{ } sub chooser { - my ($external,$uploaded,$minimal,$cdom,$cnum,$lonhost,$fields,$values) = @_; + my ($r,$external,$uploaded,$minimal,$cdom,$cnum,$lonhost,$fields,$values) = @_; my %lt = &Apache::lonlocal::texthash( 'type' => 'Syllabus Type', 'url' => 'External URL', @@ -854,7 +856,7 @@ sub chooser { '
'."\n". '
'.$lt{'minimal'}.''; if ($minimal) { - my ($absurl,$filename,$depbutton) = &syllabus_file_info($minimal,$cnum,$cdom,$lonhost,'minimal'); + my ($absurl,$filename,$depbutton) = &syllabus_file_info($r,$minimal,$cnum,$cdom,$lonhost,'minimal'); $output .= ''.$lt{'pr'}.''. ''. $depbutton; @@ -867,7 +869,7 @@ sub chooser { '
'."\n". '
'.$lt{'file'}.''; if ($uploaded) { - my ($absurl,$filename,$depbutton) = &syllabus_file_info($uploaded,$cnum,$cdom,$lonhost,'file'); + my ($absurl,$filename,$depbutton) = &syllabus_file_info($r,$uploaded,$cnum,$cdom,$lonhost,'file'); $output .= ''.$lt{'curr'}.' '. ''. ''.$filename.''.$depbutton. @@ -902,10 +904,12 @@ sub chooser { } sub syllabus_file_info { - my ($item,$cnum,$cdom,$lonhost,$context) = @_; + my ($r,$item,$cnum,$cdom,$lonhost,$context) = @_; my $hostname = &Apache::lonnet::hostname($lonhost); my $protocol = $Apache::lonnet::protocol{$lonhost}; $protocol = 'http' if ($protocol ne 'https'); + my $alias = &Apache::lonnet::use_proxy_alias($r,$lonhost); + $hostname = $alias if ($alias ne ''); my $absurl = $protocol.'://'.$hostname.$item; my ($filename) = ($item =~ m{([^/]+)$}); my $file=&Apache::lonnet::filelocation("",$item);