Commit 2f33b939 authored by Dries's avatar Dries

- Patch #9983 by Stefan: usability improvement: made sure all status messages start with a capital letter.
parent 4545f798
...@@ -147,7 +147,7 @@ function file_copy(&$source, $dest = 0, $replace = 0) { ...@@ -147,7 +147,7 @@ function file_copy(&$source, $dest = 0, $replace = 0) {
// Make sure we at least have a valid directory. // Make sure we at least have a valid directory.
if ($basename === false) { if ($basename === false) {
drupal_set_message(t('file copy failed: no directory configured, or it could not be accessed.'), 'error'); drupal_set_message(t('File copy failed: no directory configured, or it could not be accessed.'), 'error');
return 0; return 0;
} }
...@@ -162,7 +162,7 @@ function file_copy(&$source, $dest = 0, $replace = 0) { ...@@ -162,7 +162,7 @@ function file_copy(&$source, $dest = 0, $replace = 0) {
$source = realpath($source); $source = realpath($source);
if (!file_exists($source)) { if (!file_exists($source)) {
drupal_set_message(t('file copy failed: source file does not exist.'), 'error'); drupal_set_message(t('File copy failed: source file does not exist.'), 'error');
return 0; return 0;
} }
...@@ -190,7 +190,7 @@ function file_copy(&$source, $dest = 0, $replace = 0) { ...@@ -190,7 +190,7 @@ function file_copy(&$source, $dest = 0, $replace = 0) {
} }
if (!copy($source, $dest)) { if (!copy($source, $dest)) {
drupal_set_message(t('file copy failed.'), 'error'); drupal_set_message(t('File copy failed.'), 'error');
return 0; return 0;
} }
...@@ -211,7 +211,7 @@ function file_move(&$source, $dest = 0, $replace = 0) { ...@@ -211,7 +211,7 @@ function file_move(&$source, $dest = 0, $replace = 0) {
if (unlink($path)) { if (unlink($path)) {
return 1; return 1;
} }
drupal_set_message(t('removing original file failed.'), 'error'); drupal_set_message(t('Removing original file failed.'), 'error');
} }
return 0; return 0;
} }
...@@ -249,7 +249,7 @@ function file_save_upload($source, $dest = 0, $replace = 0) { ...@@ -249,7 +249,7 @@ function file_save_upload($source, $dest = 0, $replace = 0) {
if (!valid_input_data($file)) { if (!valid_input_data($file)) {
watchdog('error', t('Possible exploit abuse: invalid data.')); watchdog('error', t('Possible exploit abuse: invalid data.'));
drupal_set_message(t("file upload failed: invalid data."), 'error'); drupal_set_message(t("File upload failed: invalid data."), 'error');
return 0; return 0;
} }
...@@ -259,14 +259,14 @@ function file_save_upload($source, $dest = 0, $replace = 0) { ...@@ -259,14 +259,14 @@ function file_save_upload($source, $dest = 0, $replace = 0) {
break; break;
case 1: // UPLOAD_ERR_INI_SIZE case 1: // UPLOAD_ERR_INI_SIZE
case 2: // UPLOAD_ERR_FORM_SIZE case 2: // UPLOAD_ERR_FORM_SIZE
drupal_set_message(t("file upload failed: file size too big."), 'error'); drupal_set_message(t("File upload failed: file size too big."), 'error');
return 0; return 0;
case 3: // UPLOAD_ERR_PARTIAL case 3: // UPLOAD_ERR_PARTIAL
case 4: // UPLOAD_ERR_NO_FILE case 4: // UPLOAD_ERR_NO_FILE
drupal_set_message(t("file upload failed: incomplete upload."), 'error'); drupal_set_message(t("File upload failed: incomplete upload."), 'error');
return 0; return 0;
default: // Unknown error default: // Unknown error
drupal_set_message(t("file upload failed: unknown error."), 'error'); drupal_set_message(t("File upload failed: unknown error."), 'error');
return 0; return 0;
} }
...@@ -299,14 +299,14 @@ function file_save_upload($source, $dest = 0, $replace = 0) { ...@@ -299,14 +299,14 @@ function file_save_upload($source, $dest = 0, $replace = 0) {
function file_save_data($data, $dest, $replace = 0) { function file_save_data($data, $dest, $replace = 0) {
if (!valid_input_data($data)) { if (!valid_input_data($data)) {
watchdog('error', t('Possible exploit abuse: invalid data.')); watchdog('error', t('Possible exploit abuse: invalid data.'));
drupal_set_message(t("file upload failed: invalid data."), 'error'); drupal_set_message(t("File upload failed: invalid data."), 'error');
return 0; return 0;
} }
$temp = variable_get('file_directory_temp', (PHP_OS == 'WINNT' ? 'c:\\windows\\temp' : '/tmp')); $temp = variable_get('file_directory_temp', (PHP_OS == 'WINNT' ? 'c:\\windows\\temp' : '/tmp'));
$file = tempnam($temp, 'file'); $file = tempnam($temp, 'file');
if (!$fp = fopen($file, 'w')) { if (!$fp = fopen($file, 'w')) {
drupal_set_message(t('unable to create file.'), 'error'); drupal_set_message(t('Unable to create file.'), 'error');
return 0; return 0;
} }
fwrite($fp, $data); fwrite($fp, $data);
......
...@@ -866,7 +866,7 @@ function _locale_string_delete($lid) { ...@@ -866,7 +866,7 @@ function _locale_string_delete($lid) {
db_query("DELETE FROM {locales_source} WHERE lid = %d", $lid); db_query("DELETE FROM {locales_source} WHERE lid = %d", $lid);
db_query("DELETE FROM {locales_target} WHERE lid = %d", $lid); db_query("DELETE FROM {locales_target} WHERE lid = %d", $lid);
locale_refresh_cache(); locale_refresh_cache();
drupal_set_message(t("deleted string")); drupal_set_message(t("Deleted string"));
} }
/** /**
...@@ -890,7 +890,7 @@ function _locale_string_save($lid) { ...@@ -890,7 +890,7 @@ function _locale_string_save($lid) {
// delete form data so it will remember where it came from // delete form data so it will remember where it came from
$edit = ''; $edit = '';
drupal_set_message(t("saved string")); drupal_set_message(t("Saved string"));
} }
/** /**
......
...@@ -260,7 +260,7 @@ function aggregator_remove($feed) { ...@@ -260,7 +260,7 @@ function aggregator_remove($feed) {
} }
db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $feed['fid']); db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $feed['fid']);
db_query("UPDATE {aggregator_feed} SET checked = 0, etag = '', modified = 0 WHERE fid = %d", $feed['fid']); db_query("UPDATE {aggregator_feed} SET checked = 0, etag = '', modified = 0 WHERE fid = %d", $feed['fid']);
drupal_set_message(t('removed news items from \'%site\'.', array('%site' => $feed['title']))); drupal_set_message(t('Removed news items from \'%site\'.', array('%site' => $feed['title'])));
} }
/** /**
...@@ -340,7 +340,7 @@ function aggregator_refresh($feed) { ...@@ -340,7 +340,7 @@ function aggregator_refresh($feed) {
switch ($result->code) { switch ($result->code) {
case 304: case 304:
db_query('UPDATE {aggregator_feed} SET checked = %d WHERE fid = %d', time(), $feed['fid']); db_query('UPDATE {aggregator_feed} SET checked = %d WHERE fid = %d', time(), $feed['fid']);
drupal_set_message(t('no new syndicated content from "%site".', array('%site' => $feed['title']))); drupal_set_message(t('No new syndicated content from "%site".', array('%site' => $feed['title'])));
break; break;
case 301: case 301:
$feed['url'] = $result->redirect_url; $feed['url'] = $result->redirect_url;
...@@ -383,14 +383,12 @@ function aggregator_refresh($feed) { ...@@ -383,14 +383,12 @@ function aggregator_refresh($feed) {
cache_clear_all(); cache_clear_all();
watchdog('regular', t('aggregator: syndicated content from "%site"', array('%site' => $feed[title]))); watchdog('regular', t('aggregator: syndicated content from "%site"', array('%site' => $feed[title])));
$message = t('syndicated content from "%site".', array('%site' => $feed['title'])); drupal_set_message(t('Syndicated content from "%site".', array('%site' => $feed['title']));
drupal_set_message($message);
} }
break; break;
default: default:
watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error))); watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error)));
$message = t('failed to parse RSS feed "%site": %error.', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error)); drupal_set_message(t('Failed to parse RSS feed "%site": %error.', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error)));
drupal_set_message($message);
} }
} }
...@@ -447,8 +445,7 @@ function aggregator_parse_feed(&$data, $feed) { ...@@ -447,8 +445,7 @@ function aggregator_parse_feed(&$data, $feed) {
if (!xml_parse($xml_parser, $data, 1)) { if (!xml_parse($xml_parser, $data, 1)) {
watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser)))); watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))));
$message = t('failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))); drupal_set_message(t('Failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))), 'error');
drupal_set_message($message, 'error');
return 0; return 0;
} }
xml_parser_free($xml_parser); xml_parser_free($xml_parser);
...@@ -539,7 +536,7 @@ function aggregator_parse_feed(&$data, $feed) { ...@@ -539,7 +536,7 @@ function aggregator_parse_feed(&$data, $feed) {
} }
if (!valid_input_data($item['DESCRIPTION'])) { if (!valid_input_data($item['DESCRIPTION'])) {
drupal_set_message(t('failed to parse entry from "%site" feed: suspicious input data.', array('%site' => $feed['title'])), 'error'); drupal_set_message(t('Failed to parse entry from "%site" feed: suspicious input data.', array('%site' => $feed['title'])), 'error');
} }
else { else {
aggregator_save_item(array('iid' => $entry->iid, 'fid' => $feed['fid'], 'timestamp' => $timestamp, 'title' => $title, 'link' => $link, 'author' => $item['AUTHOR'], 'description' => $item['DESCRIPTION'])); aggregator_save_item(array('iid' => $entry->iid, 'fid' => $feed['fid'], 'timestamp' => $timestamp, 'title' => $title, 'link' => $link, 'author' => $item['AUTHOR'], 'description' => $item['DESCRIPTION']));
......
...@@ -260,7 +260,7 @@ function aggregator_remove($feed) { ...@@ -260,7 +260,7 @@ function aggregator_remove($feed) {
} }
db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $feed['fid']); db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $feed['fid']);
db_query("UPDATE {aggregator_feed} SET checked = 0, etag = '', modified = 0 WHERE fid = %d", $feed['fid']); db_query("UPDATE {aggregator_feed} SET checked = 0, etag = '', modified = 0 WHERE fid = %d", $feed['fid']);
drupal_set_message(t('removed news items from \'%site\'.', array('%site' => $feed['title']))); drupal_set_message(t('Removed news items from \'%site\'.', array('%site' => $feed['title'])));
} }
/** /**
...@@ -340,7 +340,7 @@ function aggregator_refresh($feed) { ...@@ -340,7 +340,7 @@ function aggregator_refresh($feed) {
switch ($result->code) { switch ($result->code) {
case 304: case 304:
db_query('UPDATE {aggregator_feed} SET checked = %d WHERE fid = %d', time(), $feed['fid']); db_query('UPDATE {aggregator_feed} SET checked = %d WHERE fid = %d', time(), $feed['fid']);
drupal_set_message(t('no new syndicated content from "%site".', array('%site' => $feed['title']))); drupal_set_message(t('No new syndicated content from "%site".', array('%site' => $feed['title'])));
break; break;
case 301: case 301:
$feed['url'] = $result->redirect_url; $feed['url'] = $result->redirect_url;
...@@ -383,14 +383,12 @@ function aggregator_refresh($feed) { ...@@ -383,14 +383,12 @@ function aggregator_refresh($feed) {
cache_clear_all(); cache_clear_all();
watchdog('regular', t('aggregator: syndicated content from "%site"', array('%site' => $feed[title]))); watchdog('regular', t('aggregator: syndicated content from "%site"', array('%site' => $feed[title])));
$message = t('syndicated content from "%site".', array('%site' => $feed['title'])); drupal_set_message(t('Syndicated content from "%site".', array('%site' => $feed['title']));
drupal_set_message($message);
} }
break; break;
default: default:
watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error))); watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error)));
$message = t('failed to parse RSS feed "%site": %error.', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error)); drupal_set_message(t('Failed to parse RSS feed "%site": %error.', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error)));
drupal_set_message($message);
} }
} }
...@@ -447,8 +445,7 @@ function aggregator_parse_feed(&$data, $feed) { ...@@ -447,8 +445,7 @@ function aggregator_parse_feed(&$data, $feed) {
if (!xml_parse($xml_parser, $data, 1)) { if (!xml_parse($xml_parser, $data, 1)) {
watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser)))); watchdog('error', t('aggregator: failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))));
$message = t('failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))); drupal_set_message(t('Failed to parse RSS feed "%site": %error at line %line.', array('%site' => $feed['title'], '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))), 'error');
drupal_set_message($message, 'error');
return 0; return 0;
} }
xml_parser_free($xml_parser); xml_parser_free($xml_parser);
...@@ -539,7 +536,7 @@ function aggregator_parse_feed(&$data, $feed) { ...@@ -539,7 +536,7 @@ function aggregator_parse_feed(&$data, $feed) {
} }
if (!valid_input_data($item['DESCRIPTION'])) { if (!valid_input_data($item['DESCRIPTION'])) {
drupal_set_message(t('failed to parse entry from "%site" feed: suspicious input data.', array('%site' => $feed['title'])), 'error'); drupal_set_message(t('Failed to parse entry from "%site" feed: suspicious input data.', array('%site' => $feed['title'])), 'error');
} }
else { else {
aggregator_save_item(array('iid' => $entry->iid, 'fid' => $feed['fid'], 'timestamp' => $timestamp, 'title' => $title, 'link' => $link, 'author' => $item['AUTHOR'], 'description' => $item['DESCRIPTION'])); aggregator_save_item(array('iid' => $entry->iid, 'fid' => $feed['fid'], 'timestamp' => $timestamp, 'title' => $title, 'link' => $link, 'author' => $item['AUTHOR'], 'description' => $item['DESCRIPTION']));
......
...@@ -244,11 +244,11 @@ function block_box_save($edit) { ...@@ -244,11 +244,11 @@ function block_box_save($edit) {
if ($edit['bid']) { if ($edit['bid']) {
db_query("UPDATE {boxes} SET title = '%s', body = '%s', info = '%s', format = %d WHERE bid = %d", $edit['title'], $edit['body'], $edit['info'], $edit['format'], $edit['bid']); db_query("UPDATE {boxes} SET title = '%s', body = '%s', info = '%s', format = %d WHERE bid = %d", $edit['title'], $edit['body'], $edit['info'], $edit['format'], $edit['bid']);
return t('the block has been updated.'); return t('The block has been updated.');
} }
else { else {
db_query("INSERT INTO {boxes} (title, body, info, format) VALUES ('%s', '%s', '%s', %d)", $edit['title'], $edit['body'], $edit['info'], $edit['format']); db_query("INSERT INTO {boxes} (title, body, info, format) VALUES ('%s', '%s', '%s', %d)", $edit['title'], $edit['body'], $edit['info'], $edit['format']);
return t('the new block has been added.'); return t('The new block has been added.');
} }
} }
...@@ -258,7 +258,7 @@ function block_box_save($edit) { ...@@ -258,7 +258,7 @@ function block_box_save($edit) {
function block_box_delete($bid = 0) { function block_box_delete($bid = 0) {
if ($bid) { if ($bid) {
db_query('DELETE FROM {boxes} WHERE bid = %d', $bid); db_query('DELETE FROM {boxes} WHERE bid = %d', $bid);
drupal_set_message(t('the block has been deleted.')); drupal_set_message(t('The block has been deleted.'));
cache_clear_all(); cache_clear_all();
} }
print theme('page', block_admin_display()); print theme('page', block_admin_display());
......
...@@ -244,11 +244,11 @@ function block_box_save($edit) { ...@@ -244,11 +244,11 @@ function block_box_save($edit) {
if ($edit['bid']) { if ($edit['bid']) {
db_query("UPDATE {boxes} SET title = '%s', body = '%s', info = '%s', format = %d WHERE bid = %d", $edit['title'], $edit['body'], $edit['info'], $edit['format'], $edit['bid']); db_query("UPDATE {boxes} SET title = '%s', body = '%s', info = '%s', format = %d WHERE bid = %d", $edit['title'], $edit['body'], $edit['info'], $edit['format'], $edit['bid']);
return t('the block has been updated.'); return t('The block has been updated.');
} }
else { else {
db_query("INSERT INTO {boxes} (title, body, info, format) VALUES ('%s', '%s', '%s', %d)", $edit['title'], $edit['body'], $edit['info'], $edit['format']); db_query("INSERT INTO {boxes} (title, body, info, format) VALUES ('%s', '%s', '%s', %d)", $edit['title'], $edit['body'], $edit['info'], $edit['format']);
return t('the new block has been added.'); return t('The new block has been added.');
} }
} }
...@@ -258,7 +258,7 @@ function block_box_save($edit) { ...@@ -258,7 +258,7 @@ function block_box_save($edit) {
function block_box_delete($bid = 0) { function block_box_delete($bid = 0) {
if ($bid) { if ($bid) {
db_query('DELETE FROM {boxes} WHERE bid = %d', $bid); db_query('DELETE FROM {boxes} WHERE bid = %d', $bid);
drupal_set_message(t('the block has been deleted.')); drupal_set_message(t('The block has been deleted.'));
cache_clear_all(); cache_clear_all();
} }
print theme('page', block_admin_display()); print theme('page', block_admin_display());
......
...@@ -240,17 +240,17 @@ function book_node_link($node = 0) { ...@@ -240,17 +240,17 @@ function book_node_link($node = 0) {
if ($op == t('Add to book outline')) { if ($op == t('Add to book outline')) {
db_query('INSERT INTO {book} (nid, parent, weight) VALUES (%d, %d, %d)', $node->nid, $edit['parent'], $edit['weight']); db_query('INSERT INTO {book} (nid, parent, weight) VALUES (%d, %d, %d)', $node->nid, $edit['parent'], $edit['weight']);
drupal_set_message(t('added the node to the book.')); drupal_set_message(t('Added the node to the book.'));
} }
if ($op == t('Update book outline')) { if ($op == t('Update book outline')) {
db_query('UPDATE {book} SET parent = %d, weight = %d WHERE nid = %d', $edit['parent'], $edit['weight'], $node->nid); db_query('UPDATE {book} SET parent = %d, weight = %d WHERE nid = %d', $edit['parent'], $edit['weight'], $node->nid);
drupal_set_message(t('updated the book outline.')); drupal_set_message(t('Updated the book outline.'));
} }
if ($op == t('Remove from book outline')) { if ($op == t('Remove from book outline')) {
db_query('DELETE FROM {book} WHERE nid = %d', $node->nid); db_query('DELETE FROM {book} WHERE nid = %d', $node->nid);
drupal_set_message(t('removed the node form the book.')); drupal_set_message(t('Removed the node form the book.'));
} }
$output .= '<h3>'. t('Edit book outline for node "%booktitle"', array('%booktitle' => '<em>'. $node->title .'</em>')) .'</h3>'; $output .= '<h3>'. t('Edit book outline for node "%booktitle"', array('%booktitle' => '<em>'. $node->title .'</em>')) .'</h3>';
......
...@@ -240,17 +240,17 @@ function book_node_link($node = 0) { ...@@ -240,17 +240,17 @@ function book_node_link($node = 0) {
if ($op == t('Add to book outline')) { if ($op == t('Add to book outline')) {
db_query('INSERT INTO {book} (nid, parent, weight) VALUES (%d, %d, %d)', $node->nid, $edit['parent'], $edit['weight']); db_query('INSERT INTO {book} (nid, parent, weight) VALUES (%d, %d, %d)', $node->nid, $edit['parent'], $edit['weight']);
drupal_set_message(t('added the node to the book.')); drupal_set_message(t('Added the node to the book.'));
} }
if ($op == t('Update book outline')) { if ($op == t('Update book outline')) {
db_query('UPDATE {book} SET parent = %d, weight = %d WHERE nid = %d', $edit['parent'], $edit['weight'], $node->nid); db_query('UPDATE {book} SET parent = %d, weight = %d WHERE nid = %d', $edit['parent'], $edit['weight'], $node->nid);
drupal_set_message(t('updated the book outline.')); drupal_set_message(t('Updated the book outline.'));
} }
if ($op == t('Remove from book outline')) { if ($op == t('Remove from book outline')) {
db_query('DELETE FROM {book} WHERE nid = %d', $node->nid); db_query('DELETE FROM {book} WHERE nid = %d', $node->nid);
drupal_set_message(t('removed the node form the book.')); drupal_set_message(t('Removed the node form the book.'));
} }
$output .= '<h3>'. t('Edit book outline for node "%booktitle"', array('%booktitle' => '<em>'. $node->title .'</em>')) .'</h3>'; $output .= '<h3>'. t('Edit book outline for node "%booktitle"', array('%booktitle' => '<em>'. $node->title .'</em>')) .'</h3>';
......
...@@ -980,7 +980,7 @@ function comment_delete($cid) { ...@@ -980,7 +980,7 @@ function comment_delete($cid) {
// We'll only delete if the user has confirmed the // We'll only delete if the user has confirmed the
// deletion using the form in our else clause below. // deletion using the form in our else clause below.
if ($comment->cid && $_POST['op'] == t('Delete comment')) { if ($comment->cid && $_POST['op'] == t('Delete comment')) {
drupal_set_message(t('the comment and all its replies have been deleted.')); drupal_set_message(t('The comment and all its replies have been deleted.'));
// Delete comment and its replies. // Delete comment and its replies.
_comment_delete_thread($comment); _comment_delete_thread($comment);
...@@ -992,13 +992,13 @@ function comment_delete($cid) { ...@@ -992,13 +992,13 @@ function comment_delete($cid) {
// Print a confirmation. // Print a confirmation.
else if ($comment->cid) { else if ($comment->cid) {
drupal_set_message(t('do you want to delete this comment and all its replies?')); drupal_set_message(t('Do you want to delete this comment and all its replies?'));
$comment->comment = check_output($comment->comment, $comment->format); $comment->comment = check_output($comment->comment, $comment->format);
$output = theme('comment', $comment); $output = theme('comment', $comment);
$output .= form_submit(t('Delete comment')); $output .= form_submit(t('Delete comment'));
} }
else { else {
drupal_set_message(t('the comment no longer exists.')); drupal_set_message(t('The comment no longer exists.'));
} }
print theme('page', form($output)); print theme('page', form($output));
...@@ -1007,7 +1007,7 @@ function comment_delete($cid) { ...@@ -1007,7 +1007,7 @@ function comment_delete($cid) {
function comment_save($id, $edit) { function comment_save($id, $edit) {
db_query("UPDATE {comments} SET subject = '%s', comment = '%s', status = %d WHERE cid = %d", $edit['subject'], $edit['comment'], $edit['status'], $id); db_query("UPDATE {comments} SET subject = '%s', comment = '%s', status = %d WHERE cid = %d", $edit['subject'], $edit['comment'], $edit['status'], $id);
watchdog('special', t('comment: modified "%comment-subject"', array('%comment-subject' => $edit['subject']))); watchdog('special', t('comment: modified "%comment-subject"', array('%comment-subject' => $edit['subject'])));
drupal_set_message(t('the comment has been saved.')); drupal_set_message(t('The comment has been saved.'));
} }
/** /**
...@@ -1060,7 +1060,7 @@ function comment_matrix_settings() { ...@@ -1060,7 +1060,7 @@ function comment_matrix_settings() {
db_query('INSERT INTO {moderation_roles} (mid, rid, value) VALUES '. $sql); db_query('INSERT INTO {moderation_roles} (mid, rid, value) VALUES '. $sql);
} }
} }
drupal_set_message(t('the vote values have been saved.')); drupal_set_message(t('The vote values have been saved.'));
} }
$output .= '<h3>Moderation vote/value matrix</h3>'; $output .= '<h3>Moderation vote/value matrix</h3>';
...@@ -1107,7 +1107,7 @@ function comment_role_settings() { ...@@ -1107,7 +1107,7 @@ function comment_role_settings() {
if ($edit) { if ($edit) {
variable_set('comment_roles', $edit); variable_set('comment_roles', $edit);
drupal_set_message(t('the comment scores have been saved.')); drupal_set_message(t('The comment scores have been saved.'));
} }
$start_values = variable_get('comment_roles', array()); $start_values = variable_get('comment_roles', array());
...@@ -1136,18 +1136,18 @@ function comment_vote_settings($mid = 0) { ...@@ -1136,18 +1136,18 @@ function comment_vote_settings($mid = 0) {
if ($op == t('Save vote')) { if ($op == t('Save vote')) {
db_query("UPDATE {moderation_votes} SET vote = '%s', weight = %d WHERE mid = %d", $edit['vote'], $edit['weight'], $mid); db_query("UPDATE {moderation_votes} SET vote = '%s', weight = %d WHERE mid = %d", $edit['vote'], $edit['weight'], $mid);
$mid = 0; // zero it out so we return to the overview. $mid = 0; // zero it out so we return to the overview.
drupal_set_message(t('the vote has been saved.')); drupal_set_message(t('The vote has been saved.'));
} }
else if ($op == t('Delete vote')) { else if ($op == t('Delete vote')) {
db_query('DELETE FROM {moderation_votes} WHERE mid = %d', $mid); db_query('DELETE FROM {moderation_votes} WHERE mid = %d', $mid);
db_query('DELETE FROM {moderation_roles} WHERE mid = %d', $mid); db_query('DELETE FROM {moderation_roles} WHERE mid = %d', $mid);
$mid = 0; // zero it out so we return to the overview. $mid = 0; // zero it out so we return to the overview.
drupal_set_message(t('the vote has been deleted.')); drupal_set_message(t('The vote has been deleted.'));
} }
else if ($op == t('Add new vote')) { else if ($op == t('Add new vote')) {
db_query("INSERT INTO {moderation_votes} (vote, weight) VALUES ('%s', %d)", $edit['vote'], $edit['weight']); db_query("INSERT INTO {moderation_votes} (vote, weight) VALUES ('%s', %d)", $edit['vote'], $edit['weight']);
$mid = 0; // zero it out so we return to the overview. $mid = 0; // zero it out so we return to the overview.
drupal_set_message(t('the vote has been added.')); drupal_set_message(t('The vote has been added.'));
} }
$output .= '<h3>'. t('Moderation votes overview') .'</h3>'; $output .= '<h3>'. t('Moderation votes overview') .'</h3>';
...@@ -1191,17 +1191,17 @@ function comment_threshold_settings($fid = 0) { ...@@ -1191,17 +1191,17 @@ function comment_threshold_settings($fid = 0) {
if ($op == t('Save threshold')) { if ($op == t('Save threshold')) {
db_query("UPDATE {moderation_filters} SET filter = '%s', minimum = %d WHERE fid = %d", $edit['filter'], $edit['minimum'], $fid); db_query("UPDATE {moderation_filters} SET filter = '%s', minimum = %d WHERE fid = %d", $edit['filter'], $edit['minimum'], $fid);
$fid = 0; // zero it out so we return to the overview. $fid = 0; // zero it out so we return to the overview.
drupal_set_message(t('the threshold has been saved.')); drupal_set_message(t('The threshold has been saved.'));
} }
else if ($op == t('Delete threshold')) { else if ($op == t('Delete threshold')) {
db_query('DELETE FROM {moderation_filters} WHERE fid = %d', $fid); db_query('DELETE FROM {moderation_filters} WHERE fid = %d', $fid);
$fid = 0; // zero it out so we return to the overview. $fid = 0; // zero it out so we return to the overview.
drupal_set_message(t('the threshold has been deleted.')); drupal_set_message(t('The threshold has been deleted.'));
} }
else if ($op == t('Add new threshold')) { else if ($op == t('Add new threshold')) {
db_query("INSERT INTO {moderation_filters} (filter, minimum) VALUES ('%s', %d)", $edit['filter'], $edit['minimum']); db_query("INSERT INTO {moderation_filters} (filter, minimum) VALUES ('%s', %d)", $edit['filter'], $edit['minimum']);
$fid = 0; // zero it out so we return to the overview. $fid = 0; // zero it out so we return to the overview.
drupal_set_message(t('the threshold has been added.')); drupal_set_message(t('The threshold has been added.'));
} }
$output .= '<h3>Comment threshold overview</h3>'; $output .= '<h3>Comment threshold overview</h3>';
......
...@@ -980,7 +980,7 @@ function comment_delete($cid) { ...@@ -980,7 +980,7 @@ function comment_delete($cid) {
// We'll only delete if the user has confirmed the // We'll only delete if the user has confirmed the
// deletion using the form in our else clause below. // deletion using the form in our else clause below.
if ($comment->cid && $_POST['op'] == t('Delete comment')) { if ($comment->cid && $_POST['op'] == t('Delete comment')) {
drupal_set_message(t('the comment and all its replies have been deleted.'));