From a1a6750357041066f1f64e7fbb562f3d9b99b738 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 26 Jan 2004 11:51:41 +0000 Subject: [PATCH] Use dividers on the resource page --- mod/resource/index.php | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/mod/resource/index.php b/mod/resource/index.php index 2780b62890..b1eacb7cfa 100644 --- a/mod/resource/index.php +++ b/mod/resource/index.php @@ -42,29 +42,33 @@ $table->align = array ("LEFT", "LEFT", "LEFT"); } + $currentsection = ""; foreach ($resources as $resource) { - - $tt = ""; if ($course->format == "weeks" or $course->format == "topics") { - if ($resource->section) { - $tt = "$resource->section"; + if ($resource->section != $currentsection and $resource->section) { + $printsection = $resource->section; + $currentsection = $resource->section; + $table->data[] = 'hr'; + } else { + $printsection = ""; } } else { - $tt = "".userdate($resource->timemodified); + $printsection = ''.userdate($resource->timemodified).""; } if (!empty($resource->extra)) { $extra = urldecode($resource->extra); } else { $extra = ""; } - if (!$resource->visible) { - //Show dimmed if the mod is hidden - $table->data[] = array ($tt, "coursemodule\">$resource->name", - text_to_html($resource->summary) ); - } else { - //Show normal if the mod is visible - $table->data[] = array ($tt, "coursemodule\">$resource->name", - text_to_html($resource->summary) ); + if (!$resource->visible) { // Show dimmed if the mod is hidden + $table->data[] = array ($printsection, + "coursemodule\">$resource->name", + text_to_html($resource->summary) ); + + } else { //Show normal if the mod is visible + $table->data[] = array ($printsection, + "coursemodule\">$resource->name", + text_to_html($resource->summary) ); } } -- 2.39.5