From de7d2d55316a06f1bfeddf4f1f907dab9efe8f2c Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 26 Jan 2004 12:21:44 +0000 Subject: [PATCH] New dividers --- mod/glossary/index.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mod/glossary/index.php b/mod/glossary/index.php index 346c85689f..e593754c19 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); } -- 2.39.5