Commit | Line | Data |
---|---|---|
72b33964 DP |
1 | This files describes API changes in /repository/ repository system, |
2 | information provided here is intended especially for developers. Full | |
3 | details of the repository API are available on Moodle docs: | |
4 | http://docs.moodle.org/dev/Repository_API | |
5 | ||
a76efbca FM |
6 | === 2.6 === |
7 | ||
8 | * get_option() now always return null when the first parameter ($config) is not empty, and | |
9 | no value was found for this $config. Previously this could sometimes return an empty array(). | |
033d1634 | 10 | * The function repository_attach_id() was removed, it was never used and was not useful. |
a76efbca | 11 | |
d7d69396 FM |
12 | === 2.5 === |
13 | ||
14 | * repository::append_suffix() has been deprecated, use repository::get_unused_filename() if you need | |
15 | to get a file name which has not yet been used in the draft area. | |
16 | ||
31581ae6 FM |
17 | * contains_private_data() is a new method to determine if a user 'logged in as' another user |
18 | can access the content of the repository. The default is to return True (no access). | |
19 | ||
20 | * get_typename() returns the type of repository: dropbox, googledocs, etc... | |
21 | ||
89a9d21a FM |
22 | * can_be_edited_by_user() encapsulates all the tests to make sure that the current user |
23 | has the rights to edit the instance of this repository. | |
24 | ||
f6812f57 MG |
25 | * repository::get_instances() (used by filepicker and texteditor to populate the |
26 | list of available repositories) now calls repository constructor specifying the | |
27 | context where repository will be used. | |
28 | When checking permissions inside repository class use: | |
29 | $this->instance->contextid - to find the context where repository was created; | |
30 | $this->context - to find the current context where repository is used. | |
31 | This also means that the same repository instance may now have different names when | |
32 | called from different contexts. | |
33 | Avoid calling repository::get_instance(), use repository::get_repository_by_id() instead. | |
34 | ||
8a641199 FM |
35 | === 2.4 === |
36 | ||
37 | * copy_to_area() can receive a new parameter called $areamaxbytes which controls the maximum | |
38 | size of the area the files will be stored in. | |
39 | ||
40 | * the repositories using the upload() method should implement a check for $areamaxbytes, | |
41 | see repository/upload/lib.php upload() and process_upload() for an example on how handling it. | |
42 | ||
72b33964 DP |
43 | === 2.3 === |
44 | ||
45 | * instance_config_form() must now be declared static for php5.4 compatibility. | |
46 | ||
47 | * get_listing() and search() file metadata details are now now more prominently | |
48 | displayed in the interface. Dates and timestamos are now able to be sorted on in | |
49 | the filepicker interface so plugin authors are asked to ensure: | |
50 | - Dates are defined as UNIX timestamps | |
51 | - Filesize is an integer in bytes | |
52 | ||
53 | * It is recomended to define function get_file_source_info() to provide more rich | |
54 | infromation about the source of a file. | |
55 | ||
56 | * The API was extended to allow repositories can now support external references, please | |
57 | see http://docs.moodle.org/dev/Repository_API for further details. |