]> git.mjollnir.org Git - moodle.git/commitdiff
FIxed bug when no courseid
authormoodler <moodler>
Sun, 12 Oct 2003 17:24:46 +0000 (17:24 +0000)
committermoodler <moodler>
Sun, 12 Oct 2003 17:24:46 +0000 (17:24 +0000)
lib/weblib.php

index 4976b4cd73ccbb84fdebfd7e2ba4eb221fedc579..3b7fcbb31c94495521f2f77b060a84e85d4a8e57 100644 (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\"";