'. t('The news aggregator is a powerful on-site RSS syndicator/news reader that can gather fresh content from news sites and weblogs around the web.') .'

'; $output .= '

'. t('Users can view the latest news chronologically in the main news aggregator display or by source. Administrators can add, edit and delete feeds and choose how often to check for newly updated news for each individual feed. Administrators can also tag individual feeds with categories, offering selective grouping of some feeds into separate displays. Listings of the latest news for individual sources or categorized sources can be enabled as blocks for display in the sidebar through the block administration page. The news aggregator requires cron to check for the latest news from the sites to which you have subscribed. Drupal also provides a machine-readable OPML file of all of your subscribed feeds.', array('@aggregator' => url('aggregator'), '@aggregator-sources' => url('aggregator/sources'), '@admin-block' => url('admin/build/block'), '@aggregator-opml' => url('aggregator/opml'))) .'

'; $output .= '

'. t('For more information please read the configuration and customization handbook Aggregator page.', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) .'

'; return $output; case 'admin/content/aggregator': return '

'. t('Thousands of sites (particularly news sites and weblogs) publish their latest headlines and/or stories in a machine-readable format so that other sites can easily link to them. This content is usually in the form of an RSS feed (which is an XML-based syndication standard). To display the feed or category in a block you must decide how many items to show by editing the feed or block and turning on the feed\'s block.', array('@block' => url('admin/build/block'))) .'

'; case 'admin/content/aggregator/add/feed': return '

'. t('Add a site that has an RSS/RDF/Atom feed. The URL is the full path to the feed file. For the feed to update automatically you must run "cron.php" on a regular basis. If you already have a feed with the URL you are planning to use, the system will not accept another feed with the same URL.') .'

'; case 'admin/content/aggregator/add/category': return '

'. t('Categories provide a way to group items from different news feeds together. Each news category has its own feed page and block. For example, you could tag various sport-related feeds as belonging to a category called Sports. News items can be added to a category automatically by setting a feed to automatically place its item into that category, or by using the categorize items link in any listing of news items.') .'

'; } } /** * Implementation of hook_theme() */ function aggregator_theme() { return array( 'aggregator_page_list' => array( 'arguments' => array('form' => NULL), ), 'aggregator_feed' => array( 'arguments' => array('feed' => NULL), ), 'aggregator_block_item' => array( 'arguments' => array('item' => NULL, 'feed' => 0), ), 'aggregator_summary_item' => array( 'arguments' => array('item' => NULL), ), 'aggregator_page_item' => array( 'arguments' => array('item' => NULL), ), ); } /** * Implementation of hook_menu(). */ function aggregator_menu() { $items['admin/content/aggregator'] = array( 'title' => 'News aggregator', 'description' => "Configure which content your site aggregates from other sites, how often it polls them, and how they're categorized.", 'page callback' => 'aggregator_admin_overview', 'access arguments' => array('administer news feeds'), ); $items['admin/content/aggregator/add/feed'] = array( 'title' => 'Add feed', 'page callback' => 'drupal_get_form', 'page arguments' => array('aggregator_form_feed'), 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_TASK, 'parent' => 'admin/content/aggregator', ); $items['admin/content/aggregator/add/category'] = array( 'title' => 'Add category', 'page callback' => 'drupal_get_form', 'page arguments' => array('aggregator_form_category'), 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_TASK, 'parent' => 'admin/content/aggregator', ); $items['admin/content/aggregator/remove/%aggregator_feed'] = array( 'title' => 'Remove items', 'page callback' => 'aggregator_admin_remove_feed', 'page arguments' => array(4), 'access arguments' => array('administer news feeds'), 'type' => MENU_CALLBACK, ); $items['admin/content/aggregator/update/%aggregator_feed'] = array( 'title' => 'Update items', 'page callback' => 'aggregator_admin_refresh_feed', 'page arguments' => array(4), 'access arguments' => array('administer news feeds'), 'type' => MENU_CALLBACK, ); $items['admin/content/aggregator/list'] = array( 'title' => 'List', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10, ); $items['admin/content/aggregator/settings'] = array( 'title' => 'Settings', 'page callback' => 'drupal_get_form', 'page arguments' => array('aggregator_admin_settings'), 'type' => MENU_LOCAL_TASK, 'weight' => 10, 'access arguments' => array('administer news feeds'), ); $items['aggregator'] = array( 'title' => 'News aggregator', 'page callback' => 'aggregator_page_last', 'access arguments' => array('access news feeds'), 'weight' => 5, ); $items['aggregator/sources'] = array( 'title' => 'Sources', 'page callback' => 'aggregator_page_sources', 'access arguments' => array('access news feeds')); $items['aggregator/categories'] = array( 'title' => 'Categories', 'page callback' => 'aggregator_page_categories', 'access callback' => '_aggregator_has_categories', ); $items['aggregator/rss'] = array( 'title' => 'RSS feed', 'page callback' => 'aggregator_page_rss', 'access arguments' => array('access news feeds'), 'type' => MENU_CALLBACK, ); $items['aggregator/opml'] = array( 'title' => 'OPML feed', 'page callback' => 'aggregator_page_opml', 'access arguments' => array('access news feeds'), 'type' => MENU_CALLBACK, ); $result = db_query('SELECT title, cid FROM {aggregator_category} ORDER BY title'); while ($category = db_fetch_array($result)) { $path = 'aggregator/categories/'. $category['cid']; $items[$path] = array( 'title' => $category['title'], 'page callback' => 'aggregator_page_category', 'access callback' => 'user_access', 'access arguments' => array('access news feeds'), ); $items[$path .'/view'] = array( 'title' => 'View', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10, ); $items[$path .'/categorize'] = array( 'title' => 'Categorize', 'page callback' => 'drupal_get_form', 'page arguments' => array('aggregator_page_category'), 'access arguments' => array('administer news feeds', 2), 'type' => MENU_LOCAL_TASK, ); $items[$path .'/configure'] = array( 'title' => 'Configure', 'page callback' => 'drupal_get_form', 'page arguments' => array('aggregator_form_category', 2), 'access arguments' => array('administer news feeds', 2), 'type' => MENU_LOCAL_TASK, 'weight' => 1, ); } $items['aggregator/sources/%aggregator_feed'] = array( 'page callback' => 'aggregator_page_source', 'type' => MENU_CALLBACK, ); $items['aggregator/sources/%aggregator_feed/view'] = array( 'title' => 'View', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10, ); $items['aggregator/sources/%aggregator_feed/categorize'] = array( 'title' => 'Categorize', 'page callback' => 'drupal_get_form', 'page arguments' => array('aggregator_page_source'), 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_TASK, ); $items['aggregator/sources/%aggregator_feed/configure'] = array( 'title' => 'Configure', 'page callback' => 'drupal_get_form', 'page arguments' => array('aggregator_form_feed', 2), 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_TASK, 'weight' => 1, ); $items['admin/content/aggregator/edit/feed/%aggregator_feed'] = array( 'title' => 'Edit feed', 'page callback' => 'drupal_get_form', 'page arguments' => array('aggregator_form_feed', 5), 'access arguments' => array('administer news feeds'), 'type' => MENU_CALLBACK, ); $items['admin/content/aggregator/edit/category/%aggregator_category'] = array( 'title' => 'Edit category', 'page callback' => 'drupal_get_form', 'page arguments' => array('aggregator_form_category', 5), 'access arguments' => array('administer news feeds'), 'type' => MENU_CALLBACK, ); return $items; } function aggregator_init() { drupal_add_css(drupal_get_path('module', 'aggregator') .'/aggregator.css'); } function _aggregator_has_categories() { return user_access('access news feeds') && db_result(db_query('SELECT COUNT(*) FROM {aggregator_category}')); } function aggregator_admin_settings() { $items = array(0 => t('none')) + drupal_map_assoc(array(3, 5, 10, 15, 20, 25), '_aggregator_items'); $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval'); $form['aggregator_allowed_html_tags'] = array( '#type' => 'textfield', '#title' => t('Allowed HTML tags'), '#size' => 80, '#maxlength' => 255, '#default_value' => variable_get('aggregator_allowed_html_tags', '