diff options
Diffstat (limited to 'modules/aggregator')
-rw-r--r-- | modules/aggregator/aggregator.admin.inc | 8 | ||||
-rw-r--r-- | modules/aggregator/aggregator.module | 42 | ||||
-rw-r--r-- | modules/aggregator/aggregator.pages.inc | 26 |
3 files changed, 38 insertions, 38 deletions
diff --git a/modules/aggregator/aggregator.admin.inc b/modules/aggregator/aggregator.admin.inc index 2f1485cf5..38b273c8f 100644 --- a/modules/aggregator/aggregator.admin.inc +++ b/modules/aggregator/aggregator.admin.inc @@ -22,7 +22,7 @@ function aggregator_admin_overview() { function aggregator_view() { $result = db_query('SELECT f.*, COUNT(i.iid) AS items FROM {aggregator_feed} f LEFT JOIN {aggregator_item} i ON f.fid = i.fid GROUP BY f.fid, f.title, f.url, f.refresh, f.checked, f.link, f.description, f.etag, f.modified, f.image, f.block ORDER BY f.title'); - $output = '<h3>'. t('Feed overview') .'</h3>'; + $output = '<h3>' . t('Feed overview') . '</h3>'; $header = array(t('Title'), t('Items'), t('Last update'), t('Next update'), array('data' => t('Operations'), 'colspan' => '3')); $rows = array(); @@ -33,7 +33,7 @@ function aggregator_view() { $result = db_query('SELECT c.cid, c.title, count(ci.iid) as items FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid GROUP BY c.cid, c.title ORDER BY title'); - $output .= '<h3>'. t('Category overview') .'</h3>'; + $output .= '<h3>' . t('Category overview') . '</h3>'; $header = array(t('Title'), t('Items'), t('Operations')); $rows = array(); @@ -153,7 +153,7 @@ function aggregator_form_feed_submit($form, &$form_state) { return; } else { - $form_state['redirect'] = 'aggregator/sources/'. $form_state['values']['fid']; + $form_state['redirect'] = 'aggregator/sources/' . $form_state['values']['fid']; return; } } @@ -317,7 +317,7 @@ function aggregator_form_category_submit($form, &$form_state) { return; } else { - $form_state['redirect'] = 'aggregator/categories/'. $form_state['values']['cid']; + $form_state['redirect'] = 'aggregator/categories/' . $form_state['values']['cid']; return; } } diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 36f5eb0eb..7b749ec28 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -12,18 +12,18 @@ function aggregator_help($path, $arg) { switch ($path) { case 'admin/help#aggregator': - $output = '<p>'. t('The aggregator is a powerful on-site syndicator and news reader that gathers fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include <a href="@rss">RSS</a>, <a href="@rdf">RDF</a>, and <a href="@atom">Atom</a>.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) .'</p>'; - $output .= '<p>'. t('Feeds contain feed items, or individual posts published by the site providing the feed. Feeds may be grouped in categories, generally by topic. Users view feed items in the <a href="@aggregator">main aggregator display</a> or by <a href="@aggregator-sources">their source</a>. Administrators can <a href="@feededit">add, edit and delete feeds</a> and choose how often to check each feed for newly updated items. The most recent items in either a feed or category can be displayed as a block through the <a href="@admin-block">blocks administration page</a>. A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. A correctly configured <a href="@cron">cron maintenance task</a> is required to update feeds automatically.', array('@aggregator' => url('aggregator'), '@aggregator-sources' => url('aggregator/sources'), '@feededit' => url('admin/content/aggregator'), '@admin-block' => url('admin/build/block'), '@aggregator-opml' => url('aggregator/opml'), '@cron' => url('admin/reports/status'))) .'</p>'; - $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@aggregator">Aggregator module</a>.', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) .'</p>'; + $output = '<p>' . t('The aggregator is a powerful on-site syndicator and news reader that gathers fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include <a href="@rss">RSS</a>, <a href="@rdf">RDF</a>, and <a href="@atom">Atom</a>.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '</p>'; + $output .= '<p>' . t('Feeds contain feed items, or individual posts published by the site providing the feed. Feeds may be grouped in categories, generally by topic. Users view feed items in the <a href="@aggregator">main aggregator display</a> or by <a href="@aggregator-sources">their source</a>. Administrators can <a href="@feededit">add, edit and delete feeds</a> and choose how often to check each feed for newly updated items. The most recent items in either a feed or category can be displayed as a block through the <a href="@admin-block">blocks administration page</a>. A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. A correctly configured <a href="@cron">cron maintenance task</a> is required to update feeds automatically.', array('@aggregator' => url('aggregator'), '@aggregator-sources' => url('aggregator/sources'), '@feededit' => url('admin/content/aggregator'), '@admin-block' => url('admin/build/block'), '@aggregator-opml' => url('aggregator/opml'), '@cron' => url('admin/reports/status'))) . '</p>'; + $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@aggregator">Aggregator module</a>.', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) . '</p>'; return $output; case 'admin/content/aggregator': - $output = '<p>'. t('Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include <a href="@rss">RSS</a>, <a href="@rdf">RDF</a>, and <a href="@atom">Atom</a>.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'hsttp://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) .'</p>'; - $output .= '<p>'. t('Current feeds are listed below, and <a href="@addfeed">new feeds may be added</a>. For each feed or feed category, the <em>latest items</em> block may be enabled at the <a href="@block">blocks administration page</a>.', array('@addfeed' => url('admin/content/aggregator/add/feed'), '@block' => url('admin/build/block'))) .'</p>'; + $output = '<p>' . t('Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include <a href="@rss">RSS</a>, <a href="@rdf">RDF</a>, and <a href="@atom">Atom</a>.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'hsttp://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '</p>'; + $output .= '<p>' . t('Current feeds are listed below, and <a href="@addfeed">new feeds may be added</a>. For each feed or feed category, the <em>latest items</em> block may be enabled at the <a href="@block">blocks administration page</a>.', array('@addfeed' => url('admin/content/aggregator/add/feed'), '@block' => url('admin/build/block'))) . '</p>'; return $output; case 'admin/content/aggregator/add/feed': - return '<p>'. t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') .'</p>'; + return '<p>' . t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') . '</p>'; case 'admin/content/aggregator/add/category': - return '<p>'. t('Categories allow feed items from different feeds to be grouped together. For example, several sport-related feeds may belong to a category named <em>Sports</em>. Feed items may be grouped automatically (by selecting a category when creating or editing a feed) or manually (via the <em>Categorize</em> page available from feed item listings). Each category provides its own feed page and block.') .'</p>'; + return '<p>' . t('Categories allow feed items from different feeds to be grouped together. For example, several sport-related feeds may belong to a category named <em>Sports</em>. Feed items may be grouped automatically (by selecting a category when creating or editing a feed) or manually (via the <em>Categorize</em> page available from feed item listings). Each category provides its own feed page and block.') . '</p>'; } } @@ -260,7 +260,7 @@ function _aggregator_category_title($category) { * Implementation of hook_init(). */ function aggregator_init() { - drupal_add_css(drupal_get_path('module', 'aggregator') .'/aggregator.css'); + drupal_add_css(drupal_get_path('module', 'aggregator') . '/aggregator.css'); } /** @@ -305,11 +305,11 @@ function aggregator_block($op = 'list', $delta = '', $edit = array()) { if ($op == 'list') { $result = db_query('SELECT cid, title FROM {aggregator_category} ORDER BY title'); while ($category = db_fetch_object($result)) { - $block['category-'. $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title)); + $block['category-' . $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title)); } $result = db_query('SELECT fid, title FROM {aggregator_feed} ORDER BY fid'); while ($feed = db_fetch_object($result)) { - $block['feed-'. $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title)); + $block['feed-' . $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title)); } } else if ($op == 'configure') { @@ -339,7 +339,7 @@ function aggregator_block($op = 'list', $delta = '', $edit = array()) { if ($feed = db_fetch_object(db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE fid = %d', $id))) { $block['subject'] = check_plain($feed->title); $result = db_query_range('SELECT * FROM {aggregator_item} WHERE fid = %d ORDER BY timestamp DESC, iid DESC', $feed->fid, 0, $feed->block); - $read_more = theme('more_link', url('aggregator/sources/'. $feed->fid), t("View this feed's recent news.")); + $read_more = theme('more_link', url('aggregator/sources/' . $feed->fid), t("View this feed's recent news.")); } break; @@ -347,7 +347,7 @@ function aggregator_block($op = 'list', $delta = '', $edit = array()) { if ($category = db_fetch_object(db_query('SELECT cid, title, block FROM {aggregator_category} WHERE cid = %d', $id))) { $block['subject'] = check_plain($category->title); $result = db_query_range('SELECT i.* FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON ci.iid = i.iid WHERE ci.cid = %d ORDER BY i.timestamp DESC, i.iid DESC', $category->cid, 0, $category->block); - $read_more = theme('more_link', url('aggregator/categories/'. $category->cid), t("View this category's recent news.")); + $read_more = theme('more_link', url('aggregator/categories/' . $category->cid), t("View this category's recent news.")); } break; } @@ -419,7 +419,7 @@ function aggregator_save_feed($edit) { $items[] = "iid = $item->iid"; } if (!empty($items)) { - db_query('DELETE FROM {aggregator_category_item} WHERE '. implode(' OR ', $items)); + db_query('DELETE FROM {aggregator_category_item} WHERE ' . implode(' OR ', $items)); } db_query('DELETE FROM {aggregator_feed} WHERE fid = %d', $edit['fid']); db_query('DELETE FROM {aggregator_item} WHERE fid = %d', $edit['fid']); @@ -453,7 +453,7 @@ function aggregator_remove($feed) { $items[] = "iid = $item->iid"; } if (!empty($items)) { - db_query('DELETE FROM {aggregator_category_item} WHERE '. implode(' OR ', $items)); + db_query('DELETE FROM {aggregator_category_item} WHERE ' . implode(' OR ', $items)); } 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']); @@ -588,7 +588,7 @@ function aggregator_refresh($feed) { $headers['If-None-Match'] = $feed['etag']; } if ($feed['modified']) { - $headers['If-Modified-Since'] = gmdate('D, d M Y H:i:s', $feed['modified']) .' GMT'; + $headers['If-Modified-Since'] = gmdate('D, d M Y H:i:s', $feed['modified']) . ' GMT'; } // Request feed. @@ -623,7 +623,7 @@ function aggregator_refresh($feed) { if (!empty($image['LINK']) && !empty($image['URL']) && !empty($image['TITLE'])) { // Note, we should really use theme_image() here but that only works with local images it won't work with images fetched with a URL unless PHP version > 5 - $image = '<a href="'. check_url($image['LINK']) .'" class="feed-image"><img src="'. check_url($image['URL']) .'" alt="'. check_plain($image['TITLE']) .'" /></a>'; + $image = '<a href="' . check_url($image['LINK']) . '" class="feed-image"><img src="' . check_url($image['URL']) . '" alt="' . check_plain($image['TITLE']) . '" /></a>'; } else { $image = NULL; @@ -643,8 +643,8 @@ function aggregator_refresh($feed) { $result->error = t('feed not parseable'); // Deliberate no break. default: - watchdog('aggregator', 'The feed from %site seems to be broken, due to "%error".', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error), WATCHDOG_WARNING); - drupal_set_message(t('The feed from %site seems to be broken, because of error "%error".', array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error))); + watchdog('aggregator', 'The feed from %site seems to be broken, due to "%error".', array('%site' => $feed['title'], '%error' => $result->code . ' ' . $result->error), WATCHDOG_WARNING); + drupal_set_message(t('The feed from %site seems to be broken, because of error "%error".', array('%site' => $feed['title'], '%error' => $result->code . ' ' . $result->error))); module_invoke('system', 'check_http_request'); } } @@ -811,7 +811,7 @@ function aggregator_parse_feed(&$data, $feed) { $num_rows = TRUE; } if ($num_rows) { - db_query('DELETE FROM {aggregator_category_item} WHERE iid IN ('. implode(', ', $items) .')'); + db_query('DELETE FROM {aggregator_category_item} WHERE iid IN (' . implode(', ', $items) . ')'); db_query('DELETE FROM {aggregator_item} WHERE fid = %d AND timestamp < %d', $feed['fid'], $age); } @@ -892,12 +892,12 @@ function theme_aggregator_block_item($item, $feed = 0) { $output = ''; if ($user->uid && module_exists('blog') && user_access('create blog entries')) { if ($image = theme('image', 'misc/blog.png', t('blog it'), t('blog it'))) { - $output .= '<div class="icon">'. l($image, 'node/add/blog', array('attributes' => array('title' => t('Comment on this news item in your personal blog.'), 'class' => 'blog-it'), 'query' => "iid=$item->iid", 'html' => TRUE)) .'</div>'; + $output .= '<div class="icon">' . l($image, 'node/add/blog', array('attributes' => array('title' => t('Comment on this news item in your personal blog.'), 'class' => 'blog-it'), 'query' => "iid=$item->iid", 'html' => TRUE)) . '</div>'; } } // Display the external link to the item. - $output .= '<a href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a>\n"; + $output .= '<a href="' . check_url($item->link) . '">' . check_plain($item->title) . "</a>\n"; return $output; } diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc index 2e90379bd..e2e708a4b 100644 --- a/modules/aggregator/aggregator.pages.inc +++ b/modules/aggregator/aggregator.pages.inc @@ -13,7 +13,7 @@ * The items HTML. */ function aggregator_page_last() { - drupal_add_feed(url('aggregator/rss'), variable_get('site_name', 'Drupal') .' '. t('aggregator')); + drupal_add_feed(url('aggregator/rss'), variable_get('site_name', 'Drupal') . ' ' . t('aggregator')); $items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_item} i INNER JOIN {aggregator_feed} f ON i.fid = f.fid ORDER BY i.timestamp DESC, i.iid DESC'); @@ -42,7 +42,7 @@ function aggregator_page_source($arg1, $arg2 = NULL) { // It is safe to include the fid in the query because it's loaded from the // database by aggregator_feed_load. - $items = aggregator_feed_items_load('SELECT * FROM {aggregator_item} WHERE fid = '. $feed->fid .' ORDER BY timestamp DESC, iid DESC'); + $items = aggregator_feed_items_load('SELECT * FROM {aggregator_item} WHERE fid = ' . $feed->fid . ' ORDER BY timestamp DESC, iid DESC'); return _aggregator_page_list($items, arg(3), $feed_source); } @@ -65,11 +65,11 @@ function aggregator_page_category($arg1, $arg2 = NULL) { // $form_state and $arg2 is $category. Otherwise, $arg1 is $category. $category = is_array($arg2) ? $arg2 : $arg1; - drupal_add_feed(url('aggregator/rss/'. $category['cid']), variable_get('site_name', 'Drupal') .' '. t('aggregator - @title', array('@title' => $category['title']))); + drupal_add_feed(url('aggregator/rss/' . $category['cid']), variable_get('site_name', 'Drupal') . ' ' . t('aggregator - @title', array('@title' => $category['title']))); // It is safe to include the cid in the query because it's loaded from the // database by aggregator_category_load. - $items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = '. $category['cid'] .' ORDER BY timestamp DESC, i.iid DESC'); + $items = aggregator_feed_items_load('SELECT i.*, f.title AS ftitle, f.link AS flink FROM {aggregator_category_item} c LEFT JOIN {aggregator_item} i ON c.iid = i.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE cid = ' . $category['cid'] . ' ORDER BY timestamp DESC, i.iid DESC'); return _aggregator_page_list($items, arg(3)); } @@ -267,7 +267,7 @@ function template_preprocess_aggregator_item(&$variables) { $variables['categories'] = array(); foreach ($item->categories as $category) { - $variables['categories'][$category->cid] = l($category->title, 'aggregator/categories/'. $category->cid); + $variables['categories'][$category->cid] = l($category->title, 'aggregator/categories/' . $category->cid); } } @@ -287,7 +287,7 @@ function aggregator_page_sources() { $summary_items[] = theme('aggregator_summary_item', $item); } } - $feed->url = url('aggregator/sources/'. $feed->fid); + $feed->url = url('aggregator/sources/' . $feed->fid); $output .= theme('aggregator_summary_items', $summary_items, $feed); } $output .= theme('feed_icon', url('aggregator/opml'), t('OPML feed')); @@ -310,7 +310,7 @@ function aggregator_page_categories() { $summary_items[] = theme('aggregator_summary_item', $item); } } - $category->url = url('aggregator/categories/'. $category->cid); + $category->url = url('aggregator/categories/' . $category->cid); $output .= theme('aggregator_summary_items', $summary_items, $category); } @@ -361,7 +361,7 @@ function theme_aggregator_page_rss($feeds, $category = NULL) { case 'teaser': $teaser = node_teaser($feed->description); if ($teaser != $feed->description) { - $teaser .= '<p><a href="'. check_url($feed->link) .'">'. t('read more') ."</a></p>\n"; + $teaser .= '<p><a href="' . check_url($feed->link) . '">' . t('read more') . "</a></p>\n"; } $feed->description = $teaser; break; @@ -369,11 +369,11 @@ function theme_aggregator_page_rss($feeds, $category = NULL) { $feed->description = ''; break; } - $items .= format_rss_item($feed->ftitle .': '. $feed->title, $feed->link, $feed->description, array('pubDate' => date('r', $feed->timestamp))); + $items .= format_rss_item($feed->ftitle . ': ' . $feed->title, $feed->link, $feed->description, array('pubDate' => date('r', $feed->timestamp))); } $site_name = variable_get('site_name', 'Drupal'); - $url = url((isset($category) ? 'aggregator/categories/'. $category->cid : 'aggregator'), array('absolute' => TRUE)); + $url = url((isset($category) ? 'aggregator/categories/' . $category->cid : 'aggregator'), array('absolute' => TRUE)); $description = isset($category) ? t('@site_name - aggregated feeds in category @title', array('@site_name' => $site_name, '@title' => $category->title)) : t('@site_name - aggregated feeds', array('@site_name' => $site_name)); $output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; @@ -422,12 +422,12 @@ function theme_aggregator_page_opml($feeds) { $output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; $output .= "<opml version=\"1.1\">\n"; $output .= "<head>\n"; - $output .= '<title>'. check_plain(variable_get('site_name', 'Drupal')) ."</title>\n"; - $output .= '<dateModified>'. gmdate('r') ."</dateModified>\n"; + $output .= '<title>' . check_plain(variable_get('site_name', 'Drupal')) . "</title>\n"; + $output .= '<dateModified>' . gmdate('r') . "</dateModified>\n"; $output .= "</head>\n"; $output .= "<body>\n"; foreach ($feeds as $feed) { - $output .= '<outline text="'. check_plain($feed->title) .'" xmlUrl="'. check_url($feed->url) ."\" />\n"; + $output .= '<outline text="' . check_plain($feed->title) . '" xmlUrl="' . check_url($feed->url) . "\" />\n"; } $output .= "</body>\n"; $output .= "</opml>\n"; |