portfolio MDL-24251 make sure $PAGE context is set up properly

This commit is contained in:
Penny Leach 2010-09-17 09:39:56 +00:00
parent adfc4d7c25
commit 90636e2b41
3 changed files with 20 additions and 9 deletions

View file

@ -477,6 +477,13 @@ abstract class portfolio_caller_base {
*/
public static abstract function expected_callbackargs();
/**
* return the context for this export. used for $PAGE->set_context
*
* @return stdclass
*/
public abstract function set_context($PAGE);
}
/**
@ -551,4 +558,11 @@ abstract class portfolio_module_caller_base extends portfolio_caller_base {
public function heading_summary() {
return get_string('exportingcontentfrom', 'portfolio', $this->display_name() . ': ' . $this->cm->name);
}
/**
* overridden to return the course module context
*/
public function set_context($PAGE) {
$PAGE->set_cm($this->cm);
}
}