@@ -98,13 +98,14 @@ function comment_admin_overview($form, &$form_state, $arg) {
|
||||
// Remove the first node title from the node_titles array and attach to
|
||||
// the comment.
|
||||
$comment->node_title = array_shift($node_titles);
|
||||
$comment_body = field_get_items('comment', $comment, 'comment_body');
|
||||
$options[$comment->cid] = array(
|
||||
'subject' => array(
|
||||
'data' => array(
|
||||
'#type' => 'link',
|
||||
'#title' => $comment->subject,
|
||||
'#href' => 'comment/' . $comment->cid,
|
||||
'#options' => array('attributes' => array('title' => truncate_utf8($comment->comment_body[LANGUAGE_NONE][0]['value'], 128)), 'fragment' => 'comment-' . $comment->cid),
|
||||
'#options' => array('attributes' => array('title' => truncate_utf8($comment_body[0]['value'], 128)), 'fragment' => 'comment-' . $comment->cid),
|
||||
),
|
||||
),
|
||||
'author' => theme('username', array('account' => $comment)),
|
||||
|
@@ -9,8 +9,8 @@ files[] = comment.test
|
||||
configure = admin/content/comment
|
||||
stylesheets[all][] = comment.css
|
||||
|
||||
; Information added by drupal.org packaging script on 2013-03-07
|
||||
version = "7.21"
|
||||
; Information added by drupal.org packaging script on 2013-04-03
|
||||
version = "7.22"
|
||||
project = "drupal"
|
||||
datestamp = "1362616996"
|
||||
datestamp = "1365027012"
|
||||
|
||||
|
@@ -2041,7 +2041,8 @@ function comment_form($form, &$form_state, $comment) {
|
||||
|
||||
// Attach fields.
|
||||
$comment->node_type = 'comment_node_' . $node->type;
|
||||
field_attach_form('comment', $comment, $form, $form_state);
|
||||
$langcode = entity_language('comment', $comment);
|
||||
field_attach_form('comment', $comment, $form, $form_state, $langcode);
|
||||
|
||||
return $form;
|
||||
}
|
||||
@@ -2066,7 +2067,8 @@ function comment_preview($comment) {
|
||||
$node = node_load($comment->nid);
|
||||
|
||||
if (!form_get_errors()) {
|
||||
$comment->format = $comment->comment_body[LANGUAGE_NONE][0]['format'];
|
||||
$comment_body = field_get_items('comment', $comment, 'comment_body');
|
||||
$comment->format = $comment_body[0]['format'];
|
||||
// Attach the user and time information.
|
||||
if (!empty($comment->name)) {
|
||||
$account = user_load_by_name($comment->name);
|
||||
@@ -2190,7 +2192,9 @@ function comment_submit($comment) {
|
||||
// 1) Filter it into HTML
|
||||
// 2) Strip out all HTML tags
|
||||
// 3) Convert entities back to plain-text.
|
||||
$comment_body = $comment->comment_body[LANGUAGE_NONE][0];
|
||||
$field = field_info_field('comment_body');
|
||||
$langcode = field_is_translatable('comment', $field) ? entity_language('comment', $comment) : LANGUAGE_NONE;
|
||||
$comment_body = $comment->comment_body[$langcode][0];
|
||||
if (isset($comment_body['format'])) {
|
||||
$comment_text = check_markup($comment_body['value'], $comment_body['format']);
|
||||
}
|
||||
@@ -2284,8 +2288,16 @@ function template_preprocess_comment(&$variables) {
|
||||
$variables['comment'] = $comment;
|
||||
$variables['node'] = $node;
|
||||
$variables['author'] = theme('username', array('account' => $comment));
|
||||
|
||||
$variables['created'] = format_date($comment->created);
|
||||
$variables['changed'] = format_date($comment->changed);
|
||||
|
||||
// Avoid calling format_date() twice on the same timestamp.
|
||||
if ($comment->changed == $comment->created) {
|
||||
$variables['changed'] = $variables['created'];
|
||||
}
|
||||
else {
|
||||
$variables['changed'] = format_date($comment->changed);
|
||||
}
|
||||
|
||||
$variables['new'] = !empty($comment->new) ? t('new') : '';
|
||||
$variables['picture'] = theme_get_setting('toggle_comment_user_picture') ? theme('user_picture', array('account' => $comment)) : '';
|
||||
|
Reference in New Issue
Block a user