summaryrefslogtreecommitdiff
path: root/modules/aggregator/aggregator.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-05-05 22:22:46 +0000
committerDries Buytaert <dries@buytaert.net>2005-05-05 22:22:46 +0000
commit2debcfb1efd074f310a64afa7e145d84031ed7f2 (patch)
treec0e3c19d72371e6236d26e80c49347b23d10e5f5 /modules/aggregator/aggregator.module
parent381853c6b9fc493a32645eb83f21993d5cf4796b (diff)
downloadbrdo-2debcfb1efd074f310a64afa7e145d84031ed7f2.tar.gz
brdo-2debcfb1efd074f310a64afa7e145d84031ed7f2.tar.bz2
- 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()! .
Diffstat (limited to 'modules/aggregator/aggregator.module')
-rw-r--r--modules/aggregator/aggregator.module25
1 files changed, 11 insertions, 14 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 3d33c88af..9b4e8ff81 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -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;