]> git.mjollnir.org Git - moodle.git/commitdiff
Little robustness fixes
authormoodler <moodler>
Mon, 30 Dec 2002 15:47:54 +0000 (15:47 +0000)
committermoodler <moodler>
Mon, 30 Dec 2002 15:47:54 +0000 (15:47 +0000)
admin/auth.php
course/teachers.php
mod/journal/edit.php
mod/resource/details.php

index 7d1e2fad9d9083eb1e164e17b59e2d7b483db1e1..5b5e4cfc1089fd07e5d737f1dc6a86830a687234 100644 (file)
     if (! isset($config->guestloginbutton)) {
         $config->guestloginbutton = 1;
     }
+
+    if (empty($focus)) {
+        $focus = "";
+    }
+
     $guestoptions[0] = get_string("hide");
     $guestoptions[1] = get_string("show");
 
index b16b55d88c922be5251a2b7395c057b8a0f890b3..e9b0c5f6b3290a522fdfc426415ec88b1680af06 100644 (file)
@@ -36,8 +36,8 @@
             if (! $teacher = get_record("user_teachers", "course", "$course->id", "userid", "$num")) {
                 error("No such teacher in course $course->shortname with user id $num");
             }
-            $teacher->role = $vals[r];
-            $teacher->authority = $vals[a];
+            $teacher->role = $vals['r'];
+            $teacher->authority = $vals['a'];
             if (!update_record("user_teachers", $teacher)) {
                 error("Could not update teacher entry id = $teacher->id");
             }
index f07189f6bad4d852b6012488b8f528d0d568fac3..9cc792b430658089d21839a710a14365ee320bdb 100644 (file)
         $onsubmit = "onsubmit=\"copyrichtext(theform.text);\"";
     } else {
         $defaultformat = FORMAT_MOODLE;
+        $onsubmit = "";
     }
 
-    if (! $entry ) {
+    if (empty($entry)) {
         $entry->text = "";
         $entry->format = $defaultformat;
     }
index cdc2720f61288a18c4713fd2b55901e94905bed0..36de44678a9eadda110305662c213cc50f2ea4d2 100644 (file)
@@ -34,6 +34,8 @@
 
         if ($usehtmleditor and $form->type == HTML) {
             $onsubmit = "onsubmit=\"copyrichtext(theform.alltext);\"";
+        } else {
+            $onsubmit = "";
         }
         echo "<FORM NAME=theform METHOD=post $onsubmit ACTION=\"$form->destination\">";
         echo "<TABLE CELLPADDING=5 ALIGN=CENTER>";