From: moodler Date: Mon, 30 Dec 2002 06:07:03 +0000 (+0000) Subject: Robustness fixes X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=149f85f0354a234ac38b9ae610b090d7fbbb20f5;p=moodle.git Robustness fixes --- diff --git a/course/edit.html b/course/edit.html index 0edd2db411..dde4e28b48 100644 --- a/course/edit.html +++ b/course/edit.html @@ -4,28 +4,28 @@

: - +

: - +

: - +

: - + @@ -43,7 +43,6 @@ categories, "category", "$form->category", ""); helpbutton("coursecategory", get_string("category")); - formerr($err["category"]); ?> @@ -52,7 +51,6 @@ courseformats, "format", "$form->format", ""); helpbutton("courseformats", get_string("courseformats")); - formerr($err["format"]); ?> @@ -75,7 +73,6 @@ "10" => "10 $newsitems"); choose_from_menu ($options, "newsitems", "$form->newsitems", ""); helpbutton("coursenewsitems", get_string("newsitemsnumber")); - formerr($err["newsitems"]); ?> @@ -84,7 +81,6 @@ startdate); helpbutton("coursestartdate", get_string("startdate")); - formerr($err["startdate"]); ?> @@ -93,9 +89,8 @@ for ($i=1; $i<=52; $i++) { $sectionmenu[$i] = "$i"; } - choose_from_menu ($sectionmenu, "numsections", "$form->numsections"); + choose_from_menu ($sectionmenu, "numsections", "$form->numsections", ""); helpbutton("coursenumsections", get_string("numberweeks")); - formerr($err["numsections"]); ?> @@ -111,25 +106,29 @@

: - () + () +

: - () + () +

: - () + () +

: - () + () + diff --git a/course/edit.php b/course/edit.php index 156dcf7c68..2552dc8bae 100644 --- a/course/edit.php +++ b/course/edit.php @@ -76,7 +76,7 @@ /// Otherwise fill and print the form. - if (!$form) { + if (empty($form)) { if ($course) { $form = $course; } else { @@ -96,6 +96,10 @@ } } + if (empty($focus)) { + $focus = ""; + } + $form->categories = get_records_select_menu("course_categories", "", "name", "id,name"); $form->courseformats = array (