From 9e6b608fcb1ce2a103424920f4665530db0ac42d Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Fri, 20 Nov 2009 07:21:42 +0000 Subject: [PATCH] assignment MDL-15904 Tidied up unused globals and removed reliance on $PAGE->course->maxbytes --- mod/assignment/type/online/assignment.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mod/assignment/type/online/assignment.class.php b/mod/assignment/type/online/assignment.class.php index 0ca09349d89..f358694d00a 100644 --- a/mod/assignment/type/online/assignment.class.php +++ b/mod/assignment/type/online/assignment.class.php @@ -45,6 +45,7 @@ class assignment_online extends assignment_base { $mformdata = new stdClass; $mformdata->assignmentid = $this->assignment->id; $mformdata->context = $this->context; + $mformdata->maxbytes = $this->course->maxbytes; $mform = new mod_assignment_online_edit_form(null, $mformdata); $defaults = new object(); @@ -348,7 +349,6 @@ class assignment_online extends assignment_base { class mod_assignment_online_edit_form extends moodleform { public function set_data($data) { - global $PAGE; $editoroptions = $this->get_editor_options(); if (!isset($data->text)) { $data->text = ''; @@ -363,7 +363,6 @@ class mod_assignment_online_edit_form extends moodleform { } public function get_data() { - global $PAGE; $data = parent::get_data(); if ($data) { $editoroptions = $this->get_editor_options(); @@ -391,12 +390,11 @@ class mod_assignment_online_edit_form extends moodleform { } protected function get_editor_options() { - global $PAGE; $editoroptions = array(); $editoroptions['filearea'] = 'assignment_online_submission'; $editoroptions['noclean'] = false; $editoroptions['maxfiles'] = EDITOR_UNLIMITED_FILES; - $editoroptions['maxbytes'] = $PAGE->course->maxbytes; + $editoroptions['maxbytes'] = $this->_customdata->maxbytes; return $editoroptions; } }