Skip to content

Commit

Permalink
Better dividers in the table
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Jan 26, 2004
1 parent a1a6750 commit 858c8a0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 19 deletions.
26 changes: 17 additions & 9 deletions mod/assignment/index.php
Expand Up @@ -45,6 +45,8 @@
$table->align = array ("left", "left", "left");
}

$currentsection = "";

foreach ($assignments as $assignment) {
if (isteacher($course->id)) {
if ($assignment->type == OFFLINE) {
Expand All @@ -53,13 +55,13 @@
} 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>";
}
Expand All @@ -71,19 +73,25 @@
$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);
}
Expand Down
17 changes: 12 additions & 5 deletions mod/quiz/index.php
Expand Up @@ -75,6 +75,8 @@
$table->size = array ("*", "*", "*");
}

$currentsection = "";

foreach ($quizzes as $quiz) {
if (!$quiz->visible) {
//Show dimmed if the mod is hidden
Expand All @@ -86,10 +88,15 @@

$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);
Expand All @@ -113,7 +120,7 @@
}

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);
}
Expand Down
13 changes: 8 additions & 5 deletions mod/resource/index.php
Expand Up @@ -45,12 +45,15 @@
$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>";
Expand Down

0 comments on commit 858c8a0

Please sign in to comment.