From 967bfb433447abc005f467075bbc5e169bb00313 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Tue, 12 Mar 2013 12:24:35 +0800 Subject: [PATCH] MDL-38431 comment: Pass formated comment created time to JS and print_comment --- comment/lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/comment/lib.php b/comment/lib.php index 9ca0a412ee1..7b281584a25 100644 --- a/comment/lib.php +++ b/comment/lib.php @@ -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);