Skip to content

Commit

Permalink
Added dividers and improved display of section
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Jan 26, 2004
1 parent de7d2d5 commit 9328530
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
2 changes: 0 additions & 2 deletions mod/assignment/mod.html
Original file line number Diff line number Diff line change
@@ -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 = "";
Expand Down
15 changes: 11 additions & 4 deletions mod/chat/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -61,12 +62,18 @@
//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);
}
Expand Down
23 changes: 15 additions & 8 deletions mod/choice/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
$table->align = array ("LEFT", "LEFT");
}

$currentsection = "";

foreach ($choices as $choice) {
if (!empty($answers[$choice->id])) {
$answer = $answers[$choice->id];
Expand All @@ -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 = "<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);
Expand Down

0 comments on commit 9328530

Please sign in to comment.