From ae078a9809e56881480f2d938b1226447cc523cd Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 13 May 2003 16:02:08 +0000 Subject: [PATCH] Mail-outs for assignment and journal module are now translatable. --- lang/en/assignment.php | 9 +++++++++ lang/en/journal.php | 9 +++++++++ mod/assignment/lib.php | 29 +++++++++++++++-------------- mod/journal/lib.php | 26 +++++++++++++------------- 4 files changed, 46 insertions(+), 27 deletions(-) diff --git a/lang/en/assignment.php b/lang/en/assignment.php index 6b1fdde29d..c9db86fc8b 100644 --- a/lang/en/assignment.php +++ b/lang/en/assignment.php @@ -4,6 +4,15 @@ $string['allowresubmit'] = "Allow resubmitting"; $string['assignmentdetails'] = "Assignment details"; +$string['assignmentmail'] = "\$a->teacher has posted some feedback on your +assignment submission for '\$a->assignment' + +You can see it appended to your assignment submission: + + \$a->url"; +$string['assignmentmailhtml'] = "\$a->teacher has posted some feedback on your +assignment submission for '\$a->assignment'

+You can see it appended to your url\\\">assignment submission."; $string['assignmentname'] = "Assignment name"; $string['assignmenttype'] = "Assignment type"; $string['description'] = "Description"; diff --git a/lang/en/journal.php b/lang/en/journal.php index ad75192a4b..f0257cce69 100644 --- a/lang/en/journal.php +++ b/lang/en/journal.php @@ -13,6 +13,15 @@ $string['editingends'] = "Editing period ends"; $string['editingended'] = "Editing period has ended"; $string['entries'] = "Entries"; $string['feedbackupdated'] = "Feedback updated for \$a entries"; +$string['journalmail'] = "\$a->teacher has posted some feedback on your +journal entry for '\$a->journal' + +You can see it appended to your journal entry: + + \$a->url"; +$string['journalmailhtml'] = "\$a->teacher has posted some feedback on your +journal entry for '\$a->journal'

+You can see it appended to your url\\\">journal entry."; $string['journalname'] = "Journal name"; $string['journalquestion'] = "Journal question"; $string['journalrating1'] = "Not satisfactory"; diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 672d83a4c2..97c945497a 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -149,26 +149,27 @@ function assignment_cron () { $strassignments = get_string("modulenameplural", "assignment"); $strassignment = get_string("modulename", "assignment"); + unset($assignmentinfo); + $assignmentinfo->teacher = "$teacher->firstname $teacher->lastname"; + $assignmentinfo->assignment = "$submission->name"; + $assignmentinfo->url = "$CFG->wwwroot/mod/assignment/view.php?id=$mod->id"; + $postsubject = "$course->shortname: $strassignments: $submission->name"; $posttext = "$course->shortname -> $strassignments -> $submission->name\n"; $posttext .= "---------------------------------------------------------------------\n"; - $posttext .= "$teacher->firstname $teacher->lastname has posted some feedback on your\n"; - $posttext .= "assignment submission for '$submission->name'\n\n"; - $posttext .= "You can see it appended to your assignment submission:\n"; - $posttext .= " $CFG->wwwroot/mod/assignment/view.php?id=$mod->id\n"; + $posttext .= get_string("assignmentmail", "assignment", $assignmentinfo); $posttext .= "---------------------------------------------------------------------\n"; + if ($user->mailformat == 1) { // HTML - $posthtml = "

". - "wwwroot/course/view.php?id=$course->id\">$course->shortname ->". - "wwwroot/mod/assignment/index.php?id=$course->id\">$strassignments ->". - "wwwroot/mod/assignment/view.php?id=$mod->id\">$submission->name

"; - $posthtml .= "
"; - $posthtml .= "

$teacher->firstname $teacher->lastname has posted some feedback on your"; - $posthtml .= " assignment submission for '$submission->name'

"; - $posthtml .= "

You can see it wwwroot/mod/assignment/view.php?id=$mod->id\">"; - $posthtml .= "appended to your assignment submission.


"; + $posthtml = "

". + "wwwroot/course/view.php?id=$course->id\">$course->shortname ->". + "wwwroot/mod/assignment/index.php?id=$course->id\">$strassignments ->". + "wwwroot/mod/assignment/view.php?id=$mod->id\">$submission->name

"; + $posthtml .= "
"; + $posthtml .= "

".get_string("assignmentmailhtml", "assignment", $assignmentinfo)."

"; + $posthtml .= "

"; } else { - $posthtml = ""; + $posthtml = ""; } if (! email_to_user($user, $teacher, $postsubject, $posttext, $posthtml)) { diff --git a/mod/journal/lib.php b/mod/journal/lib.php index 0826c3b706..a003c7f2a0 100644 --- a/mod/journal/lib.php +++ b/mod/journal/lib.php @@ -85,24 +85,24 @@ function journal_cron () { continue; } + unset($journalinfo); + $journalinfo->teacher = "$teacher->firstname $teacher->lastname"; + $journalinfo->journal = "$entry->name"; + $journalinfo->url = "$CFG->wwwroot/mod/journal/view.php?id=$mod->id"; + $postsubject = "$course->shortname: Journal feedback: $entry->name"; $posttext = "$course->shortname -> Journals -> $entry->name\n"; $posttext .= "---------------------------------------------------------------------\n"; - $posttext .= "$teacher->firstname $teacher->lastname has posted some feedback on your\n"; - $posttext .= "journal entry for '$entry->name'\n\n"; - $posttext .= "You can see it appended to your journal entry:\n"; - $posttext .= " $CFG->wwwroot/mod/journal/view.php?id=$mod->id\n"; + $posttext .= get_string("journalmail", "journal", $journalinfo); $posttext .= "---------------------------------------------------------------------\n"; if ($user->mailformat == 1) { // HTML - $posthtml = "

". - "wwwroot/course/view.php?id=$course->id\">$course->shortname ->". - "wwwroot/mod/journal/index.php?id=$course->id\">Journals ->". - "wwwroot/mod/journal/view.php?id=$mod->id\">$entry->name

"; - $posthtml .= "
"; - $posthtml .= "

$teacher->firstname $teacher->lastname has posted some feedback on your"; - $posthtml .= " journal entry for '$entry->name'

"; - $posthtml .= "

You can see it wwwroot/mod/journal/view.php?id=$mod->id\">"; - $posthtml .= "appended to your journal entry.


"; + $posthtml = "

". + "wwwroot/course/view.php?id=$course->id\">$course->shortname ->". + "wwwroot/mod/journal/index.php?id=$course->id\">journals ->". + "wwwroot/mod/journal/view.php?id=$mod->id\">$entry->name

"; + $posthtml .= "
"; + $posthtml .= "

".get_string("journalmailhtml", "journal", $journalinfo)."

"; + $posthtml .= "

"; } else { $posthtml = ""; } -- 2.39.5