]> git.mjollnir.org Git - moodle.git/commitdiff
Use dividers on the resource page
authormoodler <moodler>
Mon, 26 Jan 2004 11:51:41 +0000 (11:51 +0000)
committermoodler <moodler>
Mon, 26 Jan 2004 11:51:41 +0000 (11:51 +0000)
mod/resource/index.php

index 2780b628901de4630506e98cc8549f126c14de34..b1eacb7cfae2921f5eb961755ab89e10b3d1bf68 100644 (file)
         $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 = "<font size=1>".userdate($resource->timemodified);
+            $printsection = '<span class="smallinfo">'.userdate($resource->timemodified)."</span>";
         }
         if (!empty($resource->extra)) {
             $extra = urldecode($resource->extra);
         } else {
             $extra = "";
         }
-        if (!$resource->visible) {
-           //Show dimmed if the mod is hidden
-           $table->data[] = array ($tt, "<a class=\"dimmed\" $extra href=\"view.php?id=$resource->coursemodule\">$resource->name</a>",
-                                   text_to_html($resource->summary) );
-        } else {
-           //Show normal if the mod is visible
-           $table->data[] = array ($tt, "<a $extra href=\"view.php?id=$resource->coursemodule\">$resource->name</a>",
-                                   text_to_html($resource->summary) );
+        if (!$resource->visible) {      // Show dimmed if the mod is hidden
+           $table->data[] = array ($printsection, 
+                "<a class=\"dimmed\" $extra href=\"view.php?id=$resource->coursemodule\">$resource->name</a>",
+                text_to_html($resource->summary) );
+
+        } else {                        //Show normal if the mod is visible
+           $table->data[] = array ($printsection, 
+                "<a $extra href=\"view.php?id=$resource->coursemodule\">$resource->name</a>",
+                text_to_html($resource->summary) );
         }
     }