Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-33640

Add ability to use custom filepicker templates

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.3.1
    • Fix Version/s: 2.3.2
    • Component/s: Filepicker, Repositories
    • Labels:
    • Testing Instructions:
      Hide
      • Install MDL-33640_full branch of Record Audio repository (https://github.com/MaxThrax/moodle-repository_recordaudio/tree/MDL-33640_full) - this branch contains a partial rewrite which utilises the proper template support added by this enhancement
      • Enable Record Audio repository
      • In a file picker, click the "Add..." button and make sure that the standard "Upload a file" repository appears correctly and functions as expected
      • In a file picker, click the "Add..." button and make sure that the "Record Audio" repository appears correctly (Author and License fields, followed by "Make a Recording" with the Flash recording widget) and functions as expected

      Note: Flash Player 10.1 or above is required for the "Record Audio" repository. No streaming server is required.

      Show
      Install MDL-33640 _full branch of Record Audio repository ( https://github.com/MaxThrax/moodle-repository_recordaudio/tree/MDL-33640_full ) - this branch contains a partial rewrite which utilises the proper template support added by this enhancement Enable Record Audio repository In a file picker, click the "Add..." button and make sure that the standard "Upload a file" repository appears correctly and functions as expected In a file picker, click the "Add..." button and make sure that the "Record Audio" repository appears correctly (Author and License fields, followed by "Make a Recording" with the Flash recording widget) and functions as expected Note: Flash Player 10.1 or above is required for the "Record Audio" repository. No streaming server is required.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-33640_master

      Description

      It's currently possible to create and register a custom filepicker template, but none of the print/create methods that can be called by display_response have the ability to use custom templates. It would be very useful if there was a way to specify another attribute in the return value from the repository subclass which overrode this - my current workaround (for my audio recording repository plugin - https://github.com/MaxThrax/moodle-repository_recordaudio) is to override the "uploadform" template with a custom one which adds my extra code with a CSS file that simply hides it for anything but my repository, but it's not the nicest approach and isn't extensible (as it stands, if somebody else wanted to do the same thing, their repository and mine would not be entirely compatible unless both included code from each other).

      For the record, I chose not to use the text/html object approach used in the Equella repository as my plugin piggybacks on the standard upload method - so the easiest approach seems to be to piggyback on the standard upload form. I can imagine other plugins wanting to do similar things, so it seems like the best solution would be to make it easy to use a custom template (perhaps even make it easier to register custom templates) in the create_upload_form function, even if the other print/create functions don't get this ability just yet (I can see it potentially being useful for print_login too, but I don't personally have a use for it at present).

      Please feel free to ask for more details, and to take a look at my repository plugin to see my workaround. I may take a while to reply, as I'm about to head overseas for the rest of the month - but I'll try to check my email at least every couple of days.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Sep/12