]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13795 - Proposed fix to show a nice string instead of a non-existent deadline...
authorscyrma <scyrma>
Thu, 6 Mar 2008 05:02:07 +0000 (05:02 +0000)
committerscyrma <scyrma>
Thu, 6 Mar 2008 05:02:07 +0000 (05:02 +0000)
lang/en_utf8/lesson.php
mod/lesson/index.php

index 21f4a8c3d48ae2313ee7e85bc31221509eec0614..882b061533f80c14d8f61af69d039795349a29d4 100644 (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.';
index 0dd0c97d633935e28f347730427b6f94e6211179..ea33f44ebca7b86f1d9dad0a5e76054b104e458b 100644 (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>";