Skip to content

Commit

Permalink
MDL-27896 editor - parent context will be respected by editor in case…
Browse files Browse the repository at this point in the history
… context is not created.
  • Loading branch information
Rajesh Taneja committed Aug 12, 2011
1 parent f9157eb commit dedb69a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions course/edit.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
$course = file_prepare_standard_editor($course, 'summary', $editoroptions, $coursecontext, 'course', 'summary', 0); $course = file_prepare_standard_editor($course, 'summary', $editoroptions, $coursecontext, 'course', 'summary', 0);


} else { } 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); $course = file_prepare_standard_editor($course, 'summary', $editoroptions, null, 'course', 'summary', null);
} }


Expand Down
2 changes: 1 addition & 1 deletion course/editcategory.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
$category->parent = $parent; $category->parent = $parent;
require_capability('moodle/category:manage', $context); require_capability('moodle/category:manage', $context);
$strtitle = get_string("addnewcategory"); $strtitle = get_string("addnewcategory");
$editorcontext = null; $editorcontext = $context;
$title = "$SITE->shortname: ".get_string('addnewcategory'); $title = "$SITE->shortname: ".get_string('addnewcategory');
$fullname = $SITE->fullname; $fullname = $SITE->fullname;
} }
Expand Down
8 changes: 7 additions & 1 deletion user/editadvanced.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@
} else { } else {
$usercontext = null; $usercontext = null;
// This is a new user, we don't want to add files here // 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 //create form
Expand Down

0 comments on commit dedb69a

Please sign in to comment.