diff --git a/repository/user/lib.php b/repository/user/lib.php index 25e62f0..66c8c5c 100755 --- a/repository/user/lib.php +++ b/repository/user/lib.php @@ -52,7 +52,7 @@ class repository_user extends repository { if (!empty($encodedpath)) { $params = unserialize(base64_decode($encodedpath)); if (is_array($params)) { - $filepath = clean_param($params['filepath'], PARAM_PATH);; + $filepath = clean_param($params['filepath'], PARAM_PATH); $filename = clean_param($params['filename'], PARAM_FILE); } } else { @@ -94,6 +94,16 @@ class repository_user extends repository { 'thumbnail' => $OUTPUT->pix_url('f/folder-32')->out(false) ); $list[] = $node; + } else if (preg_match('/\.png$/', $child->get_visible_name())) { + $encodedpath = base64_encode(serialize($child->get_params())); + $node = array( + 'title' => $child->get_visible_name(), + 'size' => 0, + 'date' => '', + 'source'=> $encodedpath, + 'thumbnail' => $CFG->wwwroot . '/pluginfile.php/' . $context->id . '/user/private/' . $child->get_visible_name(), + ); + $list[] = $node; } else { $encodedpath = base64_encode(serialize($child->get_params())); $node = array(