[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm londocs.pm

raeburn raeburn at source.lon-capa.org
Sun Aug 18 13:31:26 EDT 2013


raeburn		Sun Aug 18 17:31:26 2013 EDT

  Modified files:              
    /loncom/interface	londocs.pm loncommon.pm 
  Log:
  - Accommodate ampersands in Folder titles.
  - Correct regexp used to determine if item in Supplemental content is a folder.
  - loncommon::recurse_supplemental() returns an array.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.560 loncom/interface/londocs.pm:1.561
--- loncom/interface/londocs.pm:1.560	Sat Aug 17 00:34:29 2013
+++ loncom/interface/londocs.pm	Sun Aug 18 17:31:26 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.560 2013/08/17 00:34:29 raeburn Exp $
+# $Id: londocs.pm,v 1.561 2013/08/18 17:31:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -410,6 +410,8 @@
     unless ($fatal) {
         if ($folder =~ /^supplemental/) {
             &Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1);
+            my ($errtext,$fatal) = &mapread($coursenum,$coursedom,
+                                            $folder.'.'.$container);
         }
     }
     return ($errtext,$fatal,$fixuperrors);
@@ -4184,9 +4186,9 @@
 # supplementalflag=0: show standard documents
 # toolsflag=1: show utilities
 
-    $env{'form.folderpath'} = &unescape($env{'form.folderpath'});
-    my $supplementalflag=($env{'form.folderpath'}=~/^supplemental/);
-    if (($env{'form.folderpath'}=~/^default/) || ($env{'form.folderpath'} eq "")) {
+    my $unesc_folderpath = &unescape($env{'form.folderpath'});
+    my $supplementalflag=($unesc_folderpath=~/^supplemental/);
+    if (($unesc_folderpath=~/^default/) || ($unesc_folderpath eq "")) {
        $supplementalflag=0;
     }
     if ($env{'form.forcesupplement'}) { $supplementalflag=1; }
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1145 loncom/interface/loncommon.pm:1.1146
--- loncom/interface/loncommon.pm:1.1145	Tue Aug 13 16:19:26 2013
+++ loncom/interface/loncommon.pm	Sun Aug 18 17:31:26 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1145 2013/08/13 16:19:26 raeburn Exp $
+# $Id: loncommon.pm,v 1.1146 2013/08/18 17:31:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -8884,7 +8884,7 @@
 
 Returns warning message if upload of file to authoring space, or copying
 of existing file within authoring space will cause quota for the authoring
-space to be exceeded,
+space to be exceeded.
 
 Same, if upload of a file directly to a course/community via Course Editor
 will cause quota for uploaded content for the course to be exceeded.
@@ -14591,8 +14591,8 @@
                 foreach my $res (@LONCAPA::map::resources) {
                     my ($title,$src,$ext,$type,$status)=split(/\:/,$res);
                     if (($src ne '') && ($status eq 'res')) {
-                        if ($src =~ m{^\Q/uploaded/$cdom/$cnum/\E(supplemental_/d+\.sequence)$}) {
-                            $numfiles = &recurse_supplemental($cnum,$cdom,$1,$numfiles);
+                        if ($src =~ m{^\Q/uploaded/$cdom/$cnum/\E(supplemental_\d+\.sequence)$}) {
+                            ($numfiles,$errors) = &recurse_supplemental($cnum,$cdom,$1,$numfiles,$errors);
                         } else {
                             $numfiles ++;
                         }
@@ -14633,7 +14633,7 @@
                     my $thistitle = $res->title();
                     $path .= '&'.
                              &Apache::lonhtmlcommon::entity_encode($thisurl).'&'.
-                             &Apache::lonhtmlcommon::entity_encode($thistitle).
+                             &escape($thistitle).
                              ':'.$res->randompick().
                              ':'.$res->randomout().
                              ':'.$res->encrypted().
@@ -14649,7 +14649,7 @@
         }
         $path .= (($path ne '')? '&' : '').
                  &Apache::lonhtmlcommon::entity_encode($mapurl).'&'.
-                 &Apache::lonhtmlcommon::entity_encode($maptitle).
+                 &escape($maptitle).
                  ':'.$mapresobj->randompick().
                  ':'.$mapresobj->randomout().
                  ':'.$mapresobj->encrypted().
@@ -14662,11 +14662,11 @@
             $maptitle = 'Main Content';
         }
         $path = &Apache::lonhtmlcommon::entity_encode($mapurl).'&'.
-                &Apache::lonhtmlcommon::entity_encode($maptitle).':::::'.$ispage;
+                &escape($maptitle).':::::'.$ispage;
     }
     unless ($mapurl eq 'default') {
         $path = 'default&'.
-                &Apache::lonhtmlcommon::entity_encode('Main Content').
+                &escape('Main Content').
                 ':::::&'.$path;
     }
     return $path;




More information about the LON-CAPA-cvs mailing list