Skip to content
Browse files

MDL-27896 editor - parent context will be respected by editor in case…

… context is not created.
  • Loading branch information...
1 parent 1449e4f commit 56d57a9a4ecc9655e312d9f16eca2b86256b93c0 Rajesh Taneja committed Jul 28, 2011
Showing with 10 additions and 2 deletions.
  1. +2 −0 course/edit.php
  2. +1 −1 course/editcategory.php
  3. +7 −1 user/editadvanced.php
View
2 course/edit.php
@@ -82,6 +82,8 @@
$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);
}
View
2 course/editcategory.php
@@ -42,7 +42,7 @@
$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;
}
View
8 user/editadvanced.php
@@ -125,7 +125,13 @@
} 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

0 comments on commit 56d57a9

Please sign in to comment.
Something went wrong with that request. Please try again.