mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
FIxed bug when no courseid
This commit is contained in:
parent
6d04a477a2
commit
408e62f865
@ -1226,19 +1226,16 @@ function print_textarea($richedit, $rows, $cols, $width, $height, $name, $value=
|
||||
/// Prints a richtext field or a normal textarea
|
||||
global $CFG, $THEME, $course;
|
||||
|
||||
if (!$courseid) {
|
||||
if (empty($courseid)) {
|
||||
if (!empty($course->id)) { // search for it in global context
|
||||
$courseid = $course->id;
|
||||
}
|
||||
}
|
||||
|
||||
if ($richedit) {
|
||||
if ($courseid) {
|
||||
if (isteacher($courseid)) {
|
||||
$richediturl = "$CFG->wwwroot/lib/rte/richedit.php?id=$courseid&wwwroot=$CFG->wwwroot";
|
||||
} else {
|
||||
$richediturl = "$CFG->wwwroot/lib/rte/richedit.html";
|
||||
}
|
||||
$richediturl = "$CFG->wwwroot/lib/rte/richedit.html";
|
||||
if (!empty($courseid) and isteacher($courseid)) {
|
||||
$richediturl = "$CFG->wwwroot/lib/rte/richedit.php?id=$courseid&wwwroot=$CFG->wwwroot";
|
||||
}
|
||||
|
||||
echo "<object id=\"richedit\" style=\"background-color: buttonface\"";
|
||||
|
Loading…
x
Reference in New Issue
Block a user