MDL-38431 comment: Pass formated comment created time to JS and print_comment

This commit is contained in:
Rajesh Taneja
2013-03-12 12:38:46 +08:00
parent 5c8860f735
commit 967bfb4334
+3 -2
View File
@@ -528,8 +528,9 @@ class comment {
$c->timecreated = $u->ctimecreated;
$c->strftimeformat = get_string('strftimerecent', 'langconfig');
$url = new moodle_url('/user/view.php', array('id'=>$u->id, 'course'=>$this->courseid));
$c->profileurl = $url->out(false);
$c->profileurl = $url->out(true);
$c->fullname = fullname($u);
$c->time = userdate($c->timecreated, $c->strftimeformat);
$c->content = format_text($c->content, $c->format, $formatoptions);
$c->avatar = $OUTPUT->user_picture($u, array('size'=>18));
@@ -808,7 +809,7 @@ class comment {
$replacements[] = $cmt->avatar;
$replacements[] = html_writer::link($cmt->profileurl, $cmt->fullname);
$replacements[] = $cmt->content;
$replacements[] = userdate($cmt->timecreated, $cmt->strftimeformat);
$replacements[] = $cmt->time;
// use html template to format a single comment.
return str_replace($patterns, $replacements, $this->template);