From 78d4711ebb5930d2942835029b2fff9de1fcca17 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 8 Oct 2006 19:45:29 +0000 Subject: [PATCH] fixed data/index.php when no databases available, initialized array in get_all_instances_in_course() from datalib.php; merged from MOODLE_16_STABLE --- lib/datalib.php | 2 ++ mod/data/index.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/datalib.php b/lib/datalib.php index 634e75b9ea..4e3f12f799 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1188,6 +1188,8 @@ function get_all_instances_in_course($modulename, $course) { $invisible = 0; } + $outputarray = array(); + foreach ($modinfo as $mod) { if ($mod->mod == $modulename and $mod->visible > $invisible) { $instance = $rawmods[$mod->cm]; diff --git a/mod/data/index.php b/mod/data/index.php index 1880e0e5ea..ecf4ed133a 100755 --- a/mod/data/index.php +++ b/mod/data/index.php @@ -39,13 +39,13 @@ $strtopic = get_string('topic'); $strname = get_string('name'); $strdata = get_string('modulename','data'); + + print_header_simple($strdata, '', $strdata, '', '', true, "", navmenu($course)); if (! $datas = get_all_instances_in_course("data", $course)) { notice("There are no databases", "$CFG->wwwroot/course/view.php?id=$course->id"); } - print_header_simple($strdata, '', $strdata, '', '', true, "", navmenu($course)); - $timenow = time(); $strname = get_string('name'); $strweek = get_string('week'); -- 2.39.5