Commit 2debcfb1 authored by Dries's avatar Dries

- Patch #15595 by Stefan and Djun: improved status messages.

  TODO: we should write down a couple guidelines for these document them in
        the PHPDoc code of drupal_set_message()!  .
parent 381853c6
......@@ -4,9 +4,9 @@ Drupal x.x.x, xxxx-xx-xx (Development version)
- added free tagging support (folksonomies).
- added a site-wide contact form.
- theme system:
* removed the Xtemplate theme engine.
* added the PHPTemplate theme engine.
* added the PHPTemplate theme engine and removed the Xtemplate engine.
* converted the bluemarine theme from XTemplate to PHPTemplate.
* converted the pushbutton theme from XTemplate to PHPTemplate.
- reworked the 'request new password' functionality.
- profiles:
* added a block to display author information along with posts.
......
......@@ -76,7 +76,7 @@ function file_check_directory(&$directory, $mode = 0, $form_item = NULL) {
// Check if directory exists.
if (!is_dir($directory)) {
if (($mode & FILE_CREATE_DIRECTORY) && @mkdir($directory, 0760)) {
drupal_set_message(t('Created directory %directory.', array('%directory' => theme('placeholder', $directory))));
drupal_set_message(t('The directory %directory has been created.', array('%directory' => theme('placeholder', $directory))));
}
else {
if ($form_item) {
......@@ -89,10 +89,11 @@ function file_check_directory(&$directory, $mode = 0, $form_item = NULL) {
// Check to see if the directory is writable.
if (!is_writable($directory)) {
if (($mode & FILE_MODIFY_PERMISSIONS) && @chmod($directory, 0760)) {
drupal_set_message(t('Modified permissions on directory %directory.', array('%directory' => theme('placeholder', $directory))));
drupal_set_message(t('The permissions of directory %directory have been changed to make it writable.', array('%directory' => theme('placeholder', $directory))));
}
else {
form_set_error($form_item, t('The directory %directory is not writable.', array('%directory' => theme('placeholder', $directory))));
form_set_error($form_item, t('The directory %directory is not writable', array('%directory' => theme('placeholder', $directory))));
watchdog('file system', t('The directory %directory is not writable, because it does not have the correct permissions set.', array('%directory' => theme('placeholder', $directory))), WATCHDOG_ERROR);
return false;
}
}
......@@ -199,7 +200,8 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
// Make sure we at least have a valid directory.
if ($basename === false) {
drupal_set_message(t('File copy failed: no directory configured, or it could not be accessed.'), 'error');
drupal_set_message(t('The selected file %file could not be uploaded, because the destination %directory is not properly configured.', array('%file' => theme('placeholder', $source), '%directory' => theme('placeholder', $dest))), 'error');
watchdog('file system', t('The selected file %file could not not be uploaded, because the destination %directory could not be found, or because its permissions do not allow the file to be written.', array('%file' => theme('placeholder', $source), '%directory' => theme('placeholder', $dest))), WATCHDOG_ERROR);
return 0;
}
......@@ -214,11 +216,11 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
$source = realpath($source);
if (!file_exists($source)) {
drupal_set_message(t('File copy failed: source file does not exist.'), 'error');
drupal_set_message(t('The selected file %file could not be copied, because no file by that name exists. Please check that you supplied the correct filename.', array('%file' => theme('placeholder', $source))), 'error');
return 0;
}
// If destination file is not specified then use filename of source file.
// If the destination file is not specified then use the filename of the source file.
$basename = $basename ? $basename : basename($source);
$dest = $directory .'/'. $basename;
......@@ -246,7 +248,7 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
break;
case FILE_EXISTS_ERROR:
drupal_set_message(t('File copy failed. File already exists.'), 'error');
drupal_set_message(t('The selected file %file could not be copied, because a file by that name already exists in the destination.', array('%file' => theme('placeholder', $source))), 'error');
return 0;
case FILE_EXISTS_REPLACE:
......@@ -255,7 +257,7 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
}
if (!@copy($source, $dest)) {
drupal_set_message(t('File copy failed.'), 'error');
drupal_set_message(t('The selected file %file could not be copied.', array('%file' => theme('placeholder', $source))), 'error');
return 0;
}
}
......@@ -299,7 +301,7 @@ function file_move(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
if ($path_original == $path_current || file_delete($path_original)) {
return 1;
}
drupal_set_message(t('Removing original file failed.'), 'error');
drupal_set_message(t('The removal of the original file %file has failed.', array('%file' => theme('placeholder', $source))), 'error');
}
return 0;
}
......@@ -358,25 +360,25 @@ function file_save_upload($source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
}
if (!user_access('bypass input data check') && !valid_input_data($file)) {
watchdog('security', t('Possible exploit abuse: invalid data.'), WATCHDOG_WARNING);
drupal_set_message(t('File upload failed: invalid data.'), 'error');
watchdog('security', t('The file %file has not been saved, because it may contain a possible attempt to exploit or abuse this system.', array('%file' => theme('placeholder', $source))), WATCHDOG_WARNING);
drupal_set_message(t('The file %file has not been saved, because it contains invalid data.', array('%file' => theme('placeholder', $source))), 'error');
return 0;
}
// Check for file upload errors.
switch ($file->error) {
case 0: // UPLOAD_ERR_OK
case 0: // UPLOAD_ERR_OK: File uploaded successfully
break;
case 1: // UPLOAD_ERR_INI_SIZE
case 2: // UPLOAD_ERR_FORM_SIZE
drupal_set_message(t('File upload failed: file size too big.'), 'error');
case 1: // UPLOAD_ERR_INI_SIZE: File size exceeded php.ini value
case 2: // UPLOAD_ERR_FORM_SIZE: File size exceeded MAX_FILE_SIZE form value
drupal_set_message(t('The file %file could not be saved, because it exceeds the maximum allowed size for uploads.', array('%file' => theme('placeholder', $source))), 'error');
return 0;
case 3: // UPLOAD_ERR_PARTIAL
case 4: // UPLOAD_ERR_NO_FILE
drupal_set_message(t('File upload failed: incomplete upload.'), 'error');
case 3: // UPLOAD_ERR_PARTIAL: File was only partially uploaded
case 4: // UPLOAD_ERR_NO_FILE: No file was uploaded
drupal_set_message(t('The file %file could not be saved, because the upload did not complete.', array('%file' => theme('placeholder', $source))), 'error');
return 0;
default: // Unknown error
drupal_set_message(t('File upload failed: unknown error.'), 'error');
drupal_set_message(t('The file %file could not be saved. An unknown error has occurred.', array('%file' => theme('placeholder', $source))),'error');
return 0;
}
......@@ -402,15 +404,15 @@ function file_save_upload($source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
*/
function file_save_data($data, $dest, $replace = FILE_EXISTS_RENAME) {
if (!user_access('bypass input data check') && !valid_input_data($data)) {
watchdog('security', t('Possible exploit abuse: invalid data.'), WATCHDOG_WARNING);
drupal_set_message(t('File upload failed: invalid data.'), 'error');
watchdog('security', t('The file has not been saved, because it may contain a possible attempt to exploit or abuse this system.'), WATCHDOG_WARNING);
drupal_set_message(t('The file has not been saved, because it contains invalid data.'), 'error');
return 0;
}
$temp = variable_get('file_directory_temp', FILE_DIRECTORY_TEMP);
$file = tempnam($temp, 'file');
if (!$fp = fopen($file, 'wb')) {
drupal_set_message(t('Unable to create file.'), 'error');
drupal_set_message(t('The file could not be created.'), 'error');
return 0;
}
fwrite($fp, $data);
......
This diff is collapsed.
......@@ -814,19 +814,8 @@ function theme_item_list($items = array(), $title = NULL) {
}
/**
* Return a themed error message.
* REMOVE: this function is deprecated an no longer used in core.
*
* @param $message
* The error message to be themed.
*
* @return
* A string containing the error output.
* Returns code that emits the 'more help'-link.
*/
function theme_error($message) {
return '<div class="error">'. $message .'</div>';
}
function theme_more_help_link($url) {
return '<div class="more-help-link">' . t('[<a href="%link">more help...</a>]', array('%link' => $url)) . '</div>';
}
......
......@@ -268,7 +268,7 @@ function aggregator_remove($feed) {
}
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']);
drupal_set_message(t('Removed news items from %site.', array('%site' => theme('placeholder', $feed['title']))));
drupal_set_message(t('The news items from %site have been removed.', array('%site' => theme('placeholder', $feed['title']))));
}
/**
......@@ -348,7 +348,7 @@ function aggregator_refresh($feed) {
switch ($result->code) {
case 304:
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' => theme('placeholder', $feed['title']))));
drupal_set_message(t('There is no new syndicated content from %site.', array('%site' => theme('placeholder', $feed['title']))));
break;
case 301:
$feed['url'] = $result->redirect_url;
......@@ -400,15 +400,13 @@ function aggregator_refresh($feed) {
cache_clear_all();
$message = t('Syndicated content from %site.', array('%site' => theme('placeholder', $feed[title])));
watchdog('aggregator', $message);
drupal_set_message($message);
watchdog('aggregator', t('There is new syndicated content from %site.', array('%site' => theme('placeholder', $feed[title]))));
drupal_set_message(t('There is new syndicated content from %site.', array('%site' => theme('placeholder', $feed[title]))));
}
break;
default:
$message = t('Failed to parse RSS feed %site: %error.', array('%site' => theme('placeholder', $feed['title']), '%error' => theme('placeholder', $result->code .' '. $result->error)));
watchdog('aggregator', $message, WATCHDOG_WARNING);
drupal_set_message($message);
watchdog('aggregator', t('The RSS-feed from %site seems to be broken, due to "%error".', array('%site' => theme('placeholder', $feed['title']), '%error' => theme('placeholder', $result->code .' '. $result->error))), WATCHDOG_WARNING);
drupal_set_message(t('The RSS-feed from %site seems to be broken, because of error "%error".', array('%site' => theme('placeholder', $feed['title']), '%error' => theme('placeholder', $result->code .' '. $result->error))));
}
}
......@@ -464,9 +462,8 @@ function aggregator_parse_feed(&$data, $feed) {
xml_set_character_data_handler($xml_parser, 'aggregator_element_data');
if (!xml_parse($xml_parser, $data, 1)) {
$message = t('Failed to parse RSS feed %site: %error at line %line.', array('%site' => theme('placeholder', $feed['title']), '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser)));
watchdog('aggregator', $message, WATCHDOG_WARNING);
drupal_set_message($message, 'error');
watchdog('aggregator', t('The RSS-feed from %site seems to be broken, due to an error "%error" on line %line.', array('%site' => theme('placeholder', $feed['title']), '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))), WATCHDOG_WARNING);
drupal_set_message(t('The RSS-feed from %site seems to be broken, because of error "%error" on line %line.', array('%site' => theme('placeholder', $feed['title']), '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))), 'error');
return 0;
}
xml_parser_free($xml_parser);
......@@ -553,7 +550,7 @@ function aggregator_parse_feed(&$data, $feed) {
}
if (!valid_input_data($item['DESCRIPTION'])) {
drupal_set_message(t('Failed to parse entry from %site feed: suspicious input data.', array('%site' => theme('placeholder', $feed['title']))), 'error');
drupal_set_message(t('The RSS feed from %site seems to be broken, because of suspicious input data.', array('%site' => theme('placeholder', $feed['title']))), 'error');
}
else {
aggregator_save_item(array('iid' => $entry->iid, 'fid' => $feed['fid'], 'timestamp' => $timestamp, 'title' => $title, 'link' => $link, 'author' => $item['AUTHOR'], 'description' => $item['DESCRIPTION']));
......@@ -783,7 +780,7 @@ function aggregator_admin_edit_category($category = 0) {
// Fall through:
case t('Submit'):
aggregator_save_category($edit);
drupal_set_message($edit['title'] ? t('The category has been updated.') : t('The category has been deleted.'));
drupal_set_message($edit['title'] ? t('The category has been updated.') : t('The category has been removed.'));
menu_rebuild();
drupal_goto('admin/aggregator');
break;
......@@ -813,7 +810,7 @@ function aggregator_admin_edit_feed($feed = 0) {
// Fall through:
case t('Submit'):
aggregator_save_feed($edit);
drupal_set_message($edit['title'] ? t('The feed has been updated.') : t('The feed has been deleted.'));
drupal_set_message($edit['title'] ? t('The feed has been updated.') : t('The feed has been removed.'));
menu_rebuild();
drupal_goto('admin/aggregator');
break;
......
......@@ -268,7 +268,7 @@ function aggregator_remove($feed) {
}
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']);
drupal_set_message(t('Removed news items from %site.', array('%site' => theme('placeholder', $feed['title']))));
drupal_set_message(t('The news items from %site have been removed.', array('%site' => theme('placeholder', $feed['title']))));
}
/**
......@@ -348,7 +348,7 @@ function aggregator_refresh($feed) {
switch ($result->code) {
case 304:
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' => theme('placeholder', $feed['title']))));
drupal_set_message(t('There is no new syndicated content from %site.', array('%site' => theme('placeholder', $feed['title']))));
break;
case 301:
$feed['url'] = $result->redirect_url;
......@@ -400,15 +400,13 @@ function aggregator_refresh($feed) {
cache_clear_all();
$message = t('Syndicated content from %site.', array('%site' => theme('placeholder', $feed[title])));
watchdog('aggregator', $message);
drupal_set_message($message);
watchdog('aggregator', t('There is new syndicated content from %site.', array('%site' => theme('placeholder', $feed[title]))));
drupal_set_message(t('There is new syndicated content from %site.', array('%site' => theme('placeholder', $feed[title]))));
}
break;
default:
$message = t('Failed to parse RSS feed %site: %error.', array('%site' => theme('placeholder', $feed['title']), '%error' => theme('placeholder', $result->code .' '. $result->error)));
watchdog('aggregator', $message, WATCHDOG_WARNING);
drupal_set_message($message);
watchdog('aggregator', t('The RSS-feed from %site seems to be broken, due to "%error".', array('%site' => theme('placeholder', $feed['title']), '%error' => theme('placeholder', $result->code .' '. $result->error))), WATCHDOG_WARNING);
drupal_set_message(t('The RSS-feed from %site seems to be broken, because of error "%error".', array('%site' => theme('placeholder', $feed['title']), '%error' => theme('placeholder', $result->code .' '. $result->error))));
}
}
......@@ -464,9 +462,8 @@ function aggregator_parse_feed(&$data, $feed) {
xml_set_character_data_handler($xml_parser, 'aggregator_element_data');
if (!xml_parse($xml_parser, $data, 1)) {
$message = t('Failed to parse RSS feed %site: %error at line %line.', array('%site' => theme('placeholder', $feed['title']), '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser)));
watchdog('aggregator', $message, WATCHDOG_WARNING);
drupal_set_message($message, 'error');
watchdog('aggregator', t('The RSS-feed from %site seems to be broken, due to an error "%error" on line %line.', array('%site' => theme('placeholder', $feed['title']), '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))), WATCHDOG_WARNING);
drupal_set_message(t('The RSS-feed from %site seems to be broken, because of error "%error" on line %line.', array('%site' => theme('placeholder', $feed['title']), '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))), 'error');
return 0;
}
xml_parser_free($xml_parser);
......@@ -553,7 +550,7 @@ function aggregator_parse_feed(&$data, $feed) {
}
if (!valid_input_data($item['DESCRIPTION'])) {
drupal_set_message(t('Failed to parse entry from %site feed: suspicious input data.', array('%site' => theme('placeholder', $feed['title']))), 'error');
drupal_set_message(t('The RSS feed from %site seems to be broken, because of suspicious input data.', array('%site' => theme('placeholder', $feed['title']))), 'error');
}
else {
aggregator_save_item(array('iid' => $entry->iid, 'fid' => $feed['fid'], 'timestamp' => $timestamp, 'title' => $title, 'link' => $link, 'author' => $item['AUTHOR'], 'description' => $item['DESCRIPTION']));
......@@ -783,7 +780,7 @@ function aggregator_admin_edit_category($category = 0) {
// Fall through:
case t('Submit'):
aggregator_save_category($edit);
drupal_set_message($edit['title'] ? t('The category has been updated.') : t('The category has been deleted.'));
drupal_set_message($edit['title'] ? t('The category has been updated.') : t('The category has been removed.'));
menu_rebuild();
drupal_goto('admin/aggregator');
break;
......@@ -813,7 +810,7 @@ function aggregator_admin_edit_feed($feed = 0) {
// Fall through:
case t('Submit'):
aggregator_save_feed($edit);
drupal_set_message($edit['title'] ? t('The feed has been updated.') : t('The feed has been deleted.'));
drupal_set_message($edit['title'] ? t('The feed has been updated.') : t('The feed has been removed.'));
menu_rebuild();
drupal_goto('admin/aggregator');
break;
......
......@@ -116,8 +116,6 @@ function block_admin_save($edit) {
$block['region'], $block['status'], $block['weight'], $block['throttle'], $module, $delta);
}
}
return t('The block settings have been updated.');
}
/**
......@@ -300,7 +298,7 @@ function block_box_add() {
switch ($op) {
case t('Save block'):
if (block_box_save($edit)) {
drupal_set_message(t('The new block has been added.'));
drupal_set_message(t('The block has been created.'));
drupal_goto('admin/block');
}
// deliberate no break
......@@ -323,7 +321,7 @@ function block_box_delete($bid = 0) {
if ($_POST['edit']['confirm']) {
db_query('DELETE FROM {boxes} WHERE bid = %d', $bid);
drupal_set_message(t('The block %name has been deleted.', array('%name' => theme('placeholder', $info))));
drupal_set_message(t('The block %name has been removed.', array('%name' => theme('placeholder', $info))));
cache_clear_all();
drupal_goto('admin/block');
}
......@@ -373,7 +371,8 @@ function block_admin() {
$op = $_POST['op'];
if ($op == t('Save blocks')) {
drupal_set_message(block_admin_save($edit));
block_admin_save($edit);
drupal_set_message(t('The blocks have been saved.'));
cache_clear_all();
drupal_goto($_GET['q']);
}
......
......@@ -116,8 +116,6 @@ function block_admin_save($edit) {
$block['region'], $block['status'], $block['weight'], $block['throttle'], $module, $delta);
}
}
return t('The block settings have been updated.');
}
/**
......@@ -300,7 +298,7 @@ function block_box_add() {
switch ($op) {
case t('Save block'):
if (block_box_save($edit)) {
drupal_set_message(t('The new block has been added.'));
drupal_set_message(t('The block has been created.'));
drupal_goto('admin/block');
}
// deliberate no break
......@@ -323,7 +321,7 @@ function block_box_delete($bid = 0) {
if ($_POST['edit']['confirm']) {
db_query('DELETE FROM {boxes} WHERE bid = %d', $bid);
drupal_set_message(t('The block %name has been deleted.', array('%name' => theme('placeholder', $info))));
drupal_set_message(t('The block %name has been removed.', array('%name' => theme('placeholder', $info))));
cache_clear_all();
drupal_goto('admin/block');
}
......@@ -373,7 +371,8 @@ function block_admin() {
$op = $_POST['op'];
if ($op == t('Save blocks')) {
drupal_set_message(block_admin_save($edit));
block_admin_save($edit);
drupal_set_message(t('The blocks have been saved.'));
cache_clear_all();
drupal_goto($_GET['q']);
}
......
......@@ -248,19 +248,19 @@ function book_outline() {
switch ($op) {
case t('Add to book outline'):
db_query('INSERT INTO {book} (nid, parent, weight) VALUES (%d, %d, %d)', $node->nid, $edit['parent'], $edit['weight']);
drupal_set_message(t('Added the post to the book.'));
drupal_set_message(t('The post has been added to the book.'));
drupal_goto("node/$node->nid");
break;
case t('Update book outline'):
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('The book outline has been updated.'));
drupal_goto("node/$node->nid");
break;
case t('Remove from book outline'):
db_query('DELETE FROM {book} WHERE nid = %d', $node->nid);
drupal_set_message(t('Removed the post from the book.'));
drupal_set_message(t('The post has been removed from the book.'));
drupal_goto("node/$node->nid");
break;
......@@ -424,7 +424,7 @@ function book_nodeapi(&$node, $op, $teaser, $page) {
$book = db_fetch_array(db_query('SELECT * FROM {book} WHERE nid = %d', $node->nid));
if ($book) {
if ($node->moderate && user_access('administer nodes')) {
drupal_set_message(t("This update/post awaits moderation and won't be accessible until approved."));
drupal_set_message(t("The post has been submitted for moderation and won't be accessible until it has been approved."));
}
foreach ($book as $key => $value) {
......@@ -666,8 +666,6 @@ function book_admin_edit_line($node, $depth = 0) {
function book_admin_edit_book($nid, $depth = 1) {
$result = db_query(db_rewrite_sql('SELECT n.nid FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = %d ORDER BY b.weight, n.title'), $nid);
$rows = array();
while ($node = db_fetch_object($result)) {
$node = node_load(array('nid' => $node->nid));
$rows[] = book_admin_edit_line($node, $depth);
......@@ -716,7 +714,7 @@ function book_admin_save($nid, $edit = array()) {
}
}
$message = t('Updated book %title.', array('%title' => theme('placeholder', $book->title)));
$message = t('The book %title has been updated.', array('%title' => theme('placeholder', $book->title)));
watchdog('content', $message);
return $message;
......
......@@ -248,19 +248,19 @@ function book_outline() {
switch ($op) {
case t('Add to book outline'):
db_query('INSERT INTO {book} (nid, parent, weight) VALUES (%d, %d, %d)', $node->nid, $edit['parent'], $edit['weight']);
drupal_set_message(t('Added the post to the book.'));
drupal_set_message(t('The post has been added to the book.'));
drupal_goto("node/$node->nid");
break;
case t('Update book outline'):
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('The book outline has been updated.'));
drupal_goto("node/$node->nid");
break;
case t('Remove from book outline'):
db_query('DELETE FROM {book} WHERE nid = %d', $node->nid);
drupal_set_message(t('Removed the post from the book.'));
drupal_set_message(t('The post has been removed from the book.'));
drupal_goto("node/$node->nid");
break;
......@@ -424,7 +424,7 @@ function book_nodeapi(&$node, $op, $teaser, $page) {
$book = db_fetch_array(db_query('SELECT * FROM {book} WHERE nid = %d', $node->nid));
if ($book) {
if ($node->moderate && user_access('administer nodes')) {
drupal_set_message(t("This update/post awaits moderation and won't be accessible until approved."));
drupal_set_message(t("The post has been submitted for moderation and won't be accessible until it has been approved."));
}
foreach ($book as $key => $value) {
......@@ -666,8 +666,6 @@ function book_admin_edit_line($node, $depth = 0) {
function book_admin_edit_book($nid, $depth = 1) {
$result = db_query(db_rewrite_sql('SELECT n.nid FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = %d ORDER BY b.weight, n.title'), $nid);
$rows = array();
while ($node = db_fetch_object($result)) {
$node = node_load(array('nid' => $node->nid));
$rows[] = book_admin_edit_line($node, $depth);
......@@ -716,7 +714,7 @@ function book_admin_save($nid, $edit = array()) {
}
}
$message = t('Updated book %title.', array('%title' => theme('placeholder', $book->title)));
$message = t('The book %title has been updated.', array('%title' => theme('placeholder', $book->title)));
watchdog('content', $message);
return $message;
......
......@@ -135,7 +135,7 @@ function contact_mail_user() {
watchdog('mail', t('%name-from sent %name-to an e-mail.', array('%name-from' => theme('placeholder', $user->name), '%name-to' => theme('placeholder', $account->name))));
// Set a status message:
drupal_set_message(t('Your message has been sent.'));
drupal_set_message(t('The message has been sent.'));
// Jump to the user's profile page:
drupal_goto("user/$account->uid");
......
......@@ -135,7 +135,7 @@ function contact_mail_user() {
watchdog('mail', t('%name-from sent %name-to an e-mail.', array('%name-from' => theme('placeholder', $user->name), '%name-to' => theme('placeholder', $account->name))));
// Set a status message:
drupal_set_message(t('Your message has been sent.'));
drupal_set_message(t('The message has been sent.'));
// Jump to the user's profile page:
drupal_goto("user/$account->uid");
......
......@@ -325,7 +325,7 @@ function filter_admin_save() {
$name = trim($name);
if (strlen($name) == 0) {
drupal_set_message(t('You must enter a name for this input format.'));
drupal_set_message(t('The input format name must be specified.'));
drupal_goto('admin/filters');
}
else {
......@@ -358,14 +358,14 @@ function filter_admin_add() {
$name = trim($edit['name']);
if (strlen($name) == 0) {
drupal_set_message(t('You must enter a name for this input format.'));
drupal_set_message(t('The input format must have a name.'));
drupal_goto('admin/filters');
}
else {
db_query("INSERT INTO {filter_formats} (name) VALUES ('%s')", $name);
}
drupal_set_message(t('Added input format %format.', array('%format' => theme('placeholder', $edit['name']))));
drupal_set_message(t('Input format %format has been created.', array('%format' => theme('placeholder', $edit['name']))));
drupal_goto('admin/filters');
}
......@@ -386,7 +386,7 @@ function filter_admin_delete() {
cache_clear_all('filter:'. $edit['format'], true);
drupal_set_message(t('Deleted input format %format.', array('%format' => theme('placeholder', $edit['name']))));
drupal_set_message(t('Input format %format has been removed.', array('%format' => theme('placeholder', $edit['name']))));
}
drupal_goto('admin/filters');
}
......@@ -516,7 +516,7 @@ function filter_admin_order_save($format, $weights) {
list($module, $delta) = explode('/', $id);
db_query("UPDATE {filters} SET weight = %d WHERE format = %d AND module = '%s' AND delta = %d", $weight, $format, $module, $delta);
}
drupal_set_message(t('The filter weights have been saved.'));
drupal_set_message(t('The filter ordering has been saved.'));
cache_clear_all('filter:'. $format, true);
......
......@@ -325,7 +325,7 @@ function filter_admin_save() {
$name = trim($name);
if (strlen($name) == 0) {
drupal_set_message(t('You must enter a name for this input format.'));
drupal_set_message(t('The input format name must be specified.'));
drupal_goto('admin/filters');
}
else {
......@@ -358,14 +358,14 @@ function filter_admin_add() {
$name = trim($edit['name']);
if (strlen($name) == 0) {
drupal_set_message(t('You must enter a name for this input format.'));
drupal_set_message(t('The input format must have a name.'));
drupal_goto('admin/filters');
}
else {
db_query("INSERT INTO {filter_formats} (name) VALUES ('%s')", $name);
}
drupal_set_message(t('Added input format %format.', array('%format' => theme('placeholder', $edit['name']))));
drupal_set_message(t('Input format %format has been created.', array('%format' => theme('placeholder', $edit['name']))));
drupal_goto('admin/filters');
}
......@@ -386,7 +386,7 @@ function filter_admin_delete() {
cache_clear_all('filter:'. $edit['format'], true);
drupal_set_message(t('Deleted input format %format.', array('%format' => theme('placeholder', $edit['name']))));
drupal_set_message(t('Input format %format has been removed.', array('%format' => theme('placeholder', $edit['name']))));
}
drupal_goto('admin/filters');
}
......@@ -516,7 +516,7 @@ function filter_admin_order_save($format, $weights) {
list($module, $delta) = explode('/', $id);
db_query("UPDATE {filters} SET weight = %d WHERE format = %d AND module = '%s' AND delta = %d", $weight, $format, $module, $delta);
}
drupal_set_message(t('The filter weights have been saved.'));
drupal_set_message(t('The filter ordering has been saved.'));
cache_clear_all('filter:'. $format, true);
......
......@@ -337,7 +337,7 @@ function forum_block($op = 'list', $delta = 0, $edit = array()) {
switch ($delta) {
case 0:
$title = t('Active forum topics');
$sql = db_rewrite_sql("SELECT n.nid, n.title, l.last_comment_timestamp, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.type='forum' ORDER BY l.last_comment_timestamp DESC");
$sql = db_rewrite_sql("SELECT n.nid, n.title, l.last_comment_timestamp, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.type = 'forum' ORDER BY l.last_comment_timestamp DESC");
$content = node_title_list(db_query_range($sql, 0, variable_get('forum_block_num_0', '5')));
break;
......
......@@ -337,7 +337,7 @@ function forum_block($op = 'list', $delta = 0, $edit = array()) {
switch ($delta) {
case 0:
$title = t('Active forum topics');
$sql = db_rewrite_sql("SELECT n.nid, n.title, l.last_comment_timestamp, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.type='forum' ORDER BY l.last_comment_timestamp DESC");
$sql = db_rewrite_sql("SELECT n.nid, n.title, l.last_comment_timestamp, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.type = 'forum' ORDER BY l.last_comment_timestamp DESC");
$content = node_title_list(db_query_range($sql, 0, variable_get('forum_block_num_0', '5')));
break;
......
This diff is collapsed.
This diff is collapsed.
......@@ -115,7 +115,7 @@ function menu_reset() {
switch ($op) {
case t('Reset all'):
db_query('DELETE FROM {menu}');
drupal_set_message(t('All menu items reset.'));
drupal_set_message(t('The menu items have been reset to their default settings.'));
drupal_goto('admin/menu');
break;
default:
......@@ -161,7 +161,7 @@ function menu_reset_item($mid) {
switch ($op) {
case t('Reset'):
db_query('DELETE FROM {menu} WHERE mid = %d', $mid);
drupal_set_message(t('Menu item reset.'));
drupal_set_message(t("The menu item was reset to its default settings."));
drupal_goto('admin/menu');
break;
default:
......@@ -189,10 +189,10 @@ function menu_delete_item($mid) {
case t('Delete'):
db_query('DELETE FROM {menu} WHERE mid = %d', $mid);
if ($menu->type & MENU_IS_ROOT) {
drupal_set_message(t('Menu deleted.'));
drupal_set_message(t('The menu has been removed.'));
}
else {
drupal_set_message(t('Menu item deleted.'));
drupal_set_message(t('The menu item has been removed.'));
}
drupal_goto('admin/menu');
break;
......@@ -218,7 +218,7 @@ function menu_disable_item($mid) {
$type &= ~MENU_VISIBLE_IN_BREADCRUMB;
$type |= MENU_MODIFIED_BY_ADMIN;
db_query('UPDATE {menu} SET type = %d WHERE mid = %d', $type, $mid);
drupal_set_message(t('Menu item disabled.'));
drupal_set_message(t('The menu item has been disabled.'));
drupal_goto('admin/menu');
}
......@@ -348,12 +348,12 @@ function menu_edit_item_save($edit) {
if ($edit['mid']) {
db_query("UPDATE {menu} SET pid = %d, path = '%s', title = '%s', description = '%s', weight = %d, type = %d WHERE mid = %d", $edit['pid'], $edit['path'], $edit['title'], $edit['description'], $edit['weight'], $edit['type'] | MENU_MODIFIED_BY_ADMIN, $edit['mid']);
drupal_set_message(t('Updated menu item %title.', array('%title' => theme('placeholder', $edit['title']))));
drupal_set_message(t('The menu item %title has been updated.', array('%title' => theme('placeholder', $edit['title']))));
}
else {
$mid = db_next_id('{menu}_mid');
db_query("INSERT INTO {menu} (mid, pid, path, title, description, weight, type) VALUES (%d, %d, '%s', '%s', '%s', %d, %d)", $mid, $edit['pid'], $edit['path'], $edit['title'], $edit['description'], $edit['weight'], $edit['type'] | MENU_MODIFIED_BY_ADMIN);
drupal_set_message(t('Created new menu item %title.', array('%title' => theme('placeholder', $edit['title']))));
drupal_set_message(t('The menu item %title has been created.', array('%title' => theme('placeholder', $edit['title']))));
if (array_key_exists($edit['path'], $menu['path index'])) {
$old_mid = $menu['path index'][$edit['path']];
$old_item = $menu['items'][$old_mid];
......
......@@ -115,7 +115,7 @@ function menu_reset() {
switch ($op) {
case t('Reset all'):
db_query('DELETE FROM {menu}');
drupal_set_message(t('All menu items reset.'));
drupal_set_message(t('The menu items have been reset to their default settings.'));
drupal_goto('admin/menu');
break;
default:
......@@ -161,7 +161,7 @@ function menu_reset_item($mid) {
switch ($op) {
case t('Reset'):
db_query('DELETE FROM {menu} WHERE mid = %d', $mid);
drupal_set_message(t('Menu item reset.'));
drupal_set_message(t("The menu item was reset to its default settings."));
drupal_goto('admin/menu');
break;
default:
......@@ -189,10 +189,10 @@ function menu_delete_item($mid) {
case t('Delete'):
db_query('DELETE FROM {menu} WHERE mid = %d', $mid);
if ($menu->type & MENU_IS_ROOT) {
drupal_set_message(t('Menu deleted.'));
drupal_set_message(t('The menu has been removed.'));
}
else {
drupal_set_message(t('Menu item deleted.'));
drupal_set_message(t('The menu item has been removed.'));
}