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

raeburn raeburn at source.lon-capa.org
Fri Jan 23 17:59:28 EST 2015


raeburn		Fri Jan 23 22:59:28 2015 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonindexer.pm 
  Log:
  - For 2.11
    - Backport 1.222, 1.223
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.213.4.7 loncom/interface/lonindexer.pm:1.213.4.8
--- loncom/interface/lonindexer.pm:1.213.4.7	Mon Jun  9 21:35:19 2014
+++ loncom/interface/lonindexer.pm	Fri Jan 23 22:59:28 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.213.4.7 2014/06/09 21:35:19 raeburn Exp $
+# $Id: lonindexer.pm,v 1.213.4.8 2015/01/23 22:59:28 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -623,7 +623,7 @@
     	
 
 # ----------------- read in what directories have previously been set to "open"
-	foreach (keys %hash) {
+	foreach (keys(%hash)) {
 	    if ($_ =~ /^diropen_status_/) {
 		my $key = $_;
 		$key =~ s/^diropen_status_//;
@@ -754,7 +754,7 @@
     
     (my $luri = $uri) =~ s/\//_/g;
     if ($env{'form.updatedisplay'}) {
-	foreach (keys %hash) {
+	foreach (keys(%hash)) {
 	    delete $hash{$_} if ($_ =~ /^dirlist_files_/);
 	    delete $hash{$_} if ($_ =~ /^dirlist_timestamp_files_/);
 	}
@@ -989,6 +989,9 @@
 	$r->print (' alt="'.$msg.'"/></a>'.
 		   "\n");
 	my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
+        my $quotable_startdir = &Apache::loncommon::escape_single($startdir);
+        my $quotable_listname = &Apache::loncommon::escape_single($listname);
+
 	$r->print ('<a href="javascript:gothere(\''.$quotable_curdir
 		   .'\')"><img alt="'.$msg.'" src="'.
 		   $iconpath.'quill.gif" class="LC_fileicon" />');
@@ -1000,7 +1003,7 @@
 # Wishlistlink
         $r->print('</form></td><td><a href="javascript:;" '.
                   'title="'.&mt('Save a link for this folder in your personal Stored Links repository').'" '.
-                  'onclick="set_wishlistlink('."'$plainname','$startdir$listname"."/'".')">'.
+                  'onclick="set_wishlistlink('."'$plainname','$quotable_startdir$quotable_listname"."/'".')">'.
                   '<img class="LC_icon" src="/res/adm/pages/wishlist.png" '.
                   'alt="'.&mt('save in Stored Links').'" style="width:22px;"/></a>'.$tabtag);
         $r->print(&Apache::loncommon::end_data_table_row());
@@ -1083,6 +1086,8 @@
 # Filetype icons
 	$r->print("<img alt=\"\" src='$iconname' class='LC_fileicon' />\n");
 	my $quotable_filelink = &Apache::loncommon::escape_single($filelink);
+        my $quotable_startdir = Apache::loncommon::escape_single($startdir);
+        my $quotable_listname = &Apache::loncommon::escape_single($listname);
 
 	$r->print (" <a href=\"javascript:openMyModal('".$quotable_filelink."?inhibitmenu=yes',500,500,'yes');\">$listname</a> ");
 	$quotable_filelink = &Apache::loncommon::escape_single($filelink.'.meta');
@@ -1096,7 +1101,7 @@
 # Wishlistlink
         $r->print('<td><a href="javascript:;" title="'.&mt('Save a link for this resource in your personal Stored Links repository').'" '.
                   'onclick="set_wishlistlink('."'".&Apache::lonnet::gettitle($filelink).
-                  "','$startdir$listname'".')">'.
+                  "','$quotable_startdir$quotable_listname'".')">'.
                   '<img class="LC_icon" src="/res/adm/pages/wishlist.png" '.
                   'alt="'.&mt('save in Stored Links').'" style="width:22px;"/></a></td>');
 	if ($hash{'display_attrs_0'} == 1) {
@@ -1238,7 +1243,9 @@
 	$r->print (' alt="'.$msg.'" class="LC_fileicon" /></a>'.
 		   "\n");
 	my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
-        
+        my $quotable_startdir = &Apache::loncommon::escape_single($startdir);
+        my $quotable_listname = &Apache::loncommon::escape_single($listname);
+
         my $location = &Apache::loncommon::lonhttpdurl("/adm/lonIcons");
 	my $icon = "navmap.folder.".($nowOpen ? "open":"closed").'.gif';
         $r->print ('<a href="javascript:gothere('
@@ -1250,7 +1257,7 @@
 # Wishlistlink
         $r->print('</td><td><a href="javascript:;" '.
                   'title="'.&mt('Save a link for this folder in Stored Links').'" '.
-                  'onclick="set_wishlistlink('."'$listname','$startdir$listname"."/'".')">'.
+                  'onclick="set_wishlistlink('."'$listname','$quotable_startdir$quotable_listname"."/'".')">'.
                   '<img class="LC_icon" src="/res/adm/pages/wishlist.png" '.
                   'alt="'.&mt('save in Stored Links').'" style="width:22px;"/></a></td>');
 # Attributes
@@ -1432,7 +1439,7 @@
     delete $hash->{'form.element'};
     delete $hash->{'form.omit'};
     delete $hash->{'form.only'};
-    foreach (keys %{$hash}) {
+    foreach (keys(%{$hash})) {
         delete $hash->{$_} if (/^(pre_|store)/);
     }
 }




More information about the LON-CAPA-cvs mailing list