Commit 83a739bd authored by Dries's avatar Dries

- Code improvements by Stefan: made all status messages consistent (and easier to translate).
parent 0e36182c
......@@ -237,7 +237,7 @@ function drupal_goto($path = '', $query = NULL, $fragment = NULL) {
*/
function drupal_not_found() {
header('HTTP/1.0 404 Not Found');
watchdog('httpd', t('404 error: "%page" not found', array('%page' => check_query($_GET['q']))));
watchdog('httpd', t('404 error: %page not found.', array('%page' => '<em>'. check_query($_GET['q']) .'</em>')));
$path = drupal_get_normal_path(variable_get('site_404', ''));
$status = MENU_NOT_FOUND;
......@@ -651,7 +651,7 @@ function valid_input_data($data) {
$match += preg_match("/<\s*(applet|script|object|style|embed|form|blink|meta|html|frame|iframe|layer|ilayer|head|frameset|xml)/i", $data);
if ($match) {
watchdog('warning', t('terminated request because of suspicious input data: %data', array('%data' => drupal_specialchars($data))));
watchdog('warning', t('Terminated request because of suspicious input data: %data.', array('%data' => '<em>'. drupal_specialchars($data) .'</em>')));
return FALSE;
}
}
......
......@@ -203,7 +203,7 @@ function db_next_id($name) {
$name = db_prefix_tables($name);
$result = $active_db->nextID($name);
if (DB::isError($result)) {
watchdog('error', t('database: %db\nsequence table: %name', array('%db' => $result->getMessage(), '%name' => $name)));
watchdog('error', t('Database: %db sequence table: %name.', array('%db' => '<em>'. $result->getMessage() .'</em>', '%name' => "<em>$name</em>")));
}
else {
return $result;
......@@ -271,7 +271,7 @@ function db_query_range($query) {
}
if (DB::isError($result)) {
watchdog('error', t('database: %db\nquery: %query', array('%db' => $result->getMessage(), '%query' => htmlspecialchars($query))));
watchdog('error', t('Database: %db query: %query.', array('%db' => '<em>'. $result->getMessage() .'</em>', '%query' => '<em>'. htmlspecialchars($query) .'</em>')));
}
else {
return $result;
......
......@@ -61,11 +61,11 @@ 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 '%name'.", array('%name' => $directory)));
drupal_set_message(t('Created directory %directory.', array('%directory' => "<em>$directory</em>")));
}
else {
if ($form_item) {
form_set_error($form_item, t("The directory '%name' does not exist.", array('%name' => $directory)));
form_set_error($form_item, t('The directory %directory does not exist.', array('%directory' => "<em>$directory</em>")));
}
return false;
}
......@@ -74,10 +74,10 @@ 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 '%name'.", array('%name' => $directory)));
drupal_set_message(t('Modified permissions on directory %directory.', array('%directory' => "<em>$directory</em>")));
}
else {
form_set_error($form_item, t("The directory '%name' is not writable.", array('%name' => $directory)));
form_set_error($form_item, t('The directory %directory is not writable.', array('%directory' => "<em>$directory</em>")));
return false;
}
}
......@@ -314,7 +314,7 @@ function file_save_upload($source, $dest = 0, $replace = 0) {
if (!valid_input_data($file)) {
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;
}
......@@ -324,14 +324,14 @@ function file_save_upload($source, $dest = 0, $replace = 0) {
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');
drupal_set_message(t('File upload failed: file size too big.'), 'error');
return 0;
case 3: // UPLOAD_ERR_PARTIAL
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;
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;
}
......@@ -358,7 +358,7 @@ function file_save_upload($source, $dest = 0, $replace = 0) {
function file_save_data($data, $dest, $replace = 0) {
if (!valid_input_data($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;
}
......
......@@ -24,14 +24,14 @@ function _locale_add_language($code, $name, $onlylanguage = TRUE) {
// the language addition, we need to inform the user on how to start
// a translation
if ($onlylanguage) {
$message = t("'%locale' language added. You can now import a translation. See the <a href=\"%locale-help\">help screen</a> for more information.", array('%locale' => t($name), '%locale-help' => url("admin/help/locale")));
$message = t('%locale language added. You can now import a translation. See the <a href="%locale-help">help screen</a> for more information.', array('%locale' => '<em>'. t($name) .'</em>', '%locale-help' => url('admin/help/locale')));
}
else {
$message = t("'%locale' language added.", array('%locale' => t($name)));
$message = t('%locale language added.', array('%locale' => '<em>'. t($name) .'</em>'));
}
drupal_set_message($message);
watchdog('locale', t("'%locale' language added.", array('%locale' => $code)));
watchdog('locale', t('%locale language added.', array('%locale' => "<em>$code</em>")));
}
/**
......@@ -122,13 +122,13 @@ function _locale_admin_import_screen() {
function _locale_import_po($file, $lang, $mode) {
// Check if we have the language already in the database
if (!db_fetch_object(db_query("SELECT locale FROM {locales_meta} WHERE locale = '%s'", $lang))) {
drupal_set_message(t("Unsupported language selected for import."), 'error');
drupal_set_message(t('Unsupported language selected for import.'), 'error');
return FALSE;
}
// Check if we can get the strings from the file
if (!($strings = _locale_import_read_po($file))) {
drupal_set_message(t("Translation file broken: Couldn't be read."), 'error');
drupal_set_message(t('Translation file broken: Could not be read.'), 'error');
return FALSE;
}
......@@ -150,7 +150,7 @@ function _locale_import_po($file, $lang, $mode) {
}
}
else {
drupal_set_message(t("Translation file broken: No header."), 'error');
drupal_set_message(t('Translation file broken: no header.'), 'error');
return FALSE;
}
......@@ -221,8 +221,8 @@ function _locale_import_po($file, $lang, $mode) {
// Successfull import
cache_clear_all("locale:$lang");
drupal_set_message(t("Translation successfully imported. %num translated strings added to language.", array('%num' => $fullstr)));
watchdog('locale', strtr("Translation imported into '%locale', %num translated strings added to language.", array('%locale' => $lang, '%num' => $fullstr)));
drupal_set_message(t('Translation successfully imported. %number translated strings added to language.', array('%number' => $fullstr)));
watchdog('locale', t('Translation imported into %locale, %num translated strings added to language.', array('%locale' => "<em>$lang</em>", '%num' => $fullstr)));
return TRUE;
}
......@@ -236,7 +236,7 @@ function _locale_import_read_po($path) {
$fd = fopen($path, "rb");
if (!$fd) {
drupal_set_message(t("Translation import failed: File '%path' cannot be read.", array("%path" => $path)), 'error');
drupal_set_message(t('Translation import failed: file %filename cannot be read.', array('%filename' => "<em>$path</em>")), 'error');
return FALSE;
}
$info = fstat($fd);
......@@ -268,19 +268,19 @@ function _locale_import_read_po($path) {
$context = "COMMENT";
}
else { // Parse error
drupal_set_message(t("Translation file broken: Expected \"msgstr\" in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t("Translation file broken: expected 'msgstr' in line %line.", array('%line' => $lineno)), 'error');
return FALSE;
}
}
elseif (!strncmp("msgid_plural", $line, 12)) {
if ($context != "MSGID") { // Must be plural form for current entry
drupal_set_message(t("Translation file broken: Unexpected \"msgid_plural\" in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t("Translation file broken: unexpected 'msgid_plural' in line %line.", array('%line' => $lineno)), 'error');
return FALSE;
}
$line = trim(substr($line, 12));
$quoted = _locale_import_parse_quoted($line);
if ($quoted === false) {
drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error');
return FALSE;
}
$current["msgid"] = $current["msgid"] ."\0". $quoted;
......@@ -292,13 +292,13 @@ function _locale_import_read_po($path) {
$current = array();
}
elseif ($context == "MSGID") { // Already in this context? Parse error
drupal_set_message(t("Translation file broken: Unexpected \"msgid\" in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t("Translation file broken: unexpected 'msgid' in line %line.", array('%line' => $lineno)), 'error');
return FALSE;
}
$line = trim(substr($line, 5));
$quoted = _locale_import_parse_quoted($line);
if ($quoted === false) {
drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error');
return FALSE;
}
$current["msgid"] = $quoted;
......@@ -306,11 +306,11 @@ function _locale_import_read_po($path) {
}
elseif (!strncmp("msgstr[", $line, 7)) {
if (($context != "MSGID") && ($context != "MSGID_PLURAL") && ($context != "MSGSTR_ARR")) { // Must come after msgid, msgid_plural, or msgstr[]
drupal_set_message(t("Translation file broken: Unexpected \"msgstr[]\" in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t("Translation file broken: unexpected 'msgstr[]' in line %line.", array('%line' => $lineno)), 'error');
return FALSE;
}
if (strpos($line, "]") === false) {
drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error');
return FALSE;
}
$frombracket = strstr($line, "[");
......@@ -318,7 +318,7 @@ function _locale_import_read_po($path) {
$line = trim(strstr($line, " "));
$quoted = _locale_import_parse_quoted($line);
if ($quoted === false) {
drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error');
return FALSE;
}
$current["msgstr"][$plural] = $quoted;
......@@ -326,13 +326,13 @@ function _locale_import_read_po($path) {
}
elseif (!strncmp("msgstr", $line, 6)) {
if ($context != "MSGID") { // Should come just after a msgid block
drupal_set_message(t("Translation file broken: Unexpected \"msgstr\" in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t("Translation file broken: unexpected 'msgstr' in line %line.", array('%line' => $lineno)), 'error');
return FALSE;
}
$line = trim(substr($line, 6));
$quoted = _locale_import_parse_quoted($line);
if ($quoted === false) {
drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error');
return FALSE;
}
$current["msgstr"] = $quoted;
......@@ -341,7 +341,7 @@ function _locale_import_read_po($path) {
elseif ($line != "") {
$quoted = _locale_import_parse_quoted($line);
if ($quoted === false) {
drupal_set_message(t("Translation file broken: Syntax error in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t('Translation file broken: syntax error in line %line.', array('%line' => $lineno)), 'error');
return FALSE;
}
if (($context == "MSGID") || ($context == "MSGID_PLURAL")) {
......@@ -354,7 +354,7 @@ function _locale_import_read_po($path) {
$current["msgstr"][$plural] .= $quoted;
}
else {
drupal_set_message(t("Translation file broken: Unexpected string in line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t('Translation file broken: unexpected string in line %line.', array('%line' => $lineno)), 'error');
return FALSE;
}
}
......@@ -365,7 +365,7 @@ function _locale_import_read_po($path) {
$strings[$current["msgid"]] = $current;
}
elseif ($context != "COMMENT") {
drupal_set_message(t("Translation file broken: Unexpected end file at line %lineno", array("%lineno" => $lineno)), 'error');
drupal_set_message(t('Translation file broken: unexpected end file at line %line.', array('%line' => $lineno)), 'error');
return FALSE;
}
......@@ -429,7 +429,7 @@ function _locale_import_parse_plural_forms($pluralforms) {
return array($nplurals, $plural);
}
else {
drupal_set_message(t("Translation file broken: Plural formula couldn't get parsed."), 'error');
drupal_set_message(t("Translation file broken: plural formula couldn't get parsed."), 'error');
return FALSE;
}
}
......@@ -730,7 +730,7 @@ function _locale_export_po($language) {
$header .= "\"Plural-Forms: nplurals=". $meta->plurals ."; plural=". strtr($meta->formula, '$', '') .";\\n\"\n";
}
$header .= "\n";
watchdog('locale', strtr("PO file for locale '%loc' downloaded.", array('%loc' => $meta->name)));
watchdog('locale', t('PO file for locale %locale downloaded.', array('%locale' => "<em>$meta->name</em>")));
}
// Generating Portable Object Template
......@@ -751,7 +751,7 @@ function _locale_export_po($language) {
$header .= "\"Content-Transfer-Encoding: 8bit\\n\"\n";
$header .= "\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n\"\n";
$header .= "\n";
watchdog('locale', 'POT file downloaded.');
watchdog('locale', t('POT file downloaded.'));
}
// Start download process
......
......@@ -266,7 +266,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' => $feed['title'])));
drupal_set_message(t('Removed news items from %site.', array('%site' => '<em>'.$feed['title'] .'</em>')));
}
/**
......@@ -346,11 +346,11 @@ 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' => $feed['title'])));
drupal_set_message(t('No new syndicated content from %site.', array('%site' => '<em>'. $feed['title'] .'</em>')));
break;
case 301:
$feed['url'] = $result->redirect_url;
watchdog('special', t('aggregator: updated URL for feed "%title" to %url', array('%title' => $feed[title], '%url' => $feed[url])));
watchdog('special', t('Aggregator: updated URL for feed %title to %url.', array('%title' => '<em>'. $feed[title] .'</em>', '%url' => '<em>'. $feed[url] .'</em>')));
case 200:
case 302:
case 307:
......@@ -388,13 +388,13 @@ function aggregator_refresh($feed) {
cache_clear_all();
watchdog('regular', t('aggregator: syndicated content from "%site"', array('%site' => $feed[title])));
drupal_set_message(t('Syndicated content from "%site".', array('%site' => $feed['title'])));
watchdog('regular', t('Aggregator: syndicated content from %site.', array('%site' => '<em>'. $feed[title] .'</em>')));
drupal_set_message(t('Syndicated content from %site.', array('%site' => '<em>'. $feed['title'] .'</em>')));
}
break;
default:
watchdog('error', t('aggregator: 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)));
watchdog('error', t('Aggregator: failed to parse RSS feed %site: %error.', array('%site' => '<em>'. $feed['title'] .'</em>', '%error' => "<em>$result->code $result->error</em>")));
drupal_set_message(t('Failed to parse RSS feed %site: %error.', array('%site' => '<em>'. $feed['title'] .'</em>', '%error' => "<em>$result->code $result->error</em>")));
}
}
......@@ -450,8 +450,8 @@ function aggregator_parse_feed(&$data, $feed) {
xml_set_character_data_handler($xml_parser, 'aggregator_element_data');
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))));
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');
watchdog('error', t('Aggregator: failed to parse RSS feed %site: %error at line %line.', array('%site' => '<em>'. $feed['title'] .'</em>', '%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' => '<em>'. $feed['title'] .'</em>', '%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);
......@@ -542,7 +542,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' => $feed['title'])), 'error');
drupal_set_message(t('Failed to parse entry from %site feed: suspicious input data.', array('%site' => '<em>'. $feed['title'] .'</em>')), 'error');
}
else {
aggregator_save_item(array('iid' => $entry->iid, 'fid' => $feed['fid'], 'timestamp' => $timestamp, 'title' => $title, 'link' => $link, 'author' => $item['AUTHOR'], 'description' => $item['DESCRIPTION']));
......
......@@ -266,7 +266,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' => $feed['title'])));
drupal_set_message(t('Removed news items from %site.', array('%site' => '<em>'.$feed['title'] .'</em>')));
}
/**
......@@ -346,11 +346,11 @@ 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' => $feed['title'])));
drupal_set_message(t('No new syndicated content from %site.', array('%site' => '<em>'. $feed['title'] .'</em>')));
break;
case 301:
$feed['url'] = $result->redirect_url;
watchdog('special', t('aggregator: updated URL for feed "%title" to %url', array('%title' => $feed[title], '%url' => $feed[url])));
watchdog('special', t('Aggregator: updated URL for feed %title to %url.', array('%title' => '<em>'. $feed[title] .'</em>', '%url' => '<em>'. $feed[url] .'</em>')));
case 200:
case 302:
case 307:
......@@ -388,13 +388,13 @@ function aggregator_refresh($feed) {
cache_clear_all();
watchdog('regular', t('aggregator: syndicated content from "%site"', array('%site' => $feed[title])));
drupal_set_message(t('Syndicated content from "%site".', array('%site' => $feed['title'])));
watchdog('regular', t('Aggregator: syndicated content from %site.', array('%site' => '<em>'. $feed[title] .'</em>')));
drupal_set_message(t('Syndicated content from %site.', array('%site' => '<em>'. $feed['title'] .'</em>')));
}
break;
default:
watchdog('error', t('aggregator: 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)));
watchdog('error', t('Aggregator: failed to parse RSS feed %site: %error.', array('%site' => '<em>'. $feed['title'] .'</em>', '%error' => "<em>$result->code $result->error</em>")));
drupal_set_message(t('Failed to parse RSS feed %site: %error.', array('%site' => '<em>'. $feed['title'] .'</em>', '%error' => "<em>$result->code $result->error</em>")));
}
}
......@@ -450,8 +450,8 @@ function aggregator_parse_feed(&$data, $feed) {
xml_set_character_data_handler($xml_parser, 'aggregator_element_data');
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))));
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');
watchdog('error', t('Aggregator: failed to parse RSS feed %site: %error at line %line.', array('%site' => '<em>'. $feed['title'] .'</em>', '%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' => '<em>'. $feed['title'] .'</em>', '%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);
......@@ -542,7 +542,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' => $feed['title'])), 'error');
drupal_set_message(t('Failed to parse entry from %site feed: suspicious input data.', array('%site' => '<em>'. $feed['title'] .'</em>')), 'error');
}
else {
aggregator_save_item(array('iid' => $entry->iid, 'fid' => $feed['fid'], 'timestamp' => $timestamp, 'title' => $title, 'link' => $link, 'author' => $item['AUTHOR'], 'description' => $item['DESCRIPTION']));
......
......@@ -144,7 +144,7 @@ function blogapi_new_post($req_params) {
$nid = node_save($node);
if ($nid) {
watchdog('special', t('%node-type: added "%node-title" using blog API', array('%node-type' => t("$node->type"), '%node-title' => $node->title)), l(t('view'), "node/$nid"));
watchdog('special', t('%type: added %title using blog API.', array('%type' => '<em>'. t($node->type) .'</em>', '%title' => "<em>$node->title</em>")), l(t('view'), "node/$nid"));
return new xmlrpcresp(new xmlrpcval($nid, 'string'));
}
......@@ -204,7 +204,7 @@ function blogapi_edit_post($req_params) {
}
$nid = node_save($node);
if ($nid) {
watchdog('special', t('%node-type: updated "%node-title" using blog API', array('%node-type' => t("$node->type"), '%node-title' => $node->title)), l(t('view'), "node/$nid"));
watchdog('special', t('%type: updated %title using blog API.', array('%type' => '<em>'. t($node->type) .'</em>', '%title' => "<em>$node->title</em>")), l(t('view'), "node/$nid"));
return new xmlrpcresp(new xmlrpcval(true, 'boolean'));
}
......
......@@ -144,7 +144,7 @@ function blogapi_new_post($req_params) {
$nid = node_save($node);
if ($nid) {
watchdog('special', t('%node-type: added "%node-title" using blog API', array('%node-type' => t("$node->type"), '%node-title' => $node->title)), l(t('view'), "node/$nid"));
watchdog('special', t('%type: added %title using blog API.', array('%type' => '<em>'. t($node->type) .'</em>', '%title' => "<em>$node->title</em>")), l(t('view'), "node/$nid"));
return new xmlrpcresp(new xmlrpcval($nid, 'string'));
}
......@@ -204,7 +204,7 @@ function blogapi_edit_post($req_params) {
}
$nid = node_save($node);
if ($nid) {
watchdog('special', t('%node-type: updated "%node-title" using blog API', array('%node-type' => t("$node->type"), '%node-title' => $node->title)), l(t('view'), "node/$nid"));
watchdog('special', t('%type: updated %title using blog API.', array('%type' => '<em>'. t($node->type) .'</em>', '%title' => "<em>$node->title</em>")), l(t('view'), "node/$nid"));
return new xmlrpcresp(new xmlrpcval(true, 'boolean'));
}
......
......@@ -714,7 +714,7 @@ function book_admin_save($nid, $edit = array()) {
}
}
$message = t('updated book "%title"', array('%title' => $book->title));
$message = t('Updated book %title.', array('%title' => "<em>$book->title</em>"));
watchdog('special', $message);
return $message;
......
......@@ -714,7 +714,7 @@ function book_admin_save($nid, $edit = array()) {
}
}
$message = t('updated book "%title"', array('%title' => $book->title));
$message = t('Updated book %title.', array('%title' => "<em>$book->title</em>"));
watchdog('special', $message);
return $message;
......
......@@ -549,7 +549,7 @@ function comment_post($edit) {
$duplicate = db_result(db_query("SELECT COUNT(cid) FROM {comments} WHERE pid = %d AND nid = %d AND subject = '%s' AND comment = '%s'", $edit["pid"], $edit["nid"], $edit['subject'], $edit['comment']), 0);
if ($duplicate != 0) {
watchdog('warning', t('comment: duplicate "%comment-subject"', array('%comment-subject' => $edit["subject"])));
watchdog('warning', t('Comment: duplicate %subject.', array('%subject' => '<em>'. $edit["subject"] .'</em>')));
}
if ($edit["cid"]) {
......@@ -562,7 +562,7 @@ function comment_post($edit) {
module_invoke_all('comment', 'update', $edit);
// Add entry to the watchdog log.
watchdog('special', t('comment: updated "%comment-subject"', array('%comment-subject' => $edit['subject'])), l(t('view'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
watchdog('special', t('Comment: updated %subject.', array('%subject' => '<em>'. $edit['subject'] .'</em>')), l(t('view'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
}
else {
// Add the comment to database.
......@@ -671,7 +671,7 @@ function comment_post($edit) {
module_invoke_all('comment', 'insert', $edit);
// Add an entry to the watchdog log.
watchdog('special', t('comment: added "%comment-subject"', array('%comment-subject' => $edit['subject'])), l(t('view'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
watchdog('special', t('Comment: added %subject.', array('%subject' => '<em>'. $edit['subject'] .'</em>')), l(t('view'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
}
// Clear the cache so an anonymous user can see his comment being added.
......@@ -692,7 +692,7 @@ function comment_post($edit) {
}
}
else {
watchdog('error', t('comment: unauthorized comment submitted or comment submitted to a closed node "%comment-subject"', array('%comment-subject' => $edit['subject'])));
watchdog('error', t('Comment: unauthorized comment submitted or comment submitted to a closed node %subject.', array('%subject' => '<em>'. $edit['subject'] .'</em>')));
}
}
......@@ -1006,7 +1006,7 @@ function comment_delete($cid) {
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);
watchdog('special', t('comment: modified "%comment-subject"', array('%comment-subject' => $edit['subject'])));
watchdog('special', t('Comment: modified %subject.', array('%subject' => '<em>'. $edit['subject'] .'</em>')));
drupal_set_message(t('The comment has been saved.'));
}
......@@ -1629,7 +1629,7 @@ function theme_comment_post_forbidden() {
function _comment_delete_thread($comment) {
// Delete the comment:
db_query('DELETE FROM {comments} WHERE cid = %d', $comment->cid);
watchdog('special', t('comment: deleted "%comment-subject"', array('%comment-subject' => $comment->subject)));
watchdog('special', t('Comment: deleted %subject.', array('%subject' => "<em>$comment->subject</em>")));
// Delete the comment's replies:
$result = db_query('SELECT cid, subject FROM {comments} WHERE pid = %d', $comment->cid);
......
......@@ -549,7 +549,7 @@ function comment_post($edit) {
$duplicate = db_result(db_query("SELECT COUNT(cid) FROM {comments} WHERE pid = %d AND nid = %d AND subject = '%s' AND comment = '%s'", $edit["pid"], $edit["nid"], $edit['subject'], $edit['comment']), 0);
if ($duplicate != 0) {
watchdog('warning', t('comment: duplicate "%comment-subject"', array('%comment-subject' => $edit["subject"])));
watchdog('warning', t('Comment: duplicate %subject.', array('%subject' => '<em>'. $edit["subject"] .'</em>')));
}
if ($edit["cid"]) {
......@@ -562,7 +562,7 @@ function comment_post($edit) {
module_invoke_all('comment', 'update', $edit);
// Add entry to the watchdog log.
watchdog('special', t('comment: updated "%comment-subject"', array('%comment-subject' => $edit['subject'])), l(t('view'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
watchdog('special', t('Comment: updated %subject.', array('%subject' => '<em>'. $edit['subject'] .'</em>')), l(t('view'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
}
else {
// Add the comment to database.
......@@ -671,7 +671,7 @@ function comment_post($edit) {
module_invoke_all('comment', 'insert', $edit);
// Add an entry to the watchdog log.
watchdog('special', t('comment: added "%comment-subject"', array('%comment-subject' => $edit['subject'])), l(t('view'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
watchdog('special', t('Comment: added %subject.', array('%subject' => '<em>'. $edit['subject'] .'</em>')), l(t('view'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
}
// Clear the cache so an anonymous user can see his comment being added.
......@@ -692,7 +692,7 @@ function comment_post($edit) {
}
}
else {
watchdog('error', t('comment: unauthorized comment submitted or comment submitted to a closed node "%comment-subject"', array('%comment-subject' => $edit['subject'])));
watchdog('error', t('Comment: unauthorized comment submitted or comment submitted to a closed node %subject.', array('%subject' => '<em>'. $edit['subject'] .'</em>')));
}
}
......@@ -1006,7 +1006,7 @@ function comment_delete($cid) {
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);
watchdog('special', t('comment: modified "%comment-subject"', array('%comment-subject' => $edit['subject'])));
watchdog('special', t('Comment: modified %subject.', array('%subject' => '<em>'. $edit['subject'] .'</em>')));
drupal_set_message(t('The comment has been saved.'));
}
......@@ -1629,7 +1629,7 @@ function theme_comment_post_forbidden() {
function _comment_delete_thread($comment) {
// Delete the comment:
db_query('DELETE FROM {comments} WHERE cid = %d', $comment->cid);
watchdog('special', t('comment: deleted "%comment-subject"', array('%comment-subject' => $comment->subject)));
watchdog('special', t('Comment: deleted %subject.', array('%subject' => "<em>$comment->subject</em>")));