mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-16360 - added support for mime-style subformat detection for portfolio supported formats
works well with flickr plugin (tested by uploading an image as a forum attachment and being offered flickr plugin but not for normal attachments)
This commit is contained in:
parent
0b46f19e89
commit
ea0de12f10
10 changed files with 135 additions and 16 deletions
|
@ -7209,9 +7209,7 @@ class forum_portfolio_caller extends portfolio_module_caller_base {
|
|||
throw new portfolio_caller_exception('noattachments', 'forum');
|
||||
}
|
||||
$this->postfiles = array($f);
|
||||
if (in_array($f->get_mimetype(), array('image/gif', 'image/jpeg', 'image/png'))) {
|
||||
$this->supportedformats = array(PORTFOLIO_FORMAT_IMAGE);
|
||||
}
|
||||
$this->supportedformats = array(portfolio_format_from_file($f));
|
||||
} elseif ($this->post) {
|
||||
$this->postfiles = $fs->get_area_files(get_context_instance(CONTEXT_MODULE, $this->cm->id)->id, 'forum_attachment', $this->post->id, "timemodified", false);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue