Issue Details (XML | Word | Printable)

Key: MDL-16127
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Penny Leach
Reporter: Penny Leach
Votes: 0
Watchers: 0
Operations

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

make supported_formats smarter in the caller

Created: 19/Aug/08 08:23 PM   Updated: 20/Aug/08 09:33 PM
Component/s: Portfolio API
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Penny Leach
Security Level: None
Resolved date: 20/Aug/08
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
After a brainstorming session with Nico, who is fast becoming number 2 portfolio api ninja, we thought the following was the best approach:
  • change supported_formats in the caller to always be called statically and accept the caller object optionally. This means it can essentially support static and not static calls, by the implementer testing for empty($caller) rather than having to do isset($this) && $this instanceof whateverclass (which I thought was too hard for implementers to have to worry about)
  • allow an extra argument to portfolio_add_button - so that if the calling code knows better than the static function in the caller class does about what formats are going to be allowed (eg if it knows a file is an image) it can override it.

I'm going to sit on this for a little bit in case I have any further ideas, but that's the current plan.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Penny Leach added a comment - 20/Aug/08 09:33 PM
committed to head. example in forum attachments that are images.