From 208eabd908293ffc4ca55671be02b7c8f9c28ca1 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 29 Sep 2003 19:11:39 +0000 Subject: - Fixed import and comment module problems. Patch by Gabor. > Currently the admin menu does not work for comment.module and import > module. Import module has the problem of not taking care of the fact in > the arg() function calls that the module is pushed one level down in the > menu (similar to the user.module and block.modules problems already > fixed). The comment.module has a problem with trying to translate an $op > which comes from the URL (and is therefore not translated). > > The attached patch also fixes the bogus URLs in import.module help texts > (as the module part is pushed down into /admin/node instead of /admin). --- modules/import.module | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'modules/import.module') diff --git a/modules/import.module b/modules/import.module index 93ada3be9..0bf4a2abe 100644 --- a/modules/import.module +++ b/modules/import.module @@ -18,15 +18,15 @@ function import_help($section = "admin/import/help") { $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 .= 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/node/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/node/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 .= 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/node/syndication/news"), "%main-aggregation" => l(t("main news aggregation"), "admin/node/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:

"; @@ -63,10 +63,10 @@ function import_help($section = "admin/import/help") { $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/node/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") )); + $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/node/syndication/news/add/bundle") )); break; case 'admin/node/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") )); + $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/node/syndication/news/tag") )); break; case 'admin/node/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."; @@ -530,7 +530,7 @@ function import_view() { $header = array(t("title"), t("attributes"), t("items"), t("last update"), t("next update"), array("data" => t("operations"), "colspan" => 3)); unset($rows); while ($feed = db_fetch_object($result)) { - $rows[] = array($feed->title, $feed->attributes, format_plural($feed->items, "1 item", "%count items"), ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never"), ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never"), l(t("edit feed"), "admin/syndication/news/edit/feed/$feed->fid"), l(t("remove items"), "admin/syndication/news/remove/$feed->fid"), l(t("update items"), "admin/syndication/news/update/$feed->fid")); + $rows[] = array($feed->title, $feed->attributes, format_plural($feed->items, "1 item", "%count items"), ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never"), ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never"), l(t("edit feed"), "admin/node/syndication/news/edit/feed/$feed->fid"), l(t("remove items"), "admin/node/syndication/news/remove/$feed->fid"), l(t("update items"), "admin/node/syndication/news/update/$feed->fid")); } $output .= table($header, $rows); @@ -541,7 +541,7 @@ function import_view() { $header = array(t("title"), t("attributes"), t("operations")); unset($rows); while ($bundle = db_fetch_object($result)) { - $rows[] = array($bundle->title, $bundle->attributes, l(t("edit bundle"), "admin/syndication/news/edit/bundle/$bundle->bid")); + $rows[] = array($bundle->title, $bundle->attributes, l(t("edit bundle"), "admin/node/syndication/news/edit/bundle/$bundle->bid")); } $output .= table($header, $rows); @@ -554,7 +554,7 @@ function import_tag() { $header = array(t("date"), t("feed"), t("news item")); while ($item = db_fetch_object($result)) { - $rows[] = array(array("data" => format_date($item->timestamp, "small"), "nowrap" => "nowrap", "valign" => "top"), array("data" => l($item->feed, "admin/syndication/news/edit/feed/$item->fid"), "valign" => "top"), "link\">$item->title". ($item->description ? "
$item->description" : "") ."
iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" />"); + $rows[] = array(array("data" => format_date($item->timestamp, "small"), "nowrap" => "nowrap", "valign" => "top"), array("data" => l($item->feed, "admin/node/syndication/news/edit/feed/$item->fid"), "valign" => "top"), "link\">$item->title". ($item->description ? "
$item->description" : "") ."
iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" />"); } $output .= table($header, $rows); @@ -570,12 +570,12 @@ function import_admin() { if (user_access("administer news feeds")) { if (empty($op)) { - $op = arg(3); + $op = arg(4); } switch ($op) { case "add": - if (arg(4) == "bundle") { + if (arg(5) == "bundle") { $output = import_form_bundle(); } else { @@ -583,7 +583,7 @@ function import_admin() { } break; case "edit": - if (arg(4) == "bundle") { + if (arg(5) == "bundle") { $output = import_form_bundle(import_get_bundle(arg(5))); } else { @@ -609,7 +609,7 @@ function import_admin() { $edit["title"] = 0; // fall through: case "Submit": - if (arg(4) == "bundle") { + if (arg(5) == "bundle") { $output = status(import_save_bundle($edit)); } else { @@ -636,7 +636,7 @@ function import_page_info() { $links[] = l(t("news sources"), "import/sources", array("title" => t("View a list of all the web sites we syndicate from."))); if (user_access("administer news feeds")) { - $links[] = l(t("administer news feeds"), "admin/syndication/news", array("title" => t("View the news feed administrative pages."))); + $links[] = l(t("administer news feeds"), "admin/node/syndication/news", array("title" => t("View the news feed administrative pages."))); } return "
". theme("links", $links) ."
"; -- cgit v1.2.3