Little robustness fixes

This commit is contained in:
moodler
2002-12-30 15:47:54 +00:00
parent 814ada432c
commit 5eda92d0e2
4 changed files with 11 additions and 3 deletions
+5
View File
@@ -59,6 +59,11 @@
if (! isset($config->guestloginbutton)) {
$config->guestloginbutton = 1;
}
if (empty($focus)) {
$focus = "";
}
$guestoptions[0] = get_string("hide");
$guestoptions[1] = get_string("show");
+2 -2
View 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");
}
+2 -1
View File
@@ -69,9 +69,10 @@
$onsubmit = "onsubmit=\"copyrichtext(theform.text);\"";
} else {
$defaultformat = FORMAT_MOODLE;
$onsubmit = "";
}
if (! $entry ) {
if (empty($entry)) {
$entry->text = "";
$entry->format = $defaultformat;
}
+2
View 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>";