diff --git a/admin/tool/lp/templates/comment_area.mustache b/admin/tool/lp/templates/comment_area.mustache
index a93697a6f69..19f8fdb3a65 100644
--- a/admin/tool/lp/templates/comment_area.mustache
+++ b/admin/tool/lp/templates/comment_area.mustache
@@ -93,7 +93,7 @@ require(['core/str'], function(Str) {
{ key: 'comments', component: 'moodle' },
{ key: 'commentscount', component: 'moodle' },
{ key: 'commentsrequirelogin', component: 'moodle' },
- { key: 'deletecomment', component: 'moodle' },
+ { key: 'deletecommentbyon', component: 'moodle' },
]).then(function() {
// Kick off when strings are loaded.
Y.use('core_comment', function(Y) {
diff --git a/comment/comment.js b/comment/comment.js
index bdcc7bc9236..d93a357245a 100644
--- a/comment/comment.js
+++ b/comment/comment.js
@@ -192,7 +192,17 @@ M.core_comment = {
val = val.replace('___name___', list[i].fullname);
}
if (list[i]['delete']||newcmt) {
- list[i].content = '
' + list[i].content;
+ var tokens = {
+ user: list[i].fullname,
+ time: list[i].time
+ };
+ var deleteStr = Y.Escape.html(M.util.get_string('deletecommentbyon', 'moodle', tokens));
+ list[i].content = '' + list[i].content;
}
val = val.replace('___time___', list[i].time);
val = val.replace('___picture___', list[i].avatar);
diff --git a/comment/lib.php b/comment/lib.php
index 8bc01976e74..1a770f8b450 100644
--- a/comment/lib.php
+++ b/comment/lib.php
@@ -263,7 +263,7 @@ class comment {
'comments',
'commentscount',
'commentsrequirelogin',
- 'deletecomment',
+ 'deletecommentbyon',
),
'moodle'
);
diff --git a/lang/en/moodle.php b/lang/en/moodle.php
index d89a33c36b1..c04f627b68e 100644
--- a/lang/en/moodle.php
+++ b/lang/en/moodle.php
@@ -464,6 +464,7 @@ $string['deletecategoryempty'] = 'This category is empty.';
$string['deletecategorycheck'] = 'Are you absolutely sure you want to completely delete this category \'{$a}\'?
This will move all courses into the parent category if there is one, or into Miscellaneous.';
$string['deletecategorycheck2'] = 'If you delete this category, you need to choose what to do with the courses and subcategories it contains.';
$string['deletecomment'] = 'Delete this comment';
+$string['deletecommentbyon'] = 'Delete comment posted by {$a->user} on {$a->time}';
$string['deletecompletely'] = 'Delete completely';
$string['deletecourse'] = 'Delete a course';
$string['deletecoursecheck'] = 'Are you absolutely sure you want to completely delete this course and all the data it contains?';
diff --git a/lib/outputrequirementslib.php b/lib/outputrequirementslib.php
index ed868fa1b4b..55287f47740 100644
--- a/lib/outputrequirementslib.php
+++ b/lib/outputrequirementslib.php
@@ -743,7 +743,7 @@ class page_requirements_manager {
case 'core_comment':
$module = array('name' => 'core_comment',
'fullpath' => '/comment/comment.js',
- 'requires' => array('base', 'io-base', 'node', 'json', 'yui2-animation', 'overlay'),
+ 'requires' => array('base', 'io-base', 'node', 'json', 'yui2-animation', 'overlay', 'escape'),
'strings' => array(array('confirmdeletecomments', 'admin'), array('yes', 'moodle'), array('no', 'moodle'))
);
break;