From: moodler Date: Sun, 22 Dec 2002 06:45:09 +0000 (+0000) Subject: More little fixups for week 0 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=19801b2b21e39c1f4bbd15a5e5f65c1a46a67690;p=moodle.git More little fixups for week 0 --- diff --git a/course/topics.php b/course/topics.php index a750785d9a..ce65a11d19 100644 --- a/course/topics.php +++ b/course/topics.php @@ -8,15 +8,6 @@ include_once("$CFG->dirroot/mod/forum/lib.php"); - if (! $sections = get_all_sections($course->id) ) { - $section->course = $course->id; // Create a default section. - $section->section = 0; - $section->id = insert_record("course_sections", $section); - if (! $sections = get_all_sections($course->id) ) { - error("Error finding or creating section structures for this course"); - } - } - if (isset($topic)) { if ($topic == "all") { unset($USER->topic); diff --git a/course/view.php b/course/view.php index 7c3dac1ce8..fec827355f 100644 --- a/course/view.php +++ b/course/view.php @@ -54,7 +54,15 @@ update_course_icon($course->id)); get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused, $modsectioncounts); - $sections = get_all_sections($course->id); + + if (! $sections = get_all_sections($course->id)) { + $section->course = $course->id; // Create a default section. + $section->section = 0; + $section->id = insert_record("course_sections", $section); + if (! $sections = get_all_sections($course->id) ) { + error("Error finding or creating section structures for this course"); + } + } switch ($course->format) { case "weeks": diff --git a/course/weeks.php b/course/weeks.php index 1c713474a9..e0abd4ec5d 100644 --- a/course/weeks.php +++ b/course/weeks.php @@ -4,14 +4,6 @@ include_once("$CFG->dirroot/mod/forum/lib.php"); - if (! $sections = get_all_sections($course->id)) { - $section->course = $course->id; // Create a default section. - $section->section = 0; - $section->id = insert_record("course_sections", $section); - if (! $sections = get_all_sections($course->id) ) { - error("Error finding or creating section structures for this course"); - } - } if (isset($week)) { if ($week == "all") {