FIxed bug when no courseid

This commit is contained in:
moodler 2003-10-12 17:24:46 +00:00
parent 6d04a477a2
commit 408e62f865

View File

@ -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\"";