From: moodler Date: Sun, 26 Oct 2003 08:14:54 +0000 (+0000) Subject: In the index, show how many entries there are in each glossary X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=94e935e7d158b245fee556ffe2883e3543ea9927;p=moodle.git In the index, show how many entries there are in each glossary --- diff --git a/mod/glossary/index.php b/mod/glossary/index.php index 8bfc3d0852..c85fa8deaf 100644 --- a/mod/glossary/index.php +++ b/mod/glossary/index.php @@ -44,16 +44,17 @@ $strname = get_string("name"); $strweek = get_string("week"); $strtopic = get_string("topic"); + $strentries = get_string("entries", "glossary"); if ($course->format == "weeks") { - $table->head = array ($strweek, $strname); - $table->align = array ("CENTER", "LEFT"); + $table->head = array ($strweek, $strname, $strentries); + $table->align = array ("CENTER", "LEFT", "CENTER"); } else if ($course->format == "topics") { - $table->head = array ($strtopic, $strname); - $table->align = array ("CENTER", "LEFT", "LEFT", "LEFT"); + $table->head = array ($strtopic, $strname, $strentries); + $table->align = array ("CENTER", "LEFT", "CENTER"); } else { - $table->head = array ($strname); - $table->align = array ("LEFT", "LEFT", "LEFT"); + $table->head = array ($strname, $strentries); + $table->align = array ("LEFT", "CENTER"); } foreach ($glossarys as $glossary) { @@ -65,14 +66,19 @@ $link = "coursemodule\">$glossary->name"; } + $count = count_records("glossary_entries", "glossaryid", $glossary->id); + if ($course->format == "weeks" or $course->format == "topics") { - $table->data[] = array ($glossary->section, $link); + if (empty($glossary->section)) { + $glossary->section = ""; + } + $table->data[] = array ($glossary->section, $link, $count); } else { - $table->data[] = array ($link); + $table->data[] = array ($link, $count); } } - echo "
"; + echo "
"; print_table($table);