mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-14589 fixed area tree generation
This commit is contained in:
parent
65635c0144
commit
3b6076788d
@ -234,6 +234,9 @@ class file_storage {
|
||||
$parts = explode('/', trim($dir->get_filepath(),'/'));
|
||||
$pointer =& $result;
|
||||
foreach ($parts as $part) {
|
||||
if ($part === '') {
|
||||
continue;
|
||||
}
|
||||
if (!isset($pointer['subdirs'][$part])) {
|
||||
$pointer['subdirs'][$part] = array('dirname'=>$part, 'dirfile'=>null, 'subdirs'=>array(), 'files'=>array());
|
||||
}
|
||||
@ -246,6 +249,9 @@ class file_storage {
|
||||
$parts = explode('/', trim($file->get_filepath(),'/'));
|
||||
$pointer =& $result;
|
||||
foreach ($parts as $part) {
|
||||
if ($part === '') {
|
||||
continue;
|
||||
}
|
||||
$pointer =& $pointer['subdirs'][$part];
|
||||
}
|
||||
$pointer['files'][$file->get_filename()] = $file;
|
||||
|
Loading…
x
Reference in New Issue
Block a user