Issue Details (XML | Word | Printable)

Key: MDL-20602
Type: Sub-task Sub-task
Status: Open Open
Priority: Blocker Blocker
Assignee: Dongsheng Cai
Reporter: Martin Dougiamas
Votes: 1
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-13766

Add full support for FILE_INTERNAL and FILE_EXTERNAL to all repositories

Created: 20/Oct/09 03:46 PM   Updated: 21/Oct/09 03:45 PM
Return to search
Component/s: Repository API
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Dongsheng Cai and Martin Dougiamas
Security Level: None
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
The way repositories are selected is a combination of
    - what file types they support (mimetypes)
    - what format the calling field expects

The second of these breaks into two main formats:
   - FILE_INTERNAL (a Moodle file object with ID, local url etc)
   - FILE_EXTERNAL (a url to somewhere outside of Moodle)

There are three different combinations of these used in Moodle:

A) The image and media dialogs in the editor require either FILE_INTERNAL (specifically the URL) or FILE_EXTERNAL
B) The filemanager form element requires only FILE_INTERNAL
C) The URL resource module requires only FILE_EXTERNAL

If we pass this requirement to the filepicker, then we can

1) Hide repository instances that don't support the required format
2) If local and external URLs are allowed (A), and the module supports external URLs, then add a checkbox to the last screen to return an external URL (no copying into File API)
3) If External URLs are required (C), then hide that checkbox option and proceed as if it was selected.

The settings can be implemented in each repository class by:
 - A function like support_return_value() that returns one or more supported values
 - A function like get_file() that does the correct actions and returns the right data.


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Dongsheng Cai committed 22 files to 'Moodle CVS' - 02/Nov/09 02:45 PM
"MDL-20602, add support for FILE_INTERNAL and FILE_EXTERNAL"
MODIFY repository/webdav/repository.class.php   Rev. 1.14    (+3 -0 lines)
MODIFY repository/wikimedia/repository.class.php   Rev. 1.8    (+3 -0 lines)
ADD repository/repository_ajax.php   Rev. 1.1    (+0 -0 lines)
MODIFY repository/boxnet/repository.class.php   Rev. 1.73    (+3 -0 lines)
MODIFY repository/draft/repository.class.php   Rev. 1.8    (+4 -1 lines)
MODIFY repository/repository.src.js   Rev. 1.34    (+47 -30 lines)
MODIFY repository/picasa/repository.class.php   Rev. 1.8    (+3 -0 lines)
MODIFY repository/url/repository.class.php   Rev. 1.11    (+3 -0 lines)
MODIFY repository/remotemoodle/repository.class.php   Rev. 1.21    (+3 -0 lines)
MODIFY repository/lib.php   Rev. 1.203    (+30 -37 lines)
MODIFY repository/flickr_public/image.php   Rev. 1.3    (+1 -7 lines)
MODIFY repository/mahara/repository.class.php   Rev. 1.13    (+3 -0 lines)
MODIFY repository/filesystem/repository.class.php   Rev. 1.18    (+3 -0 lines)
MODIFY repository/local/repository.class.php   Rev. 1.42    (+4 -1 lines)
MODIFY repository/alfresco/repository.class.php   Rev. 1.22    (+3 -0 lines)
MODIFY repository/s3/repository.class.php   Rev. 1.13    (+3 -0 lines)
DEL repository/Attic/ws.php   Rev. 1.72    (+0 -0 lines)
MODIFY repository/upload/repository.class.php   Rev. 1.18    (+3 -0 lines)
MODIFY repository/youtube/repository.class.php   Rev. 1.15    (+3 -6 lines)
MODIFY repository/flickr_public/repository.class.php   Rev. 1.49    (+9 -2 lines)
MODIFY repository/flickr/repository.class.php   Rev. 1.64    (+3 -0 lines)
MODIFY repository/googledocs/repository.class.php   Rev. 1.7    (+7 -4 lines)
Dongsheng Cai committed 7 files to 'Moodle CVS' - 02/Nov/09 03:18 PM
"MDL-20602, support FILE_INTERNAL and FILE_EXTERNAL in moodle form elements"
MODIFY lib/form/filemanager.php   Rev. 1.41    (+2 -2 lines)
DEL lib/form/Attic/texturl.php   Rev. 1.3    (+0 -0 lines)
MODIFY lib/form/url.php   Rev. 1.4    (+1 -1 lines)
MODIFY lib/form/editor.php   Rev. 1.27    (+1 -1 lines)
DEL lib/form/Attic/texturl.js   Rev. 1.2    (+0 -0 lines)
MODIFY lib/form/url.js   Rev. 1.2    (+1 -1 lines)
MODIFY lib/form/filepicker.php   Rev. 1.38    (+2 -2 lines)
Dongsheng Cai committed 7 files to 'Moodle CVS' - 08/Nov/09 09:20 PM
"MDL-20602, added link external option in file picker"
MODIFY repository/flickr/repository.class.php   Rev. 1.67    (+14 -0 lines)
MODIFY admin/settings/plugins.php   Rev. 1.53    (+1 -1 lines)
MODIFY repository/flickr_public/repository.class.php   Rev. 1.50    (+16 -1 lines)
MODIFY repository/repository_ajax.php   Rev. 1.4    (+22 -9 lines)
MODIFY repository/repository.src.js   Rev. 1.36    (+14 -6 lines)
MODIFY repository/lib.php   Rev. 1.206    (+22 -4 lines)
MODIFY lang/en_utf8/repository.php   Rev. 1.68    (+4 -3 lines)