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

    • Type: Sub-task
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Repositories
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      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

            • Assignee:
              dongsheng Dongsheng Cai
              Reporter:
              dougiamas Martin Dougiamas
              Tester:
              Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Mihail Geshoski, Peter Dias
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10