mirror of
https://github.com/moodle/moodle.git
synced 2025-03-21 08:00:37 +01:00
Merge branch 'MDL-72054' of git://github.com/danmarsden/moodle
This commit is contained in:
commit
1a7f8e7eed
@ -6125,7 +6125,8 @@ class assign {
|
||||
public function render_area_files($component, $area, $submissionid) {
|
||||
global $USER;
|
||||
|
||||
return $this->get_renderer()->assign_files($this->context, $submissionid, $area, $component);
|
||||
return $this->get_renderer()->assign_files($this->context, $submissionid, $area, $component,
|
||||
$this->course, $this->coursemodule);
|
||||
|
||||
}
|
||||
|
||||
|
@ -891,11 +891,16 @@ class assign_files implements renderable {
|
||||
* @param int $sid
|
||||
* @param string $filearea
|
||||
* @param string $component
|
||||
* @param stdClass $course
|
||||
* @param stdClass $cm
|
||||
*/
|
||||
public function __construct(context $context, $sid, $filearea, $component) {
|
||||
public function __construct(context $context, $sid, $filearea, $component, $course = null, $cm = null) {
|
||||
global $CFG;
|
||||
if (empty($course) || empty($cm)) {
|
||||
list($context, $course, $cm) = get_context_info_array($context->id);
|
||||
}
|
||||
|
||||
$this->context = $context;
|
||||
list($context, $course, $cm) = get_context_info_array($context->id);
|
||||
$this->cm = $cm;
|
||||
$this->course = $course;
|
||||
$fs = get_file_storage();
|
||||
|
@ -44,10 +44,12 @@ class mod_assign_renderer extends plugin_renderer_base {
|
||||
* @param int $userid
|
||||
* @param string $filearea
|
||||
* @param string $component
|
||||
* @param stdClass $course
|
||||
* @param stdClass $coursemodule
|
||||
* @return string
|
||||
*/
|
||||
public function assign_files(context $context, $userid, $filearea, $component) {
|
||||
return $this->render(new assign_files($context, $userid, $filearea, $component));
|
||||
public function assign_files(context $context, $userid, $filearea, $component, $course = null, $coursemodule = null) {
|
||||
return $this->render(new assign_files($context, $userid, $filearea, $component, $course, $coursemodule));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user