--- loncom/interface/lonhtmlcommon.pm 2018/04/24 13:40:32 1.393
+++ loncom/interface/lonhtmlcommon.pm 2020/08/30 20:30:22 1.396
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.393 2018/04/24 13:40:32 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.396 2020/08/30 20:30:22 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2660,9 +2660,9 @@ sub course_custom_roles {
sub resource_info_box {
- my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp)=@_;
+ my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp,$divforres)=@_;
my $return='';
- if ($stuvcurrent ne '') {
+ if (($stuvcurrent ne '') || ($divforres)) {
$return = '
';
}
if ($symb) {
@@ -2691,7 +2691,7 @@ sub resource_info_box {
} else {
$return='
'.&mt('No context provided.').'
';
}
- if ($stuvcurrent ne '') {
+ if (($stuvcurrent ne '') || ($divforres)) {
$return .= '
';
}
return $return;
@@ -3508,7 +3508,16 @@ function go(url) {
currentURL = null;
currentSymb= null;
var lcHostname = setLCHost();
- window.location.href=lcHostname+url;
+ if (lcHostname!='' && lcHostname!= null) {
+ var RegExp = /^https?\:/;
+ if (RegExp.test(url)) {
+ window.location.href=url;
+ } else {
+ window.location.href=lcHostname+url;
+ }
+ } else {
+ window.location.href=url;
+ }
}
}
@@ -3548,13 +3557,15 @@ sub jump_to_editres {
}
} else {
unless ($cfile =~ m{^/priv/}) {
- if ($cfile =~ m{^(/adm/wrapper/ext/([^#]+))#([^#]+)$}) {
+ if ($cfile =~ m{^(/adm/wrapper/ext/([^#]+))(?:|#([^#]+))$}) {
$cfile = $1;
my $extlink = $2;
$anchor = $3;
$is_ext = 1;
if (($extlink !~ /^https:/) && ($ENV{'SERVER_PORT'} == 443)) {
- $usehttp = 1;
+ unless (&Apache::lonnet::uses_sts()) {
+ $usehttp = 1;
+ }
} elsif ($env{'request.use_absolute'}) {
if ($env{'request.use_absolute'} =~ m{^https://}) {
$usehttps = 1;
@@ -3567,7 +3578,9 @@ sub jump_to_editres {
($env{'course.'.$env{'request.course.id'}.'.num'} eq $cnum) &&
($env{'course.'.$env{'request.course.id'}.'.domain'} eq $cdom)) {
if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) {
- $usehttp = 1;
+ unless (&Apache::lonnet::uses_sts()) {
+ $usehttp = 1;
+ }
}
}
} elsif ($env{'request.use_absolute'}) {
@@ -3607,9 +3620,7 @@ sub jump_to_editres {
if ($hostname ne '') {
$cfile = 'http://'.$hostname.(($cfile =~ /^\//)? '':'/').$cfile;
}
- unless ($is_ext) {
- $cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1';
- }
+ $cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1';
} elsif ($usehttps) {
$cfile = $env{'request.use_absolute'}.(($cfile =~ /^\//)? '':'/').$cfile;
}