From acea23e9feb87b96803528324010a16ca9b74840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Tue, 11 Dec 2007 12:13:39 +0000 Subject: [PATCH] #116726 by Pancho: (usability) standardize on '@type %title' usage in node feedback messages --- modules/node/node.module | 2 +- modules/node/node.pages.inc | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/node/node.module b/modules/node/node.module index 0722b9be5b6..04413a8026d 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -926,8 +926,8 @@ function node_delete($nid) { if (function_exists('search_wipe')) { search_wipe($node->nid, 'node'); } - drupal_set_message(t('%title has been deleted.', array('%title' => $node->title))); watchdog('content', '@type: deleted %title.', array('@type' => $node->type, '%title' => $node->title)); + drupal_set_message(t('@type %title has been deleted.', array('@type' => node_get_types('name', $node), '%title' => $node->title))); } } diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 71c458cb0b2..07fe1c8afc7 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -437,15 +437,15 @@ function node_form_submit($form, &$form_state) { node_save($node); $node_link = l(t('view'), 'node/'. $node->nid); $watchdog_args = array('@type' => $node->type, '%title' => $node->title); - $t_args = array('%post' => node_get_types('name', $node)); + $t_args = array('@type' => node_get_types('name', $node), '%title' => $node->title); if ($insert) { watchdog('content', '@type: added %title.', $watchdog_args, WATCHDOG_NOTICE, $node_link); - drupal_set_message(t('Your %post has been created.', $t_args)); + drupal_set_message(t('@type %title has been created.', $t_args)); } else { watchdog('content', '@type: updated %title.', $watchdog_args, WATCHDOG_NOTICE, $node_link); - drupal_set_message(t('The %post has been updated.', $t_args)); + drupal_set_message(t('@type %title has been updated.', $t_args)); } if ($node->nid) { unset($form_state['rebuild']); @@ -616,8 +616,8 @@ function node_revision_revert_confirm_submit($form, &$form_state) { node_save($node_revision); - drupal_set_message(t('%title has been reverted back to the revision from %revision-date', array('%revision-date' => format_date($node_revision->revision_timestamp), '%title' => $node_revision->title))); watchdog('content', '@type: reverted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title, '%revision' => $node_revision->vid)); + drupal_set_message(t('@type %title has been reverted back to the revision from %revision-date.', array('@type' => node_get_types('name', $node_revision), '%title' => $node_revision->title, '%revision-date' => format_date($node_revision->revision_timestamp)))); $form_state['redirect'] = 'node/'. $node_revision->nid .'/revisions'; } @@ -652,8 +652,8 @@ function node_revision_delete_confirm_submit($form, &$form_state) { $node_revision = $form['#node_revision']; db_query("DELETE FROM {node_revisions} WHERE nid = %d AND vid = %d", $node_revision->nid, $node_revision->vid); node_invoke_nodeapi($node_revision, 'delete revision'); - drupal_set_message(t('Deleted %title revision %revision.', array('%title' => $node_revision->title, '%revision' => $node_revision->vid))); watchdog('content', '@type: deleted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title, '%revision' => $node_revision->vid)); + drupal_set_message(t('Revision from %revision-date of @type %title has been deleted.', array('%revision-date' => format_date($node_revision->revision_timestamp), '@type' => node_get_types('name', $node_revision), '%title' => $node_revision->title))); $form_state['redirect'] = 'node/'. $node_revision->nid; if (db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d', $node_revision->nid)) > 1) { $form_state['redirect'] .= '/revisions';