]> git.mjollnir.org Git - moodle.git/commitdiff
Added dividers and improved display of section
authormoodler <moodler>
Mon, 26 Jan 2004 12:27:11 +0000 (12:27 +0000)
committermoodler <moodler>
Mon, 26 Jan 2004 12:27:11 +0000 (12:27 +0000)
mod/assignment/mod.html
mod/chat/index.php
mod/choice/index.php

index 031bcf2b37b4081101ce7c5b2d18529b3ea74799..b5ab9c85e32d0fd186b31f91888ff9cb35047d3c 100644 (file)
@@ -1,10 +1,8 @@
 <?php
     if ($usehtmleditor = can_use_richtext_editor()) {
         $defaultformat = FORMAT_HTML;
-        $onsubmit = "onsubmit=\"copyrichtext(document.form.description);\"";
     } else {
         $defaultformat = FORMAT_MOODLE;
-        $onsubmit = "";
     }
     if (empty($form->name)) {
         $form->name = "";
index 76ad9f9ae8796ae4bfc19a92fe52a6f5fdcd546d..794510425e24c3c4e0de59f4c9c71be1852af5e1 100644 (file)
@@ -53,6 +53,7 @@
         $table->align = array ("left", "left", "left");
     }
 
+    $currentsection = "";
     foreach ($chats as $chat) {
         if (!$chat->visible) {
             //Show dimmed if the mod is hidden
             //Show normal if the mod is visible
             $link = "<a href=\"view.php?id=$chat->coursemodule\">$chat->name</a>";
         }
-        if ($course->format == "weeks" or $course->format == "topics") {
+        $printsection = "";
+        if ($chat->section !== $currentsection) {
             if ($chat->section) {
-                $table->data[] = array ($chat->section, $link);
-            } else {
-                $table->data[] = array ("", $link);
+                $printsection = $chat->section;
+            }
+            if ($currentsection !== "") {
+                $table->data[] = 'hr';
             }
+            $currentsection = $chat->section;
+        }
+        if ($course->format == "weeks" or $course->format == "topics") {
+            $table->data[] = array ($printsection, $link);
         } else {
             $table->data[] = array ($link);
         }
index a4784c24be484083d4ca23cdf56905a695c7810f..94cf5f370b9128d2595c088cc157a1b424a15583 100644 (file)
@@ -53,6 +53,8 @@
         $table->align = array ("LEFT", "LEFT");
     }
 
+    $currentsection = "";
+
     foreach ($choices as $choice) {
         if (!empty($answers[$choice->id])) {
             $answer = $answers[$choice->id];
         } else {
             $aa = "";
         }
-        if (!empty($choice->section)) {
-            $section = "$choice->section";
-        } else {
-            $section = "";
+        $printsection = "";
+        if ($choice->section !== $currentsection) {
+            if ($choice->section) {
+                $printsection = $choice->section;
+            }
+            if ($currentsection !== "") {
+                $table->data[] = 'hr';
+            }
+            $currentsection = $choice->section;
         }
         
         //Calculate the href
         if (!$choice->visible) {
             //Show dimmed if the mod is hidden
-            $tt_href = "<A class=\"dimmed\" HREF=\"view.php?id=$choice->coursemodule\">$choice->name</A>";
+            $tt_href = "<a class=\"dimmed\" href=\"view.php?id=$choice->coursemodule\">$choice->name</a>";
         } else {
             //Show normal if the mod is visible
-            $tt_href = "<A HREF=\"view.php?id=$choice->coursemodule\">$choice->name</A>";
+            $tt_href = "<a href=\"view.php?id=$choice->coursemodule\">$choice->name</a>";
         }
         if ($course->format == "weeks" || $course->format == "topics") {
-            $table->data[] = array ($section, $tt_href, $aa);
+            $table->data[] = array ($printsection, $tt_href, $aa);
         } else {
             $table->data[] = array ($tt_href, $aa);
         }
     }
-    echo "<BR>";
+    echo "<br />";
     print_table($table);
 
     print_footer($course);