]> git.mjollnir.org Git - moodle.git/commitdiff
New dividers
authormoodler <moodler>
Mon, 26 Jan 2004 12:21:44 +0000 (12:21 +0000)
committermoodler <moodler>
Mon, 26 Jan 2004 12:21:44 +0000 (12:21 +0000)
mod/glossary/index.php

index 346c85689f0939637e195ae1727a6aaf426aa23e..e593754c192dbcd6a01048d8fc8940ef8f572167 100644 (file)
@@ -57,6 +57,8 @@
         $table->align = array ("LEFT", "CENTER");
     }
 
+    $currentsection = "";
+
     foreach ($glossarys as $glossary) {
         if (!$glossary->visible) {
             //Show dimmed if the mod is hidden
             //Show normal if the mod is visible
             $link = "<A HREF=\"view.php?id=$glossary->coursemodule\">$glossary->name</A>";
         }
+        $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);
         }