summaryrefslogtreecommitdiff
path: root/modules/aggregator
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-02-20 22:44:51 +0000
committerDries Buytaert <dries@buytaert.net>2003-02-20 22:44:51 +0000
commit277ceae5150ccf3082ca99e73a82da58814ebaf5 (patch)
tree6f2cbb14ff94893dcbb6603ce47785e41f62c869 /modules/aggregator
parent53deeb188a5b3d8158b9fa4f05c1b99c773820f1 (diff)
downloadbrdo-277ceae5150ccf3082ca99e73a82da58814ebaf5.tar.gz
brdo-277ceae5150ccf3082ca99e73a82da58814ebaf5.tar.bz2
- New menu houskeeping. Prototyped by Zbynek.
The following modules need updating: * glossary module * feed module (Breyten's version) * mailhandler module * notify module * project module * smileys module * admin module * style module * taxonomy_dhtml module To avoid unexpected problems menu_add() is deprecated (it will print an error message when used) and menu() should be used instead.
Diffstat (limited to 'modules/aggregator')
-rw-r--r--modules/aggregator/aggregator.module50
1 files changed, 24 insertions, 26 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 038ec1b26..75873ce40 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -3,7 +3,7 @@
function import_help() {
?>
- <p>In Drupal you have <i>feeds</i> and <i>bundles</i>. Feeds define news sources and bundles categoriz syndicated content by source, topic or any other heuristic. 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".</p>
+ <p>In Drupal you have <i>feeds</i> and <i>bundles</i>. Feeds define news sources and bundles categorize syndicated content by source, topic or any other heuristic. 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".</p>
<p>You can have several providers of news feeds. You can add a feed by clicking the "add feed" link on the import administration pages. Give the feed a name, supply the URI and a comma-separated list of attributes that you want to associate the feed with. The update interval defines how often Drupal should go out to try and grab fresh content. The expiration time defines how long syndicated content is kept in the database. So set the update and expiration time and save your settings. You have just defined your first feed. If you have more feeds repeat as necessary.</p>
<p>To verify whether your feed works, press "update items" at the overview page. The number of news items that have been sucessfully fetched, should then become visible in the third column of the feed overview.</p>
<p>Now you have to define some bundles. Bundles look for feeds that contain one of the keywords associated with the bundle and display those feeds together. To define a bundle you have to give it a name and a comma-separated list of keywords just like this is the case for feeds.</p>
@@ -35,11 +35,14 @@ function import_link($type) {
}
if ($type == "admin" && user_access("administer news feeds")) {
- menu_add("news aggregation", url("admin/import"), "Content syndication through RDF/RSS feeds.", NULL, NULL, 3);
- menu_add("add new feed", url("admin/import/add/feed"), "Add new news feed.", NULL, "news aggregation", 2);
- menu_add("add new bundle", url("admin/import/add/bundle"), "Create a new bundle.", NULL, "news aggregation", 3);
- menu_add("tag news items", url("admin/import/tag"), "Assign bundle attributes to a news item.", NULL, "news aggregation", 4);
- menu_add("help", url("admin/import/help"), "More information about news aggregation.", NULL, "news aggregation", 5);
+ $help["general"] = "Several websites, especially news related sites, syndicate parts of their site 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).";
+ $help["bundles"] = "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>.";
+ 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", NULL, 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", NULL, 4);
+ menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
}
return $links ? $links : array();
@@ -405,7 +408,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/import/edit/feed/$feed->fid"), l(t("remove items"), "admin/import/remove/$feed->fid"), l(t("update items"), "admin/import/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/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"));
}
$output .= table($header, $rows);
@@ -416,7 +419,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/import/edit/bundle/$bundle->bid"));
+ $rows[] = array($bundle->title, $bundle->attributes, l(t("edit bundle"), "admin/syndication/news/edit/bundle/$bundle->bid"));
}
$output .= table($header, $rows);
@@ -429,7 +432,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/import/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/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);
@@ -444,35 +447,30 @@ function import_admin() {
if (user_access("administer news feeds")) {
if (empty($op)) {
- $op = arg(2);
+ $op = arg(3);
}
switch ($op) {
- case "help":
- print import_help();
+ case "add feed":
+ print import_form_bundle();
break;
- case "add":
- if (arg(3) == "bundle") {
- print import_form_bundle();
- }
- else {
- print import_form_feed();
- }
+ case "add bundle":
+ print import_form_feed();
break;
case "edit":
- if (arg(3) == "bundle") {
- print import_form_bundle(import_get_bundle(arg(4)));
+ if (arg(4) == "bundle") {
+ print import_form_bundle(import_get_bundle(arg(5)));
}
else {
- print import_form_feed(import_get_feed(arg(4)));
+ print import_form_feed(import_get_feed(arg(5)));
}
break;
case "remove":
- print status(import_remove(import_get_feed(arg(3))));
+ print status(import_remove(import_get_feed(arg(4))));
print import_view();
break;
case "update":
- print status(import_refresh(import_get_feed(arg(3))));
+ print status(import_refresh(import_get_feed(arg(4))));
print import_view();
break;
case "tag":
@@ -486,7 +484,7 @@ function import_admin() {
$edit["title"] = 0;
// fall through:
case "Submit":
- if (arg(3) == "bundle") {
+ if (arg(3) == "add bundle") {
print status(import_save_bundle($edit));
}
else {
@@ -511,7 +509,7 @@ function import_page_info() {
$links[] = l(t("news sources"), "import/sources", array("title" => t("View a list of all the websites we syndicate from.")));
if (user_access("administer news feeds")) {
- $links[] = l(t("administer news feeds"), "admin/import", array("title" => t("View the news feed administrative pages.")));
+ $links[] = l(t("administer news feeds"), "admin/syndication/news", array("title" => t("View the news feed administrative pages.")));
}
return "<div align=\"center\">". theme("links", $links) ."</div>";