Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-13766 META: Develop new Repository API
  3. MDL-20602

Add full support for FILE_INTERNAL and FILE_EXTERNAL to all repositories

    XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.0
    • 2.0
    • Repositories
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

    Description

      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.

      Attachments

        Activity

          People

            dongsheng Dongsheng Cai
            dougiamas Martin Dougiamas
            Nobody Nobody
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24/Nov/10