if (! isset($config->guestloginbutton)) {
$config->guestloginbutton = 1;
}
+
+ if (empty($focus)) {
+ $focus = "";
+ }
+
$guestoptions[0] = get_string("hide");
$guestoptions[1] = get_string("show");
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");
}
$onsubmit = "onsubmit=\"copyrichtext(theform.text);\"";
} else {
$defaultformat = FORMAT_MOODLE;
+ $onsubmit = "";
}
- if (! $entry ) {
+ if (empty($entry)) {
$entry->text = "";
$entry->format = $defaultformat;
}
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>";