diff --git a/mod/glossary/index.php b/mod/glossary/index.php
index 8bfc3d08527..c85fa8deaf1 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);