mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-55289 workshop: Include repository/lib.php to use its constants
As a result of MDL-41556 (146893d6), the repository/lib.php was included in submission.php so that its constant FILE_INTERNAL could be used in field options. Recent development in MDL-50794 (996f7e8) moved the options declaration to standalone methods but we forgot to check they work in exsubmission.php too. This patch moves the repository/lib.php inclusion to where the library is actually needed. Additionally it unifies how options are set for overall feedback content and overall feedback attachment fields.
This commit is contained in:
parent
d1a3ea62ef
commit
21d49a3f93
@ -2486,6 +2486,9 @@ class workshop {
|
||||
* @return array
|
||||
*/
|
||||
public function submission_content_options() {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot.'/repository/lib.php');
|
||||
|
||||
return array(
|
||||
'trusttext' => true,
|
||||
'subdirs' => false,
|
||||
@ -2502,6 +2505,8 @@ class workshop {
|
||||
* @return array
|
||||
*/
|
||||
public function submission_attachment_options() {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot.'/repository/lib.php');
|
||||
|
||||
$options = array(
|
||||
'subdirs' => true,
|
||||
@ -2523,12 +2528,16 @@ class workshop {
|
||||
* @return array
|
||||
*/
|
||||
public function overall_feedback_content_options() {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot.'/repository/lib.php');
|
||||
|
||||
return array(
|
||||
'subdirs' => 0,
|
||||
'maxbytes' => $this->overallfeedbackmaxbytes,
|
||||
'maxfiles' => $this->overallfeedbackfiles,
|
||||
'changeformat' => 1,
|
||||
'context' => $this->context,
|
||||
'return_types' => FILE_INTERNAL,
|
||||
);
|
||||
}
|
||||
|
||||
@ -2538,6 +2547,8 @@ class workshop {
|
||||
* @return array
|
||||
*/
|
||||
public function overall_feedback_attachment_options() {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot.'/repository/lib.php');
|
||||
|
||||
$options = array(
|
||||
'subdirs' => 1,
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
require(__DIR__.'/../../config.php');
|
||||
require_once(__DIR__.'/locallib.php');
|
||||
require_once($CFG->dirroot . '/repository/lib.php');
|
||||
|
||||
$cmid = required_param('cmid', PARAM_INT); // Course module id.
|
||||
$id = optional_param('id', 0, PARAM_INT); // Submission id.
|
||||
|
Loading…
x
Reference in New Issue
Block a user