--- loncom/interface/coursecatalog.pm 2017/02/18 23:39:15 1.91
+++ loncom/interface/coursecatalog.pm 2017/02/20 18:29:22 1.92
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for displaying the course catalog interface
#
-# $Id: coursecatalog.pm,v 1.91 2017/02/18 23:39:15 raeburn Exp $
+# $Id: coursecatalog.pm,v 1.92 2017/02/20 18:29:22 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -125,7 +125,7 @@ sub handler {
}
my $js = ''."\n";
$r->print(&Apache::loncommon::start_page('Search for a Course/Community',$js));
@@ -254,7 +254,7 @@ function setCourseId(caller) {
}
ENDSCRIPT
- $catjs .= &courselink_javascript();
+ $catjs .= &courselink_javascript($r);
if (&user_is_dc($codedom) || $canviewall) {
$catjs .= < "0",
marginheight => "0",);
my $js = ''."\n";
+ &courselink_javascript($r).''."\n";
my $start_page =
&Apache::loncommon::start_page('Course/Community Catalog',$js,
{'add_entries' => \%add_entries, });
@@ -416,6 +416,8 @@ END
}
sub courselink_javascript {
+ my ($r) = @_;
+ my $hostname = $r->hostname();
return <<"END";
function ToSyllabus(cdom,cnum,usehttp) {
@@ -427,6 +429,10 @@ function ToSyllabus(cdom,cnum,usehttp) {
}
document.linklaunch.action = "/public/"+cdom+"/"+cnum+"/syllabus";
if (usehttp == 1) {
+ var hostname = '$hostname';
+ if (hostname != '') {
+ document.linklaunch.action = 'http://'+hostname+document.linklaunch.action;
+ }
document.linklaunch.action += '?usehttp=1';
}
document.linklaunch.submit();