From: moodler Date: Mon, 26 Jan 2004 12:27:11 +0000 (+0000) Subject: Added dividers and improved display of section X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9328530195accdbc90388a9fee83715d43451462;p=moodle.git Added dividers and improved display of section --- diff --git a/mod/assignment/mod.html b/mod/assignment/mod.html index 031bcf2b37..b5ab9c85e3 100644 --- a/mod/assignment/mod.html +++ b/mod/assignment/mod.html @@ -1,10 +1,8 @@ name)) { $form->name = ""; diff --git a/mod/chat/index.php b/mod/chat/index.php index 76ad9f9ae8..794510425e 100644 --- a/mod/chat/index.php +++ b/mod/chat/index.php @@ -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 @@ -61,12 +62,18 @@ //Show normal if the mod is visible $link = "coursemodule\">$chat->name"; } - 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); } diff --git a/mod/choice/index.php b/mod/choice/index.php index a4784c24be..94cf5f370b 100644 --- a/mod/choice/index.php +++ b/mod/choice/index.php @@ -53,6 +53,8 @@ $table->align = array ("LEFT", "LEFT"); } + $currentsection = ""; + foreach ($choices as $choice) { if (!empty($answers[$choice->id])) { $answer = $answers[$choice->id]; @@ -64,27 +66,32 @@ } 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 = "coursemodule\">$choice->name"; + $tt_href = "coursemodule\">$choice->name"; } else { //Show normal if the mod is visible - $tt_href = "coursemodule\">$choice->name"; + $tt_href = "coursemodule\">$choice->name"; } 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 "
"; + echo "
"; print_table($table); print_footer($course);