Commit 208eabd9 authored by Dries's avatar Dries
Browse files

- 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).
parent 7531e829
......@@ -18,15 +18,15 @@ function import_help($section = "admin/import/help") {
$output .= strtr("<p>To learn much more about RSS, read Mark Pilgrim's %rss-what and WebReference.com's %rss-evolution.</p>", array("%rss-what" => "<a href=\"http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html\">". t("What is RSS") ."</a>", "%rss-evolution" => "<a href=\"http://www.webreference.com/authoring/languages/xml/rss/1/\">". t("The Evolution of RSS") ."</a>"));
$output .= "<p>NOTE: Enable your site's xml syndication button by turning on the Syndicate block in block management.</p>";
$output .= "<h3>Configuring news feeds</h3>";
$output .= strtr("<p>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.</p>", array("%admin-news" => l(t("administer news feeds"), "admin/syndication/news")));
$output .= strtr("<p>Once there, select %new-feed from the left hand menu. Drupal will then ask for the following:</p>", array("%new-feed" => l(t("add new feed"), "admin/syndication/news/add/feed") ));
$output .= strtr("<p>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.</p>", array("%admin-news" => l(t("administer news feeds"), "admin/node/syndication/news")));
$output .= strtr("<p>Once there, select %new-feed from the left hand menu. Drupal will then ask for the following:</p>", array("%new-feed" => l(t("add new feed"), "admin/node/syndication/news/add/feed") ));
$output .= "<ul>";
$output .= "<li><b>Title</b> -- The text entered here will be used in your news aggregator, within the administration configuration section, and as title for the news feed block. As a general rule, use the web site name from which the feed originates.</li>";
$output .= " <li><b>URL</b> -- Here you'll enter the fully-qualified URL for the feed for the site you want to subscribe to.</li>";
$output .= "<li><b>Attributes</b> -- Attributes are keywords which can be used to collect feeds into <i>bundles</i> (see below). Think of these as the means of classifying your feeds. Separate multiple attributes with commas. If you do not plan on using the specific feed in a bundle, this input field can be left blank.</li>";
$output .= strtr("<li><b>Update interval</b> -- The update interval is how often Drupal will automatically access the RSS URL for the site for fresh content. The 1 hour default is typically the minimum you will want to use. Accessing another site's RSS page more frequently can be considered impolite. After all, it does require the other site's server handle your requests. To use this feature cron.php must be called regularly, otherwise, you'll have to manually update feeds one at a time within the news aggregation administration section by using %update-items.</li>", array("%update-items" => l(t("update items"), "admin/syndication/news") ));
$output .= strtr("<li><b>Update interval</b> -- The update interval is how often Drupal will automatically access the RSS URL for the site for fresh content. The 1 hour default is typically the minimum you will want to use. Accessing another site's RSS page more frequently can be considered impolite. After all, it does require the other site's server handle your requests. To use this feature cron.php must be called regularly, otherwise, you'll have to manually update feeds one at a time within the news aggregation administration section by using %update-items.</li>", array("%update-items" => l(t("update items"), "admin/node/syndication/news") ));
$output .= "</ul>";
$output .= strtr("<p>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.</p>", array("%update-items" => l(t("update items"), "admin/syndication/news"), "%main-aggregation" => l(t("main news aggregation"), "admin/syndication/news") ));
$output .= strtr("<p>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.</p>", array("%update-items" => l(t("update items"), "admin/node/syndication/news"), "%main-aggregation" => l(t("main news aggregation"), "admin/node/syndication/news") ));
$output .= "<h3>Adding bundles</h3>";
$output .= "<p>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.</p>";
$output .= "<p>When adding a bundle, Drupal will ask for:</p>";
......@@ -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 <b>must</b> run \"cron.php\". To display the feed in a block you must turn on the %block. <br /><ul><li>To delete a feed choose \"edit feed\"</li><li>To clear all of the entries from a feed choose \"Remove items\"</li><li>To check whether a feed is working, and to get new items <b>now</b> click on \"update items\"</li></ul><ul><li>To delete a bundle choose \"edit bundle\".</li></ul>", 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.<br />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.<br />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 <i>Sport</i>. 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 <i>Sport</i>. 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"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->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"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->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 "<div style=\"text-align: center;\">". theme("links", $links) ."</div>";
......
......@@ -18,15 +18,15 @@ function import_help($section = "admin/import/help") {
$output .= strtr("<p>To learn much more about RSS, read Mark Pilgrim's %rss-what and WebReference.com's %rss-evolution.</p>", array("%rss-what" => "<a href=\"http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html\">". t("What is RSS") ."</a>", "%rss-evolution" => "<a href=\"http://www.webreference.com/authoring/languages/xml/rss/1/\">". t("The Evolution of RSS") ."</a>"));
$output .= "<p>NOTE: Enable your site's xml syndication button by turning on the Syndicate block in block management.</p>";
$output .= "<h3>Configuring news feeds</h3>";
$output .= strtr("<p>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.</p>", array("%admin-news" => l(t("administer news feeds"), "admin/syndication/news")));
$output .= strtr("<p>Once there, select %new-feed from the left hand menu. Drupal will then ask for the following:</p>", array("%new-feed" => l(t("add new feed"), "admin/syndication/news/add/feed") ));
$output .= strtr("<p>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.</p>", array("%admin-news" => l(t("administer news feeds"), "admin/node/syndication/news")));
$output .= strtr("<p>Once there, select %new-feed from the left hand menu. Drupal will then ask for the following:</p>", array("%new-feed" => l(t("add new feed"), "admin/node/syndication/news/add/feed") ));
$output .= "<ul>";
$output .= "<li><b>Title</b> -- The text entered here will be used in your news aggregator, within the administration configuration section, and as title for the news feed block. As a general rule, use the web site name from which the feed originates.</li>";
$output .= " <li><b>URL</b> -- Here you'll enter the fully-qualified URL for the feed for the site you want to subscribe to.</li>";
$output .= "<li><b>Attributes</b> -- Attributes are keywords which can be used to collect feeds into <i>bundles</i> (see below). Think of these as the means of classifying your feeds. Separate multiple attributes with commas. If you do not plan on using the specific feed in a bundle, this input field can be left blank.</li>";
$output .= strtr("<li><b>Update interval</b> -- The update interval is how often Drupal will automatically access the RSS URL for the site for fresh content. The 1 hour default is typically the minimum you will want to use. Accessing another site's RSS page more frequently can be considered impolite. After all, it does require the other site's server handle your requests. To use this feature cron.php must be called regularly, otherwise, you'll have to manually update feeds one at a time within the news aggregation administration section by using %update-items.</li>", array("%update-items" => l(t("update items"), "admin/syndication/news") ));
$output .= strtr("<li><b>Update interval</b> -- The update interval is how often Drupal will automatically access the RSS URL for the site for fresh content. The 1 hour default is typically the minimum you will want to use. Accessing another site's RSS page more frequently can be considered impolite. After all, it does require the other site's server handle your requests. To use this feature cron.php must be called regularly, otherwise, you'll have to manually update feeds one at a time within the news aggregation administration section by using %update-items.</li>", array("%update-items" => l(t("update items"), "admin/node/syndication/news") ));
$output .= "</ul>";
$output .= strtr("<p>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.</p>", array("%update-items" => l(t("update items"), "admin/syndication/news"), "%main-aggregation" => l(t("main news aggregation"), "admin/syndication/news") ));
$output .= strtr("<p>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.</p>", array("%update-items" => l(t("update items"), "admin/node/syndication/news"), "%main-aggregation" => l(t("main news aggregation"), "admin/node/syndication/news") ));
$output .= "<h3>Adding bundles</h3>";
$output .= "<p>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.</p>";
$output .= "<p>When adding a bundle, Drupal will ask for:</p>";
......@@ -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 <b>must</b> run \"cron.php\". To display the feed in a block you must turn on the %block. <br /><ul><li>To delete a feed choose \"edit feed\"</li><li>To clear all of the entries from a feed choose \"Remove items\"</li><li>To check whether a feed is working, and to get new items <b>now</b> click on \"update items\"</li></ul><ul><li>To delete a bundle choose \"edit bundle\".</li></ul>", 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.<br />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.<br />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 <i>Sport</i>. 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 <i>Sport</i>. 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"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->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"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->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 "<div style=\"text-align: center;\">". theme("links", $links) ."</div>";
......
......@@ -1167,7 +1167,7 @@ function comment_admin() {
$op = arg(2);
}
if ($op == t("moderation")) {
if ($op == "moderation") {
$op = arg(3);
}
......
......@@ -1167,7 +1167,7 @@ function comment_admin() {
$op = arg(2);
}
if ($op == t("moderation")) {
if ($op == "moderation") {
$op = arg(3);
}
......
......@@ -18,15 +18,15 @@ function import_help($section = "admin/import/help") {
$output .= strtr("<p>To learn much more about RSS, read Mark Pilgrim's %rss-what and WebReference.com's %rss-evolution.</p>", array("%rss-what" => "<a href=\"http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html\">". t("What is RSS") ."</a>", "%rss-evolution" => "<a href=\"http://www.webreference.com/authoring/languages/xml/rss/1/\">". t("The Evolution of RSS") ."</a>"));
$output .= "<p>NOTE: Enable your site's xml syndication button by turning on the Syndicate block in block management.</p>";
$output .= "<h3>Configuring news feeds</h3>";
$output .= strtr("<p>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.</p>", array("%admin-news" => l(t("administer news feeds"), "admin/syndication/news")));
$output .= strtr("<p>Once there, select %new-feed from the left hand menu. Drupal will then ask for the following:</p>", array("%new-feed" => l(t("add new feed"), "admin/syndication/news/add/feed") ));
$output .= strtr("<p>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.</p>", array("%admin-news" => l(t("administer news feeds"), "admin/node/syndication/news")));
$output .= strtr("<p>Once there, select %new-feed from the left hand menu. Drupal will then ask for the following:</p>", array("%new-feed" => l(t("add new feed"), "admin/node/syndication/news/add/feed") ));
$output .= "<ul>";
$output .= "<li><b>Title</b> -- The text entered here will be used in your news aggregator, within the administration configuration section, and as title for the news feed block. As a general rule, use the web site name from which the feed originates.</li>";
$output .= " <li><b>URL</b> -- Here you'll enter the fully-qualified URL for the feed for the site you want to subscribe to.</li>";
$output .= "<li><b>Attributes</b> -- Attributes are keywords which can be used to collect feeds into <i>bundles</i> (see below). Think of these as the means of classifying your feeds. Separate multiple attributes with commas. If you do not plan on using the specific feed in a bundle, this input field can be left blank.</li>";
$output .= strtr("<li><b>Update interval</b> -- The update interval is how often Drupal will automatically access the RSS URL for the site for fresh content. The 1 hour default is typically the minimum you will want to use. Accessing another site's RSS page more frequently can be considered impolite. After all, it does require the other site's server handle your requests. To use this feature cron.php must be called regularly, otherwise, you'll have to manually update feeds one at a time within the news aggregation administration section by using %update-items.</li>", array("%update-items" => l(t("update items"), "admin/syndication/news") ));
$output .= strtr("<li><b>Update interval</b> -- The update interval is how often Drupal will automatically access the RSS URL for the site for fresh content. The 1 hour default is typically the minimum you will want to use. Accessing another site's RSS page more frequently can be considered impolite. After all, it does require the other site's server handle your requests. To use this feature cron.php must be called regularly, otherwise, you'll have to manually update feeds one at a time within the news aggregation administration section by using %update-items.</li>", array("%update-items" => l(t("update items"), "admin/node/syndication/news") ));
$output .= "</ul>";
$output .= strtr("<p>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.</p>", array("%update-items" => l(t("update items"), "admin/syndication/news"), "%main-aggregation" => l(t("main news aggregation"), "admin/syndication/news") ));
$output .= strtr("<p>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.</p>", array("%update-items" => l(t("update items"), "admin/node/syndication/news"), "%main-aggregation" => l(t("main news aggregation"), "admin/node/syndication/news") ));
$output .= "<h3>Adding bundles</h3>";
$output .= "<p>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.</p>";
$output .= "<p>When adding a bundle, Drupal will ask for:</p>";
......@@ -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 <b>must</b> run \"cron.php\". To display the feed in a block you must turn on the %block. <br /><ul><li>To delete a feed choose \"edit feed\"</li><li>To clear all of the entries from a feed choose \"Remove items\"</li><li>To check whether a feed is working, and to get new items <b>now</b> click on \"update items\"</li></ul><ul><li>To delete a bundle choose \"edit bundle\".</li></ul>", 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.<br />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.<br />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 <i>Sport</i>. 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 <i>Sport</i>. 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"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->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"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->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 "<div style=\"text-align: center;\">". theme("links", $links) ."</div>";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment