MDL-27896 editor - parent context will be respected by editor in case context is not created.

This commit is contained in:
Rajesh Taneja
2011-08-12 16:49:05 +08:00
parent 1449e4faa2
commit 56d57a9a4e
3 changed files with 10 additions and 2 deletions
+2
View File
@@ -82,6 +82,8 @@ if (!empty($course)) {
$course = file_prepare_standard_editor($course, 'summary', $editoroptions, $coursecontext, 'course', 'summary', 0);
} else {
//editor should respect category context if course context is not set.
$editoroptions['context'] = $catcontext;
$course = file_prepare_standard_editor($course, 'summary', $editoroptions, null, 'course', 'summary', null);
}
+1 -1
View File
@@ -42,7 +42,7 @@ if ($id) {
$category->parent = $parent;
require_capability('moodle/category:manage', $context);
$strtitle = get_string("addnewcategory");
$editorcontext = null;
$editorcontext = $context;
$title = "$SITE->shortname: ".get_string('addnewcategory');
$fullname = $SITE->fullname;
}
+7 -1
View File
@@ -125,7 +125,13 @@ if ($user->id !== -1) {
} else {
$usercontext = null;
// This is a new user, we don't want to add files here
$editoroptions = array('maxfiles'=>0, 'maxbytes'=>0, 'trusttext'=>false, 'forcehttps'=>false);
$editoroptions = array(
'maxfiles'=>0,
'maxbytes'=>0,
'trusttext'=>false,
'forcehttps'=>false,
'context' => $coursecontext
);
}
//create form