Expected File Areas

Expected File Areas

by Dave Emsley -
Number of replies: 1

In the Moodle FileAPI (http://docs.moodle.org/dev/File_API) there is a line of code:

 if ($filearea !== 'expectedfilearea' && $filearea !== 'anotherexpectedfilearea') {

I suspect these are not as literal as they appear and they should be substituted.   But to what?  I can find no additional reference to them.  If someone could provide a reference I'd be very grateful.

 

Cheers

 

Dave

 

 

Average of ratings: -
In reply to Dave Emsley

Re: Expected File Areas

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It is up to your own plugin to decide what to call the filearea(s) that you create.

This is just a check to make sure that the name of the filearea in the URL matches one of the fileareas that you are using.

For example, mod_forum, defines fileareas called 'attachment' (for files attached to a post, via the 'attachment' box) and 'post' (for files embedded within the text editor for the post).

 

Average of ratings: Useful (1)