* this is whole string, not key. optional, defaults to 'Add to portfolio';
*/
public function to_html($format=null, $addstr=null) {
- global $CFG, $COURSE, $OUTPUT;
+ global $CFG, $COURSE, $OUTPUT, $USER;
if (!$this->is_renderable()) {
return;
}
$formats = portfolio_supported_formats_intersect($this->formats, $instance->supported_formats());
if (count($formats) == 0) {
// bail. no common formats.
- debugging(get_string('nocommonformats', 'portfolio', $this->callbackclass));
+ debugging(get_string('nocommonformats', 'portfolio', (object)array('location' => $this->callbackclass, 'formats' => implode(',', $this->formats))));
return;
}
if ($error = portfolio_instance_sanity_check($instance)) {
}
if ($this->file && $this->file instanceof stored_file && !$instance->file_mime_check($this->file->get_mimetype())) {
// bail, we have a specific file and this plugin doesn't support it
+ debugging(get_string('mimecheckfail', 'portfolio', (object)array('plugin' => $instance->get('plugin'), 'mimetype' => $this->file->get_mimetype())));
return;
}
$formoutput .= "\n" . '<input type="hidden" name="instance" value="' . $instance->get('id') . '" />';
continue;
}
if ($file && $file instanceof stored_file && !$instance->file_mime_check($file->get_mimetype())) {
+ debugging(get_string('mimecheckfail', 'portfolio', (object)array('plugin' => $instance->get('plugin'), 'mimetype' => $this->file->get_mimetype())));
// bail, we have a specific file and this plugin doesn't support it
continue;
}
}
if (empty($count)) {
// bail. no common formats.
- debugging(get_string('nocommonformats', 'portfolio', $callbackclass));
+ debugging(get_string('nocommonformats', 'portfolio', (object)array('location' => $callbackclass, 'formats' => implode(',', $callerformats))));
return;
}
$selectoutput .= "\n" . "</select>\n";