$string['parameters'] = 'Parameters';
$string['popupresource'] = 'This resource should appear in a popup window.';
$string['popupresourcelink'] = 'If it didn\'t, click here: $a';
-$string['portfolionotimplemented'] = 'You are trying to export content from a resource type that doesn\'t support it!';
+$string['portfolionotimplemented'] = 'You are trying to export content from a resource type ($a) that doesn\'t support it!';
$string['preview'] = 'Preview';
$string['previous'] = 'Previous';
$string['redeploy'] = 'Deploy again';
$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'))) {
+ throw new portfolio_exception('portfolionotimplemented', 'resource', null, $this->cm->type);
+ }
$this->supportedformats = array(self::type_to_format($this->cm->type));
}
$first_module = reset($this->modules);
$cm = get_coursemodule_from_instance($this->module_type, $first_module->id);
- $this->caller = parent::setup_caller('resource_portfolio_caller', array('id' => $cm->id));
+ $this->caller = parent::setup_caller('resource_portfolio_caller', array('id' => $cm->instance));
}
public function tearDown() {