]> git.mjollnir.org Git - moodle.git/commitdiff
Better dividers in the table
authormoodler <moodler>
Mon, 26 Jan 2004 12:07:34 +0000 (12:07 +0000)
committermoodler <moodler>
Mon, 26 Jan 2004 12:07:34 +0000 (12:07 +0000)
mod/assignment/index.php
mod/quiz/index.php
mod/resource/index.php

index b071b423ca807066d985aff9f55e5147600b6fa5..21dc1acbc932d4b6bf4d859f1aa9a9c278d952a5 100644 (file)
@@ -45,6 +45,8 @@
         $table->align = array ("left", "left", "left");
     }
 
+    $currentsection = "";
+
     foreach ($assignments as $assignment) {
         if (isteacher($course->id)) {
             if ($assignment->type == OFFLINE) {
             } else {
                 $count = count_records_select("assignment_submissions",
                                               "assignment = '$assignment->id' AND timemodified > 0");
-                $submitted = "<A HREF=\"submissions.php?id=$assignment->id\">" .
+                $submitted = "<a href=\"submissions.php?id=$assignment->id\">" .
                              get_string("viewsubmissions", "assignment", $count) . "</A>";
             }
         } else {
             if ($submission = assignment_get_submission($assignment, $USER)) {
                 if ($submission->timemodified <= $assignment->timedue) {
-                  $submitted = userdate($submission->timemodified);
+                    $submitted = userdate($submission->timemodified);
                 } else {
                     $submitted = "<font color=red>".userdate($submission->timemodified)."</font>";
                 }
         $due = userdate($assignment->timedue);
         if (!$assignment->visible) {
             //Show dimmed if the mod is hidden
-            $link = "<A class=\"dimmed\" HREF=\"view.php?id=$assignment->coursemodule\">$assignment->name</A>";
+            $link = "<a class=\"dimmed\" href=\"view.php?id=$assignment->coursemodule\">$assignment->name</a>";
         } else {
             //Show normal if the mod is visible
-            $link = "<A HREF=\"view.php?id=$assignment->coursemodule\">$assignment->name</A>";
+            $link = "<a href=\"view.php?id=$assignment->coursemodule\">$assignment->name</a>";
         }
-        if ($assignment->section) {
-            $section = "$assignment->section";
-        } else {
-            $section = "";
+
+        $printsection = "";
+        if ($assignment->section !== $currentsection) {
+            if ($assignment->section) {
+                $printsection = $assignment->section;
+            }
+            if ($currentsection !== "") {
+                $table->data[] = 'hr';
+            }
+            $currentsection = $assignment->section;
         }
 
         if ($course->format == "weeks" or $course->format == "topics") {
-            $table->data[] = array ($section, $link, $due, $submitted);
+            $table->data[] = array ($printsection, $link, $due, $submitted);
         } else {
             $table->data[] = array ($link, $due, $submitted);
         }
index 80f9558e6d807675578e6ea064d4a48144dc8352..c6b18eacd53b9c31051796cd1cb511e9778e684e 100644 (file)
@@ -75,6 +75,8 @@
         $table->size = array ("*", "*", "*");
     }
 
+    $currentsection = "";
+
     foreach ($quizzes as $quiz) {
         if (!$quiz->visible) { 
             //Show dimmed if the mod is hidden
 
         $bestgrade = quiz_get_best_grade($quiz->id, $USER->id);
 
-        if ($quiz->section) {
-            $section = "$quiz->section";
-        } else {
-            $section = "";
+        $printsection = "";
+        if ($quiz->section !== $currentsection) {
+            if ($quiz->section) {
+                $printsection = $quiz->section;
+            }
+            if ($currentsection !== "") {
+                $table->data[] = 'hr';
+            }
+            $currentsection = $quiz->section;
         }
 
         $closequiz = userdate($quiz->timeclose);
         }
 
         if ($course->format == "weeks" or $course->format == "topics") {
-            $table->data[] = array ($section, $link, $closequiz, $gradecol);
+            $table->data[] = array ($printsection, $link, $closequiz, $gradecol);
         } else {
             $table->data[] = array ($link, $closequiz, $gradecol);
         }
index b1eacb7cfae2921f5eb961755ab89e10b3d1bf68..416165a06d43b0b23d9f2798c687f7794d67ab6a 100644 (file)
     $currentsection = "";
     foreach ($resources as $resource) {
         if ($course->format == "weeks" or $course->format == "topics") {
-            if ($resource->section != $currentsection and $resource->section) {
-                $printsection = $resource->section;
+            $printsection = "";
+            if ($resource->section !== $currentsection) {
+                if ($resource->section) {
+                    $printsection = $resource->section;
+                }
+                if ($currentsection !== "") {
+                    $table->data[] = 'hr';
+                }
                 $currentsection = $resource->section;
-                $table->data[] = 'hr';
-            } else {
-                $printsection = "";
             }
         } else {
             $printsection = '<span class="smallinfo">'.userdate($resource->timemodified)."</span>";