From 6b63aa663833ef24a1b712dde6b90ce32d24ecbb Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 20 Aug 2003 21:00:31 +0000 Subject: - Updated the import module to the new documentation scheme. Patch by Michael. --- modules/import.module | 138 +++++++++++++++++++++++++++++--------------------- 1 file changed, 81 insertions(+), 57 deletions(-) (limited to 'modules/import.module') diff --git a/modules/import.module b/modules/import.module index 4ae74fd54..1332a449a 100644 --- a/modules/import.module +++ b/modules/import.module @@ -2,58 +2,86 @@ // $Id$ -function import_help() { - $output .= "

Thousands of web sites, especially news sites and weblogs, syndicate their most recent site content for others to display. The syndicated content always includes titles, also known as headlines, for the newest published stories. Each headline acts as a direct link to the stories on the remote site. Along with the headline, most sites typically provide either the first few paragraphs of the story or a short summary. Many individuals use client-based news aggregators on their personal computer to aggregate content, such as AmphetaDesk.

"; - - $output .= "

Drupal also has a news aggregator built in as a standard feature. With it, you can subscribe to feeds from other sites and display their content for your site users. Simply enable the import module in site administration and enter the feeds that you choose.

"; - $output .= "

What do I need to subscribe to a feed?

"; - $output .= "

The standard method of syndication is using the XML-based Rich Site Summary (RSS). To syndicate a site's content, obtain the full URL of the RSS page providing syndication. Common file tags for RSS pages are .rss, .xml and .rdf. Example: http://slashdot.org/slashdot.rdf.

"; - $output .= "

Most weblog sites that offer syndication will have an obvious link on the main page. Often you need only look for an xml syndication button, such as the one Drupal uses for site syndication.

"; - $output .= "

But some sites do not make their RSS feeds as easy to find. Or maybe you want to find a number of feeds on a given topic, without extensively searching the web. In that case, try an RSS syndication directory such as Syndic8.

"; - $output .= "

To learn much more about RSS, read Mark Pilgrim's What is RSS and WebReference.com's The Evolution of RSS.

"; - $output .= "

NOTE: Enable your site's xml syndication button by turning on the Syndicate block in block management.

"; - $output .= "

Configuring news feeds

"; - $output .= "

To subscribe to an RSS feed on another site, use the administer news feeds shortcut at the top of the news aggregation page. The link leads directly to the news aggregation configuration section of Drupal site administration.

"; - $output .= "

Once there, select add new feed from the left hand menu. Drupal will then ask for the following:

"; - $output .= ""; - $output .= "

Once you submit your new feed, check to see if it is working properly. Select update items on the main news aggregation page. If you do not see any items listed for that feed, edit the feed and make sure that the URL was entered correctly.

"; - $output .= "

Adding bundles

"; - $output .= "

You may want to follow some feeds more closely than others. Or perhaps you'd like to display a select list of the titles for some feeds as a block for users. Bundles are a way of grouping your feeds into categories. Bundles look for feeds that contain at least one of the keywords, or attributes, associated with the bundle and display those feeds together.

"; - $output .= "

When adding a bundle, Drupal will ask for:

"; - $output .= ""; - $output .= "

Using the news aggregator

"; - $output .= "

The news aggregator has a number of ways that it displays your subscribed content:

"; - $output .= ""; - $output .= "

RSS feed blocks

"; - $output .= "

In addition to providing subscribed content through the news aggregator, Drupal automatically creates a block for each subscribed feed and every bundle created. Beside each headline in each block, Drupal includes an icon which acts a blog it link. Enable any or all of the blocks using block management.

"; - return $output; +function import_help($section = "admin/import/help") { + $output = ""; + + switch ($section) { + case 'admin/help': + case 'admin/import/help': + $output .= strtr("

Thousands of web sites, especially news sites and weblogs, syndicate their most recent site content for others to display. The syndicated content always includes titles, also known as headlines, for the newest published stories. Each headline acts as a direct link to the stories on the remote site. Along with the headline, most sites typically provide either the first few paragraphs of the story or a short summary. Many individuals use client-based news aggregators on their personal computer to aggregate content, such as %amphetadesk

", array("%amphetadesk" => "". t("AmphetaDesk") ."")); + + $output .= "

Drupal also has a news aggregator built in as a standard feature. With it, you can subscribe to feeds from other sites and display their content for your site users. Simply enable the import module in site administration and enter the feeds that you choose.

"; + $output .= "

What do I need to subscribe to a feed?

"; + $output .= strtr("

The standard method of syndication is using the XML-based %rss (RSS). To syndicate a site's content, obtain the full URL of the RSS page providing syndication. Common file tags for RSS pages are .rss, .xml and .rdf. Example: %slashdot-rss.

", array("%rss" => "". t("Rich Site Summary") ."", "%slashdot-rss" => "". t("http://slashdot.org/slashdot.rfd") ."")); + $output .= "

Most weblog sites that offer syndication will have an obvious link on the main page. Often you need only look for an xml syndication button, such as the one Drupal uses for site syndication.

"; + $output .= strtr("

But some sites do not make their RSS feeds as easy to find. Or maybe you want to find a number of feeds on a given topic, without extensively searching the web. In that case, try an RSS syndication directory such as %syndic8.

", array("%syndic8" => "". t("Syndic8") ."")); + $output .= strtr("

To learn much more about RSS, read Mark Pilgrim's %rss-what and WebReference.com's %rss-evolution.

", array("%rss-what" => "". t("What is RSS") ."", "%rss-evolution" => "". t("The Evolution of RSS") ."")); + $output .= "

NOTE: Enable your site's xml syndication button by turning on the Syndicate block in block management.

"; + $output .= "

Configuring news feeds

"; + $output .= strtr("

To subscribe to an RSS feed on another site, use the %admin-news shortcut at the top of the news aggregation page. The link leads directly to the news aggregation configuration section of Drupal site administration.

", array("%admin-news" => l(t("administer news feeds"), "admin/syndication/news"))); + $output .= strtr("

Once there, select %new-feed from the left hand menu. Drupal will then ask for the following:

", array("%new-feed" => l(t("add new feed"), "admin/syndication/news/add/feed") )); + $output .= ""; + $output .= strtr("

Once you submit your new feed, check to see if it is working properly. Select %update-items on the %main-aggregation page. If you do not see any items listed for that feed, edit the feed and make sure that the URL was entered correctly.

", array("%update-items" => l(t("update items"), "admin/syndication/news"), "%main-aggregation" => l(t("main news aggregation"), "admin/syndication/news") )); + $output .= "

Adding bundles

"; + $output .= "

You may want to follow some feeds more closely than others. Or perhaps you'd like to display a select list of the titles for some feeds as a block for users. Bundles are a way of grouping your feeds into categories. Bundles look for feeds that contain at least one of the keywords, or attributes, associated with the bundle and display those feeds together.

"; + $output .= "

When adding a bundle, Drupal will ask for:

"; + $output .= ""; + $output .= "

Using the news aggregator

"; + $output .= "

The news aggregator has a number of ways that it displays your subscribed content:

"; + $output .= ""; + $output .= "

RSS feed blocks

"; + $output .= "

In addition to providing subscribed content through the news aggregator, Drupal automatically creates a block for each subscribed feed and every bundle created. Beside each headline in each block, Drupal includes an icon which acts a blog it link. Enable any or all of the blocks using block management.

"; + break; + case 'admin/system/modules': + $output = "Used to aggregate syndicated content (RSS and RDF)."; + break; + case 'admin/system/modules/import': + $output = "Drupal's news aggregator controls how many RSS/RDF items from a single source are displayed in a \"Block\", and on the page that goes with that block."; + break; + case 'admin/syndication/news': + $output = strtr("Several web sites, especially news related sites, syndicate parts of their site's content for other web sites to display. Usually, the syndicated content includes the latest headlines with a direct link to that story on the remote site. Some syndicated content also includes a description of the headline. The standard method of syndication is using the XML based Rich Site Summary (RSS). To get a feed to work you must run \"cron.php\". To display the feed in a block you must turn on the %block.
", array("%block" => l(t("feed's block"), "admin/block") )); + break; + case 'admin/syndication/news/add/feed': + $output = strtr("Add a site that has an RSS/RDF feed. The URL is the full path to the RSS feed file. For the feed to update automatically you must run \"cron.php\". The \"Attributes\" are used to bundle this feed with other feeds (See %bundle), and to tag articles from this feed.
Note: 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.", array("%bundle" => l(t("add new bundle"), "admin/syndication/news/add/bundle") )); + break; + case 'admin/syndication/news/add/bundle': + $output = strtr("Bundles provide a generalized way of creating composite feeds. They allow you, for example, to combine various sport-related feeds into one bundle called Sport. If an article from a feed has been \"tag\"-ged (See %tag too look at and change tags.) with a matching \"Attribute\" then it will be added to the bundle.", array("%tag" => l(t("tag news item"), "admin/syndication/news/tag") )); + break; + case 'admin/syndication/news/tag': + $output = "This allows you to see and change an news item's \"tag\". All articles are originally tagged with the \"Attributes\" of their feed."; + break; + } + + return t($output); } function import_system($field){ - $system["description"] = t("Used to aggregate syndicated content (RSS and RDF)."); - $system["admin_help"] = t("Drupal's news aggregator controls how many RSS/RDF items from a single source are displayed in a \"Block\", and on the page that goes with that block."); + $output = ""; + + if ($field == "description") {$output = import_help("admin/system/modules"); } + else if ($field == "admin_help") {$output = import_help("admin/system/modules/import"); }; + return $system[$field]; } @@ -78,16 +106,12 @@ function import_link($type) { } if ($type == "admin" && user_access("administer news feeds")) { - $help["general"] = t("Several web sites, especially news related sites, syndicate parts of their site's content for other web sites to display. Usually, the syndicated content includes the latest headlines with a direct link to that story on the remote site. Some syndicated content also includes a description of the headline. The standard method of syndication is using the XML based Rich Site Summary (RSS). To get a feed to work you must run \"cron.php\". To display the feed in a block you must turn on the feed's block.
", array("%block" => url("admin/block"))); - $help["addfeed"] = t("Add a site to that has an RSS/RDF feed. The URL is the full path to the RSS feed file. For the feed to update you must run \"cron.php\". The \"Attributes\" are used to bundle this feed with other feeds (See add new bundle, and to tag articles from this feed.
Note: If you already have another feed with the URL you are planning to use, the system will not accept your entry.", array("%bundle" => url("admin/syndication/news/add/bundle"))); - $help["bundles"] = t("Bundles provide a generalized way of creating composite feeds. They allow you, for example, to combine various sport-related feeds into one bundle called Sport. If an article from a feed has been \"tag\"-ged (See tag news item too look at and change tags.) with a matching \"Attribute\" then it will be added to the bundle.", array("%tag" => url("admin/syndication/news/tag"))); - $help["tag"] = t("This allows you to see and change an news item's \"tag\". All articles are originally tagged with the \"Attributes\" of their feed."); menu("admin/syndication", "content syndication", NULL, NULL, 5); - menu("admin/syndication/news", "news aggregation", "import_admin", $help["general"]); - menu("admin/syndication/news/add/feed", "add new feed", "import_admin", $help["addfeed"], 2); - menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", $help["bundles"], 3); - menu("admin/syndication/news/tag", "tag news items", "import_admin", $help["tag"], 4); + menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") ); + menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2); + menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3); + menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4); menu("admin/syndication/news/help", "help", "import_help", NULL, 9); } -- cgit v1.2.3