'. 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_menu(). */ function aggregator_menu($may_cache) { $items = array(); $edit = user_access('administer news feeds'); $view = user_access('access news feeds'); if ($may_cache) { $items[] = array('path' => 'admin/content/aggregator', 'title' => t('News aggregator'), 'description' => t("Configure which content your site aggregates from other sites, how often it polls them, and how they're categorized."), 'callback' => 'aggregator_admin_overview', 'access' => $edit); $items[] = array('path' => 'admin/content/aggregator/add/feed', 'title' => t('Add feed'), 'callback' => 'drupal_get_form', 'callback arguments' => array('aggregator_form_feed'), 'access' => $edit, 'type' => MENU_LOCAL_TASK); $items[] = array('path' => 'admin/content/aggregator/add/category', 'title' => t('Add category'), 'callback' => 'drupal_get_form', 'callback arguments' => array('aggregator_form_category'), 'access' => $edit, 'type' => MENU_LOCAL_TASK); $items[] = array( 'path' => 'admin/content/aggregator/remove', 'title' => t('Remove items'), 'callback' => 'drupal_get_form', 'callback arguments' => array('aggregator_admin_remove_feed'), 'access' => $edit, 'type' => MENU_CALLBACK, ); $items[] = array('path' => 'admin/content/aggregator/update', 'title' => t('Update items'), 'callback' => 'aggregator_admin_refresh_feed', 'access' => $edit, 'type' => MENU_CALLBACK); $items[] = array('path' => 'admin/content/aggregator/list', 'title' => t('List'), 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10); $items[] = array('path' => 'admin/content/aggregator/settings', 'title' => t('Settings'), 'callback' => 'drupal_get_form', 'callback arguments' => array('aggregator_admin_settings'), 'type' => MENU_LOCAL_TASK, 'weight' => 10, 'access' => $edit); $items[] = array('path' => 'aggregator', 'title' => t('News aggregator'), 'callback' => 'aggregator_page_last', 'access' => $view, 'weight' => 5); $items[] = array('path' => 'aggregator/sources', 'title' => t('Sources'), 'callback' => 'aggregator_page_sources', 'access' => $view); $items[] = array('path' => 'aggregator/categories', 'title' => t('Categories'), 'callback' => 'aggregator_page_categories', 'access' => $view, 'type' => MENU_ITEM_GROUPING); $items[] = array('path' => 'aggregator/rss', 'title' => t('RSS feed'), 'callback' => 'aggregator_page_rss', 'access' => $view, 'type' => MENU_CALLBACK); $items[] = array('path' => 'aggregator/opml', 'title' => t('OPML feed'), 'callback' => 'aggregator_page_opml', 'access' => $view, 'type' => MENU_CALLBACK); $result = db_query('SELECT title, cid FROM {aggregator_category} ORDER BY title'); while ($category = db_fetch_array($result)) { $items[] = array('path' => 'aggregator/categories/'. $category['cid'], 'title' => $category['title'], 'callback' => 'aggregator_page_category', 'access' => $view); } } else { // Add the CSS for this module // We put this in !$may_cache so it's only added once per request drupal_add_css(drupal_get_path('module', 'aggregator') .'/aggregator.css'); if (arg(0) == 'aggregator' && is_numeric(arg(2))) { if (arg(1) == 'sources') { $feed = aggregator_get_feed(arg(2)); if ($feed) { $items[] = array('path' => 'aggregator/sources/'. $feed['fid'], 'title' => $feed['title'], 'callback' => 'aggregator_page_source', 'access' => $view, 'type' => MENU_CALLBACK); $items[] = array('path' => 'aggregator/sources/'. $feed['fid'] .'/view', 'title' => t('View'), 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10); $items[] = array('path' => 'aggregator/sources/'. $feed['fid'] .'/categorize', 'title' => t('Categorize'), 'callback' => 'drupal_get_form', 'callback arguments' => array('aggregator_page_source'), 'access' => $edit, 'type' => MENU_LOCAL_TASK); $items[] = array('path' => 'aggregator/sources/'. $feed['fid'] .'/configure', 'title' => t('Configure'), 'callback' => 'drupal_get_form', 'callback arguments' => array('aggregator_form_feed', $feed), 'access' => $edit, 'type' => MENU_LOCAL_TASK, 'weight' => 1); } } else if (arg(1) == 'categories') { $category = aggregator_get_category(arg(2)); if ($category) { $items[] = array('path' => 'aggregator/categories/'. $category['cid'] .'/view', 'title' => t('View'), 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10); $items[] = array('path' => 'aggregator/categories/'. $category['cid'] .'/categorize', 'title' => t('Categorize'), 'callback' => 'drupal_get_form', 'callback arguments' => array('aggregator_page_category'), 'access' => $edit, 'type' => MENU_LOCAL_TASK); $items[] = array('path' => 'aggregator/categories/'. $category['cid'] .'/configure', 'title' => t('Configure'), 'callback' => 'drupal_get_form', 'callback arguments' => array('aggregator_form_category', $category), 'access' => $edit, 'type' => MENU_LOCAL_TASK, 'weight' => 1); } } } else if (arg(2) == 'aggregator' && is_numeric(arg(5))) { if (arg(4) == 'feed') { $feed = aggregator_get_feed(arg(5)); if ($feed) { $items[] = array('path' => 'admin/content/aggregator/edit/feed/'. $feed['fid'], 'title' => t('Edit feed'), 'callback' => 'drupal_get_form', 'callback arguments' => array('aggregator_form_feed', $feed), 'access' => $edit, 'type' => MENU_CALLBACK); } } else { $category = aggregator_get_category(arg(5)); if ($category) { $items[] = array('path' => 'admin/content/aggregator/edit/category/'. $category['cid'], 'title' => t('Edit category'), 'callback' => 'drupal_get_form', 'callback arguments' => array('aggregator_form_category', $category), 'access' => $edit, 'type' => MENU_CALLBACK); } } } } return $items; } 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', '