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

raeburn raeburn at source.lon-capa.org
Sat Oct 22 20:04:51 EDT 2011


raeburn		Sun Oct 23 00:04:51 2011 EDT

  Modified files:              
    /loncom/interface	loncoursegroups.pm 
  Log:
  - Change to behavior of portfolio::get_dir_list() in portfolio.pm rev. 1.233.
    - error is passed as second item in a pair of return values.
    - first item in return values is a reference to an array of actual files.
  
  
Index: loncom/interface/loncoursegroups.pm
diff -u loncom/interface/loncoursegroups.pm:1.112 loncom/interface/loncoursegroups.pm:1.113
--- loncom/interface/loncoursegroups.pm:1.112	Wed Sep  8 04:05:32 2010
+++ loncom/interface/loncoursegroups.pm	Sun Oct 23 00:04:51 2011
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursegroups.pm,v 1.112 2010/09/08 04:05:32 raeburn Exp $
+# $Id: loncoursegroups.pm,v 1.113 2011/10/23 00:04:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1547,16 +1547,19 @@
 sub group_files {
     my ($group,$portpath,$numfiles,$numdirs) = @_;
     my $dirptr=16384;
-    my @dir_list=&Apache::portfolio::get_dir_list($portpath,undef,$group);
-    foreach my $line (@dir_list) {
-        my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16);
-        if (($filename !~ /^\.\.?$/) && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/) && ($filename ne 'no_such_dir')) { 
-            if ($dirptr&$testdir) {
-                $portpath .= '/'.$filename;
-                $$numdirs ++;
-                &group_files($group,$portpath,$numfiles,$numdirs)
-            } else {
-                $$numfiles ++;
+    my ($dirlistref,$listerror) = 
+        &Apache::portfolio::get_dir_list($portpath,undef,$group);
+    if (ref($dirlistref) eq 'ARRAY') {
+        foreach my $line (@{$dirlistref}) {
+            my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16);
+            if (($filename !~ /^\.\.?$/) && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/) && ($filename ne 'no_such_dir')) { 
+                if ($dirptr&$testdir) {
+                    $portpath .= '/'.$filename;
+                    $$numdirs ++;
+                    &group_files($group,$portpath,$numfiles,$numdirs)
+                } else {
+                    $$numfiles ++;
+                }
             }
         }
     }




More information about the LON-CAPA-cvs mailing list