[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonhtmlcommon.pm

raeburn raeburn at source.lon-capa.org
Mon Oct 31 17:00:49 EDT 2016


raeburn		Mon Oct 31 21:00:49 2016 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  - For 2.11
    - Backport 1.375, 1.376
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.358.2.8 loncom/interface/lonhtmlcommon.pm:1.358.2.9
--- loncom/interface/lonhtmlcommon.pm:1.358.2.8	Sun Oct 23 20:07:28 2016
+++ loncom/interface/lonhtmlcommon.pm	Mon Oct 31 21:00:49 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.358.2.8 2016/10/23 20:07:28 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
 #
@@ -3396,8 +3396,8 @@
 
 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='.
@@ -3417,7 +3417,16 @@
         }
     } 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=~/\?/)?'&':'?').
@@ -3441,8 +3450,15 @@
                 $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)."')";
     }




More information about the LON-CAPA-cvs mailing list