diff --git a/mod/glossary/index.php b/mod/glossary/index.php index 346c85689f0..e593754c192 100644 --- a/mod/glossary/index.php +++ b/mod/glossary/index.php @@ -57,6 +57,8 @@ $table->align = array ("LEFT", "CENTER"); } + $currentsection = ""; + foreach ($glossarys as $glossary) { if (!$glossary->visible) { //Show dimmed if the mod is hidden @@ -65,14 +67,21 @@ //Show normal if the mod is visible $link = "coursemodule\">$glossary->name"; } + $printsection = ""; + if ($glossary->section !== $currentsection) { + if ($glossary->section) { + $printsection = $glossary->section; + } + if ($currentsection !== "") { + $table->data[] = 'hr'; + } + $currentsection = $glossary->section; + } $count = count_records_sql("SELECT COUNT(*) FROM {$CFG->prefix}glossary_entries where (glossaryid = $glossary->id or sourceglossaryid = $glossary->id)"); if ($course->format == "weeks" or $course->format == "topics") { - if (empty($glossary->section)) { - $glossary->section = ""; - } - $table->data[] = array ($glossary->section, $link, $count); + $table->data[] = array ($printsection, $link, $count); } else { $table->data[] = array ($link, $count); }