mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
portfolio MDL-24251 make sure $PAGE context is set up properly
This commit is contained in:
parent
adfc4d7c25
commit
90636e2b41
3 changed files with 20 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue