$url = new moodle_url('/user/view.php', array('id'=>$u->id, 'course'=>$this->courseid));
$c->profileurl = $url->out(false);
$c->fullname = fullname($u);
- $c->time = userdate($c->timecreated, get_string('strftimerecent', 'langconfig'));
$c->content = format_text($c->content, $c->format, $formatoptions);
$c->avatar = $OUTPUT->user_picture($u, array('size'=>18));
$cmt_id = $DB->insert_record('comments', $newcmt);
if (!empty($cmt_id)) {
$newcmt->id = $cmt_id;
- $newcmt->time = userdate($now, get_string('strftimerecent', 'langconfig'));
+ $newcmt->strftimeformat = get_string('strftimerecent', 'langconfig');
$newcmt->fullname = fullname($USER);
$url = new moodle_url('/user/view.php', array('id' => $USER->id, 'course' => $this->courseid));
$newcmt->profileurl = $url->out();
$newcmt->content = format_text($newcmt->content, $format, array('overflowdiv'=>true));
$newcmt->avatar = $OUTPUT->user_picture($USER, array('size'=>16));
+
+ $commentlist = array($newcmt);
+
+ if (!empty($this->plugintype)) {
+ // Call the display callback to allow the plugin to format the newly added comment.
+ $commentlist = plugin_callback($this->plugintype,
+ $this->pluginname,
+ 'comment',
+ 'display',
+ array($commentlist, $this->comment_param),
+ $commentlist);
+ $newcmt = $commentlist[0];
+ }
+ $newcmt->time = userdate($newcmt->timecreated, $newcmt->strftimeformat);
+
return $newcmt;
} else {
throw new comment_exception('dbupdatefailed');