MDL-13795 - Proposed fix to show a nice string instead of a non-existent deadline. (merge)

This commit is contained in:
scyrma 2008-03-06 05:02:07 +00:00
parent fffb5d240a
commit e9b18d9092
2 changed files with 5 additions and 1 deletions

View File

@ -177,6 +177,7 @@ $string['nobranchtablefound'] = 'No Branch Table found';
$string['nocommentyet'] = 'No comment yet.';
$string['nocoursemods'] = 'No activities found';
$string['nocredit'] = 'No credit';
$string['nodeadline'] = 'No deadline';
$string['noessayquestionsfound'] = 'No essay questions found in this lesson.';
$string['nohighscores'] = 'No high scores';
$string['nolessonattempts'] = 'No attempts have been made on this lesson.';

View File

@ -51,6 +51,7 @@
$strdeadline = get_string("deadline", "lesson");
$strweek = get_string("week");
$strtopic = get_string("topic");
$strnodeadline = get_string("nodeadline", "lesson");
$table = new stdClass;
if ($course->format == "weeks") {
@ -75,7 +76,9 @@
$cm = get_coursemodule_from_instance('lesson', $lesson->id);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
if ($lesson->deadline > $timenow) {
if ($lesson->deadline == 0) {
$due = $strnodeadline;
} else if ($lesson->deadline > $timenow) {
$due = userdate($lesson->deadline);
} else {
$due = "<font color=\"red\">".userdate($lesson->deadline)."</font>";