'."\n".
+
'.&mt('Currently using [_1] of the [_2] available.',$usage.' MB
('.$percent.'%)',$quota.' MB')."\n".
+'
'."\n".
'
';
@@ -3454,7 +3477,8 @@ function go(url) {
if (url!='' && url!= null) {
currentURL = null;
currentSymb= null;
- window.location.href=url;
+ var lcHostname = setLCHost();
+ window.location.href=lcHostname+url;
}
}
@@ -3473,8 +3497,8 @@ ENDUTILITY
sub jump_to_editres {
my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath,
- $title,$idx,$suppurl,$todocs) = @_;
- my $jscall;
+ $title,$hostname,$idx,$suppurl,$todocs,$suppanchor) = @_;
+ my ($jscall,$anchor,$usehttp,$usehttps,$is_ext);
if ($switchserver) {
if ($home) {
$cfile = '/adm/switchserver?otherserver='.$home.'&role='.
@@ -3494,7 +3518,40 @@ sub jump_to_editres {
}
} else {
unless ($cfile =~ m{^/priv/}) {
+ 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;
+ } elsif ($env{'request.use_absolute'}) {
+ if ($env{'request.use_absolute'} =~ m{^https://}) {
+ $usehttps = 1;
+ }
+ }
+ } elsif ($cfile =~ m{^/?public/($match_domain)/($match_courseid)/syllabus}) {
+ if ($ENV{'SERVER_PORT'} == 443) {
+ my ($cdom,$cnum) = ($1,$2);
+ if (($env{'request.course.id'}) &&
+ ($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;
+ }
+ }
+ } elsif ($env{'request.use_absolute'}) {
+ if ($env{'request.use_absolute'} =~ m{^https://}) {
+ $usehttps = 1;
+ }
+ }
+ }
if ($symb) {
+ if ($anchor ne '') {
+ if ($symb =~ m{^([^#]+)\Q#$anchor\E$}) {
+ $symb = $1.&escape(&escape('#')).$anchor;
+ }
+ }
$cfile .= (($cfile=~/\?/)?'&':'?')."symb=$symb";
} elsif ($folderpath) {
$cfile .= (($cfile=~/\?/)?'&':'?').
@@ -3513,14 +3570,33 @@ sub jump_to_editres {
}
if ($forceedit) {
$cfile .= (($cfile=~/\?/)?'&':'?').'forceedit=1';
+ if ($usehttps) {
+ $cfile = $env{'request.use_absolute'}.(($cfile =~ /^\//)? '':'/').$cfile;
+ }
+ } elsif ($usehttp) {
+ if ($hostname ne '') {
+ $cfile = 'http://'.$hostname.(($cfile =~ /^\//)? '':'/').$cfile;
+ }
+ unless ($is_ext) {
+ $cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1';
+ }
+ } elsif ($usehttps) {
+ $cfile = $env{'request.use_absolute'}.(($cfile =~ /^\//)? '':'/').$cfile;
}
if ($forcereg) {
$cfile .= (($cfile=~/\?/)?'&':'?').'register=1';
}
if ($todocs) {
- $cfile .= (($cfile=~/\?/)?'&':'?').'todocs=1';
+ $cfile .= (($cfile=~/\?/)?'&':'?').'todocs=1';
+ }
+ if ($suppanchor ne '') {
+ $cfile .= (($cfile=~/\?/)?'&':'?').'anchor='.
+ &HTML::Entities::encode($suppanchor,'"<>&');
}
}
+ if ($anchor ne '') {
+ $cfile .= '#'.$anchor;
+ }
$jscall = "go('".&Apache::loncommon::escape_single($cfile)."')";
}
return $jscall;