fixed print_texarea() capability requirement

This commit is contained in:
skodak 2006-10-02 19:47:11 +00:00
parent 3055079518
commit a44de9c12f

View file

@ -3566,8 +3566,8 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
} }
if ($usehtmleditor) { if ($usehtmleditor) {
// not sure if this capability is appropriate if (!empty($courseid) and has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $courseid))) {
if (!empty($courseid) and has_capability('moodle/course:trustcontent', get_context_instance(CONTEXT_COURSE, $courseid))) { // needed for course file area browsing in image insert plugin
$str .= ($scriptcount < 1) ? '<script type="text/javascript" src="'. $str .= ($scriptcount < 1) ? '<script type="text/javascript" src="'.
$CFG->wwwroot .'/lib/editor/htmlarea/htmlarea.php?id='. $courseid .'"></script>'."\n" : ''; $CFG->wwwroot .'/lib/editor/htmlarea/htmlarea.php?id='. $courseid .'"></script>'."\n" : '';
} else { } else {