]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-18886, use array index to get files tree children"
authordongsheng <dongsheng>
Fri, 17 Apr 2009 08:00:59 +0000 (08:00 +0000)
committerdongsheng <dongsheng>
Fri, 17 Apr 2009 08:00:59 +0000 (08:00 +0000)
repository/lib.php

index fb42937db42048a523b03b8f96ea07201b2008c4..2181ed98bfdb8580982d5e62e1204a64de67435c 100644 (file)
@@ -829,7 +829,7 @@ abstract class repository {
     }
 
     /**
-     * Return the user arborescence in a format to be returned by the function get_listing
+     * Return the user files tree in a format to be returned by the function get_listing
      * @global <type> $CFG
      * @param <type> $search
      * @return <type>
@@ -1486,10 +1486,11 @@ abstract class repository {
         $accepted_types = optional_param('accepted_types', '', PARAM_RAW);
         $ft = new file_type_to_ext;
         $ext = $ft->get_file_ext($this->supported_filetypes());
-        if (isset($value->children)) {
+        if (isset($value['children'])) {
             $pass = true;
-            if (!empty($value->children)) {
-                $value->children = array_filter($value->children, array($this, 'filter'));
+            if (!empty($value['children'])) {
+                echo_fb($value);
+                $value['children'] = array_filter($value['children'], array($this, 'filter'));
             }
         } else {
             if ($accepted_types == '*' or empty($accepted_types)