--- loncom/interface/lonhtmlcommon.pm 2016/09/15 17:31:00 1.358.2.7
+++ loncom/interface/lonhtmlcommon.pm 2016/10/31 21:00:49 1.358.2.9
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.358.2.7 2016/09/15 17:31:00 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.358.2.9 2016/10/31 21:00:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -534,6 +534,8 @@ sub date_setter {
if (! defined($state) || $state ne 'disabled') {
$state = '';
+ } else {
+ $state = 'disabled="disabled"';
}
if (! defined($no_hh_mm_ss)) {
$no_hh_mm_ss = 0;
@@ -3394,8 +3396,8 @@ ENDUTILITY
sub jump_to_editres {
my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath,
- $title,$idx,$suppurl,$todocs) = @_;
- my $jscall;
+ $title,$idx,$suppurl,$todocs,$suppanchor) = @_;
+ my ($jscall,$anchor);
if ($switchserver) {
if ($home) {
$cfile = '/adm/switchserver?otherserver='.$home.'&role='.
@@ -3415,7 +3417,16 @@ sub jump_to_editres {
}
} else {
unless ($cfile =~ m{^/priv/}) {
+ if ($cfile =~ m{^(/adm/wrapper/ext/[^#]+)#([^#]+)$}) {
+ $cfile = $1;
+ $anchor = $2;
+ }
if ($symb) {
+ if ($anchor ne '') {
+ if ($symb =~ m{^([^#]+)\Q#$anchor\E$}) {
+ $symb = $1.&escape(&escape('#')).$anchor;
+ }
+ }
$cfile .= (($cfile=~/\?/)?'&':'?')."symb=$symb";
} elsif ($folderpath) {
$cfile .= (($cfile=~/\?/)?'&':'?').
@@ -3439,9 +3450,16 @@ sub jump_to_editres {
$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;