summaryrefslogtreecommitdiff
path: root/modules/aggregator
diff options
context:
space:
mode:
Diffstat (limited to 'modules/aggregator')
-rw-r--r--modules/aggregator/aggregator-feed-source.tpl.php1
-rw-r--r--modules/aggregator/aggregator-item.tpl.php1
-rw-r--r--modules/aggregator/aggregator-rtl.css1
-rw-r--r--modules/aggregator/aggregator-summary-item.tpl.php1
-rw-r--r--modules/aggregator/aggregator-summary-items.tpl.php1
-rw-r--r--modules/aggregator/aggregator-wrapper.tpl.php1
-rw-r--r--modules/aggregator/aggregator.admin.inc14
-rw-r--r--modules/aggregator/aggregator.api.php1
-rw-r--r--modules/aggregator/aggregator.css1
-rw-r--r--modules/aggregator/aggregator.fetcher.inc1
-rw-r--r--modules/aggregator/aggregator.info1
-rw-r--r--modules/aggregator/aggregator.install1
-rw-r--r--modules/aggregator/aggregator.module26
-rw-r--r--modules/aggregator/aggregator.pages.inc1
-rw-r--r--modules/aggregator/aggregator.parser.inc7
-rw-r--r--modules/aggregator/aggregator.processor.inc5
-rw-r--r--modules/aggregator/aggregator.test4
-rw-r--r--modules/aggregator/tests/aggregator_test.info1
-rw-r--r--modules/aggregator/tests/aggregator_test.module1
19 files changed, 29 insertions, 41 deletions
diff --git a/modules/aggregator/aggregator-feed-source.tpl.php b/modules/aggregator/aggregator-feed-source.tpl.php
index 46894e9fe..6a684bdb7 100644
--- a/modules/aggregator/aggregator-feed-source.tpl.php
+++ b/modules/aggregator/aggregator-feed-source.tpl.php
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
diff --git a/modules/aggregator/aggregator-item.tpl.php b/modules/aggregator/aggregator-item.tpl.php
index 854e3fa9e..c5dd70c67 100644
--- a/modules/aggregator/aggregator-item.tpl.php
+++ b/modules/aggregator/aggregator-item.tpl.php
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
diff --git a/modules/aggregator/aggregator-rtl.css b/modules/aggregator/aggregator-rtl.css
index 508ca31c1..ea59ca3a1 100644
--- a/modules/aggregator/aggregator-rtl.css
+++ b/modules/aggregator/aggregator-rtl.css
@@ -1,4 +1,3 @@
-/* $Id$ */
#aggregator .feed-source .feed-icon {
float: left;
diff --git a/modules/aggregator/aggregator-summary-item.tpl.php b/modules/aggregator/aggregator-summary-item.tpl.php
index ec96b9a4f..1c8299938 100644
--- a/modules/aggregator/aggregator-summary-item.tpl.php
+++ b/modules/aggregator/aggregator-summary-item.tpl.php
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
diff --git a/modules/aggregator/aggregator-summary-items.tpl.php b/modules/aggregator/aggregator-summary-items.tpl.php
index 3d3593082..0e2133a1e 100644
--- a/modules/aggregator/aggregator-summary-items.tpl.php
+++ b/modules/aggregator/aggregator-summary-items.tpl.php
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
diff --git a/modules/aggregator/aggregator-wrapper.tpl.php b/modules/aggregator/aggregator-wrapper.tpl.php
index 536da1864..80b903271 100644
--- a/modules/aggregator/aggregator-wrapper.tpl.php
+++ b/modules/aggregator/aggregator-wrapper.tpl.php
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
diff --git a/modules/aggregator/aggregator.admin.inc b/modules/aggregator/aggregator.admin.inc
index a2d964917..08087afb2 100644
--- a/modules/aggregator/aggregator.admin.inc
+++ b/modules/aggregator/aggregator.admin.inc
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
@@ -350,16 +349,17 @@ function aggregator_form_opml_submit($form, &$form_state) {
/**
* Parse an OPML file.
*
- * Feeds are recognized as <outline> elements with the attributes
- * <em>text</em> and <em>xmlurl</em> set.
+ * Feeds are recognized as <outline> elements with the attributes "text" and
+ * "xmlurl" set.
*
* @param $opml
* The complete contents of an OPML document.
+ *
* @return
- * An array of feeds, each an associative array with a <em>title</em> and
- * a <em>url</em> element, or NULL if the OPML document failed to be parsed.
- * An empty array will be returned if the document is valid but contains
- * no feeds, as some OPML documents do.
+ * An array of feeds, each an associative array with a "title" and a "url"
+ * element, or NULL if the OPML document failed to be parsed. An empty
+ * array will be returned if the document is valid but contains no feeds, as
+ * some OPML documents do.
*/
function _aggregator_parse_opml($opml) {
$feeds = array();
diff --git a/modules/aggregator/aggregator.api.php b/modules/aggregator/aggregator.api.php
index cfdac8f16..f31413c42 100644
--- a/modules/aggregator/aggregator.api.php
+++ b/modules/aggregator/aggregator.api.php
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
diff --git a/modules/aggregator/aggregator.css b/modules/aggregator/aggregator.css
index 0ee9f88bb..13c58ffe7 100644
--- a/modules/aggregator/aggregator.css
+++ b/modules/aggregator/aggregator.css
@@ -1,4 +1,3 @@
-/* $Id$ */
#aggregator .feed-source .feed-title {
margin-top: 0;
diff --git a/modules/aggregator/aggregator.fetcher.inc b/modules/aggregator/aggregator.fetcher.inc
index 0974a6926..0f7287798 100644
--- a/modules/aggregator/aggregator.fetcher.inc
+++ b/modules/aggregator/aggregator.fetcher.inc
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
diff --git a/modules/aggregator/aggregator.info b/modules/aggregator/aggregator.info
index d97d68bac..988111e0f 100644
--- a/modules/aggregator/aggregator.info
+++ b/modules/aggregator/aggregator.info
@@ -1,4 +1,3 @@
-; $Id$
name = Aggregator
description = "Aggregates syndicated content (RSS, RDF, and Atom feeds)."
package = Core
diff --git a/modules/aggregator/aggregator.install b/modules/aggregator/aggregator.install
index 6f5230db7..f19d7de9b 100644
--- a/modules/aggregator/aggregator.install
+++ b/modules/aggregator/aggregator.install
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 4d70102cc..1e1686af8 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
@@ -27,9 +26,9 @@ function aggregator_help($path, $arg) {
$output .= '<dt>' . t('Adding, editing, and deleting feeds') . '</dt>';
$output .= '<dd>' . t('Administrators can add, edit, and delete feeds, and choose how often to check each feed for newly updated items on the <a href="@feededit">Feed aggregator administration page</a>.', array('@feededit' => url('admin/config/services/aggregator'))) . '</dd>';
$output .= '<dt>' . t('OPML integration') . '</dt>';
- $output .= '<dd>' . t('A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. OPML is an XML-based file format used to share outline-structured information such as a list of RSS feeds. Feeds can also be <a href="@import-opml">imported via an OPML file</a>.', array('@aggregator-opml' => url('aggregator/opml'), '@import-opml' => url('admin/config/services/aggregator'))) . '</dd>';
+ $output .= '<dd>' . t('A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. OPML is an XML-based file format used to share outline-structured information such as a list of RSS feeds. Feeds can also be <a href="@import-opml">imported via an OPML file</a>.', array('@aggregator-opml' => url('aggregator/opml'), '@import-opml' => url('admin/config/services/aggregator'))) . '</dd>';
$output .= '<dt>' . t('Configuring cron') . '</dt>';
- $output .= '<dd>' . t('A correctly configured <a href="@cron">cron maintenance task</a> is required to update feeds automatically.', array('@cron' => 'http://drupal.org/cron')) . '</dd>';
+ $output .= '<dd>' . t('A correctly configured <a href="@cron">cron maintenance task</a> is required to update feeds automatically.', array('@cron' => 'http://drupal.org/cron')) . '</dd>';
$output .= '</dl>';
return $output;
case 'admin/config/services/aggregator':
@@ -195,7 +194,6 @@ function aggregator_menu() {
'title arguments' => array(2),
'page callback' => 'aggregator_page_category',
'page arguments' => array(2),
- 'access callback' => 'user_access',
'access arguments' => array('access news feeds'),
'file' => 'aggregator.pages.inc',
);
@@ -268,7 +266,7 @@ function aggregator_menu() {
}
/**
- * Menu callback.
+ * Title callback for aggregatory category pages.
*
* @return
* An aggregator category title.
@@ -281,7 +279,8 @@ function _aggregator_category_title($category) {
* Find out whether there are any aggregator categories.
*
* @return
- * TRUE if there is at least one category and the user has access to them, FALSE otherwise.
+ * TRUE if there is at least one category and the user has access to them, FALSE
+ * otherwise.
*/
function _aggregator_has_categories() {
return user_access('access news feeds') && db_query('SELECT COUNT(*) FROM {aggregator_category}')->fetchField();
@@ -307,7 +306,7 @@ function aggregator_permission() {
* Queues news feeds for updates once their refresh interval has elapsed.
*/
function aggregator_cron() {
- $result = db_query('SELECT * FROM {aggregator_feed} WHERE queued = 0 AND checked + refresh < :time AND refresh != :never', array(
+ $result = db_query('SELECT * FROM {aggregator_feed} WHERE queued = 0 AND checked + refresh < :time AND refresh <> :never', array(
':time' => REQUEST_TIME,
':never' => AGGREGATOR_CLEAR_NEVER
));
@@ -344,16 +343,16 @@ function aggregator_cron_queue_info() {
* Implements hook_block_info().
*/
function aggregator_block_info() {
- $block = array();
+ $blocks = array();
$result = db_query('SELECT cid, title FROM {aggregator_category} ORDER BY title');
foreach ($result as $category) {
- $block['category-' . $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title));
+ $blocks['category-' . $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title));
}
$result = db_query('SELECT fid, title FROM {aggregator_feed} WHERE block <> 0 ORDER BY fid');
foreach ($result as $feed) {
- $block['feed-' . $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title));
+ $blocks['feed-' . $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title));
}
- return $block;
+ return $blocks;
}
/**
@@ -367,7 +366,7 @@ function aggregator_block_configure($delta = '') {
'#type' => 'select',
'#title' => t('Number of news items in block'),
'#default_value' => $value,
- '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20))
+ '#options' => drupal_map_assoc(range(2, 20)),
);
return $form;
}
@@ -720,7 +719,8 @@ function aggregator_filter_xss($value) {
/**
* Check and sanitize aggregator configuration.
*
- * Goes through all fetchers, parsers and processors and checks whether they are available.
+ * Goes through all fetchers, parsers and processors and checks whether they are
+ * available.
* If one is missing resets to standard configuration.
*
* @return
diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc
index 3ea59352a..53ecb3684 100644
--- a/modules/aggregator/aggregator.pages.inc
+++ b/modules/aggregator/aggregator.pages.inc
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
diff --git a/modules/aggregator/aggregator.parser.inc b/modules/aggregator/aggregator.parser.inc
index 4b1ff2053..cffd1c3aa 100644
--- a/modules/aggregator/aggregator.parser.inc
+++ b/modules/aggregator/aggregator.parser.inc
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
@@ -125,7 +124,11 @@ function aggregator_parse_feed(&$data, $feed) {
else {
$item['link'] = $feed->link;
}
- $item['guid'] = isset($item['guid']) ? $item['guid'] : '';
+
+ // Atom feeds have an ID tag instead of a GUID tag.
+ if (!isset($item['guid'])) {
+ $item['guid'] = isset($item['id']) ? $item['id'] : '';
+ }
// Atom feeds have a content and/or summary tag instead of a description tag.
if (!empty($item['content:encoded'])) {
diff --git a/modules/aggregator/aggregator.processor.inc b/modules/aggregator/aggregator.processor.inc
index cd74c0337..6eb2c662f 100644
--- a/modules/aggregator/aggregator.processor.inc
+++ b/modules/aggregator/aggregator.processor.inc
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* @file
@@ -163,8 +162,8 @@ function aggregator_save_item($edit) {
$result = db_query('SELECT cid FROM {aggregator_category_feed} WHERE fid = :fid', array(':fid' => $edit['fid']));
foreach ($result as $category) {
db_merge('aggregator_category_item')
- ->key(array('iid' => $edit['iid']))
- ->fields(array(
+ ->key(array(
+ 'iid' => $edit['iid'],
'cid' => $category->cid,
))
->execute();
diff --git a/modules/aggregator/aggregator.test b/modules/aggregator/aggregator.test
index abe7804d5..1ab12dc2e 100644
--- a/modules/aggregator/aggregator.test
+++ b/modules/aggregator/aggregator.test
@@ -1,9 +1,8 @@
<?php
-// $Id$
/**
* @file
- * Creates tests for aggregator module.
+ * Tests for aggregator.module.
*/
class AggregatorTestCase extends DrupalWebTestCase {
@@ -854,6 +853,7 @@ class FeedParserTestCase extends AggregatorTestCase {
$this->assertText('Atom-Powered Robots Run Amok');
$this->assertLinkByHref('http://example.org/2003/12/13/atom03');
$this->assertText('Some text.');
+ $this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', db_query('SELECT guid FROM {aggregator_item} WHERE link = :link', array(':link' => 'http://example.org/2003/12/13/atom03'))->fetchField(), 'Atom entry id element is parsed correctly.');
}
}
diff --git a/modules/aggregator/tests/aggregator_test.info b/modules/aggregator/tests/aggregator_test.info
index 1a6651341..b8dd19d98 100644
--- a/modules/aggregator/tests/aggregator_test.info
+++ b/modules/aggregator/tests/aggregator_test.info
@@ -1,4 +1,3 @@
-; $Id$
name = "Aggregator module tests"
description = "Support module for aggregator related testing."
package = Testing
diff --git a/modules/aggregator/tests/aggregator_test.module b/modules/aggregator/tests/aggregator_test.module
index 0e67bbf59..2d26a5d9a 100644
--- a/modules/aggregator/tests/aggregator_test.module
+++ b/modules/aggregator/tests/aggregator_test.module
@@ -1,5 +1,4 @@
<?php
-// $Id$
/**
* Implements hook_menu().