From f7639c37a0eaf3bc85ee4fd625731034ec900124 Mon Sep 17 00:00:00 2001 From: scyrma Date: Fri, 22 Aug 2008 05:59:08 +0000 Subject: [PATCH] MDL-13766: adding some documentation for the file listing sent back by a repository plugin --- repository/lib.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/repository/lib.php b/repository/lib.php index a71b084143..2e3a6125f1 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -350,6 +350,35 @@ abstract class repository { /** * Given a path, and perhaps a search, get a list of files. * + * The format of the returned array must be: + * array( + * 'manage' => (string) link to file manager, + * 'dynload' => (bool) use dynamic loading, + * 'nologin' => (bool) requires login, + * 'upload' => array( // upload manager + * 'name' => (string) label of the form element, + * 'id' => (string) id of the form element + * ), + * 'list' => array( + * array( // file + * 'title' => (string) file name, + * 'size' => (int) file size, + * 'date' => (string) file last modification, usually userdate(...), + * 'thumbnail' => (string) path to thumbnail for the file, + * 'source' => (string) path to the file itself + * ), + * array( // subfolder - same as file, but no 'source' + * 'title' => (string) folder name, + * 'size' => 0, + * 'date' => (string) folder last modification, usually userdate(...), + * 'thumbnail' => (string) path to thumbnail for the folder, + * 'children' => array( + * // content of folder, (files or folders) + * ) + * ), + * ) + * ) + * * @param string $parent The parent path, this parameter can * a folder name, or a identification of folder * @param string $search The text will be searched. -- 2.39.5