$this->resourcefile = $CFG->dirroot.'/mod/resource/type/'.$this->cm->type.'/resource.class.php';
require_once($this->resourcefile);
$this->resource= new $resourceclass($this->cm->id);
- if (!is_callable(array($resource, 'portfolio_prepare_package')) || !is_callable(array($resource, 'portfolio_get_sha1'))) {
+ if (!is_callable(array($this->resource, 'portfolio_prepare_package')) || !is_callable(array($this->resource, 'portfolio_get_sha1'))) {
throw new portfolio_exception('portfolionotimplemented', 'resource', null, $this->cm->type);
}
$this->supportedformats = array(self::type_to_format($this->cm->type));
debugging(get_string('portfolionotimplemented', 'resource'));
return false;
}
- $callersupports = array(self::type_to_format($resource->cm->type));
- if ($resource->cm->type == 'file') {
+ $callersupports = array(self::type_to_format($resource->resource->type));
+ if ($resource->resource->type == 'file') {
// $callersupports = array(portfolio_format_from_file($file);
}
$button = new portfolio_add_button();