Commit 22c889e7 authored by Dries's avatar Dries

- Help system improvements: eliminated the _system hook.  Patch by Michael.

- Bloggerapi module fixes.  Patch by Kjartan.

- Coding style fixes.  Patch by Michael.
parent fbc674f1
......@@ -13,7 +13,7 @@ function admin_help($section) {
$output = "";
switch ($section) {
case "admin/system/modules":
case "admin/system/modules#description":
$output .= t("Handles the administration pages.");
break;
case "admin":
......@@ -26,15 +26,6 @@ function admin_help($section) {
return $output;
}
function admin_system($field){
$output = "";
if ($field == "description") {
$output = admin_help("admin/system/modules");
}
return $output;
}
function admin_link($type) {
if ($type == "system" && user_access("access administration pages")) {
menu("admin", t("administer"), NULL, NULL, 9);
......
......@@ -51,32 +51,22 @@ function import_help($section = "admin/import/help") {
$output .= "</ul>";
$output .= "<h3>RSS feed blocks</h3>";
$output .= "<p>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.</p>";
$output = t($output, array(
"%amphetadesk" => "<a href=\"http://www.disobey.com/amphetadesk/\">AmphetaDesk</a>",
"%rss" => "<a href=\"http://groups.yahoo.com/group/rss-dev/files/specification.html\">Rich Site Summary</a>",
"%slashdot-rss" => "<a href=\"http://slashdot.org/slashdot.rdf\">http://slashdot.org/slashdot.rfd</a>",
"%syndic8" => "<a href=\"http://www.syndic8.com/\">Syndic8</a>",
"%rss-what" => "<a href=\"http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html\">What is RSS</a>",
"%rss-evolution" => "<a href=\"http://www.webreference.com/authoring/languages/xml/rss/1/\">The Evolution of RSS</a>",
"%admin-news" => l(t("RSS/RDF"), "admin/node/syndication/news"),
"%new-feed" => l(t("new feed"), "admin/node/syndication/news/add/feed"),
"%update-items" => l(t("update items"), "admin/node/syndication/news"),
));
$output = t($output, array("%amphetadesk" => "<a href=\"http://www.disobey.com/amphetadesk/\">AmphetaDesk</a>", "%rss" => "<a href=\"http://groups.yahoo.com/group/rss-dev/files/specification.html\">Rich Site Summary</a>", "%slashdot-rss" => "<a href=\"http://slashdot.org/slashdot.rdf\">http://slashdot.org/slashdot.rfd</a>", "%syndic8" => "<a href=\"http://www.syndic8.com/\">Syndic8</a>", "%rss-what" => "<a href=\"http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html\">What is RSS</a>", "%rss-evolution" => "<a href=\"http://www.webreference.com/authoring/languages/xml/rss/1/\">The Evolution of RSS</a>", "%admin-news" => l(t("RSS/RDF"), "admin/node/syndication/news"), "%new-feed" => l(t("new feed"), "admin/node/syndication/news/add/feed"), "%update-items" => l(t("update items"), "admin/node/syndication/news")));
break;
case 'admin/system/modules':
case 'admin/system/modules#description':
$output = t("Used to aggregate syndicated content (RSS and RDF).");
break;
case 'admin/system/modules/import':
$output = 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.");
break;
case 'admin/node/syndication/news':
$output = 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 <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/system/block") ));
$output = 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 <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/system/block")));
break;
case 'admin/node/syndication/news/add/feed':
$output = t("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") ));
$output = t("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 = 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 <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") ));
$output = 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 <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 = t("This allows you to see and change an news item's \"tag\". All articles are originally tagged with the \"Attributes\" of their feed.");
......@@ -86,15 +76,6 @@ function import_help($section = "admin/import/help") {
return $output;
}
function import_system($field){
$output = "";
$system["description"] = import_help("admin/system/modules");
$system["admin_help"] = import_help("admin/system/modules/import");
return $system[$field];
}
function import_settings() {
$number = array(5 => 5, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 45 => 45, 50 => 50, 55 => 55, 60 => 60, 65 => 65, 70 => 70, 75 => 75, 80 => 80, 85 => 85, 90 => 90, 95 => 95, 100 => 100);
$output .= form_select(t("Items per block"), "import_block_limit", variable_get("import_block_limit", 15), $number, t("The maximum number of news items displayed in one block."));
......@@ -119,7 +100,7 @@ function import_link($type) {
if (user_access("administer news feeds")) {
menu("admin/node/syndication", t("syndication"), NULL, NULL, 5);
menu("admin/node/syndication/news", t("RSS/RDF"), "import_admin", import_help("admin/node/syndication/news") );
menu("admin/node/syndication/news", t("RSS/RDF"), "import_admin", import_help("admin/node/syndication/news"));
menu("admin/node/syndication/news/add/feed", t("new feed"), "import_admin", import_help("admin/node/syndication/news/add/feed"), 2);
menu("admin/node/syndication/news/add/bundle", t("new bundle"), "import_admin", import_help("admin/node/syndication/news/add/bundle"), 3);
menu("admin/node/syndication/news/tag", t("tag items"), "import_admin", import_help("admin/node/syndication/news/tag"), 4);
......@@ -535,7 +516,7 @@ function import_get_bundle($bid) {
function import_view() {
$result = db_query("SELECT f.*, COUNT(i.iid) AS items FROM {feed} f LEFT JOIN {item} i ON f.fid = i.fid GROUP BY f.fid, f.title, f.url, f.refresh, f.timestamp, f.attributes, f.link, f.description ORDER BY f.title");
$output .= "<h3>". t("Feed overview"). "</h3>";
$output .= "<h3>". t("Feed overview") ."</h3>";
$header = array(t("title"), t("attributes"), t("items"), t("last update"), t("next update"), array("data" => t("operations"), "colspan" => 3));
unset($rows);
......@@ -546,7 +527,7 @@ function import_view() {
$result = db_query("SELECT * FROM {bundle} ORDER BY title");
$output .= "<h3>". t("Bundle overview"). "</h3>";
$output .= "<h3>". t("Bundle overview") ."</h3>";
$header = array(t("title"), t("attributes"), t("operations"));
unset($rows);
......@@ -568,7 +549,7 @@ function import_tag() {
}
$output .= table($header, $rows);
$output .= "<input type=\"submit\" name=\"op\" value=\"" . t("Save attributes") . "\" />\n";
$output .= "<input type=\"submit\" name=\"op\" value=\"". t("Save attributes") ."\" />\n";
return form($output);
}
......@@ -768,7 +749,7 @@ function import_page_sources() {
$output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />";
}
$output .= "<div style=\"text-align: right\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) . "</div><br />";
$output .= "<div style=\"text-align: right\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />";
theme("header");
theme("box", t("News feeds"), import_page_info());
......
......@@ -51,32 +51,22 @@ function import_help($section = "admin/import/help") {
$output .= "</ul>";
$output .= "<h3>RSS feed blocks</h3>";
$output .= "<p>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.</p>";
$output = t($output, array(
"%amphetadesk" => "<a href=\"http://www.disobey.com/amphetadesk/\">AmphetaDesk</a>",
"%rss" => "<a href=\"http://groups.yahoo.com/group/rss-dev/files/specification.html\">Rich Site Summary</a>",
"%slashdot-rss" => "<a href=\"http://slashdot.org/slashdot.rdf\">http://slashdot.org/slashdot.rfd</a>",
"%syndic8" => "<a href=\"http://www.syndic8.com/\">Syndic8</a>",
"%rss-what" => "<a href=\"http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html\">What is RSS</a>",
"%rss-evolution" => "<a href=\"http://www.webreference.com/authoring/languages/xml/rss/1/\">The Evolution of RSS</a>",
"%admin-news" => l(t("RSS/RDF"), "admin/node/syndication/news"),
"%new-feed" => l(t("new feed"), "admin/node/syndication/news/add/feed"),
"%update-items" => l(t("update items"), "admin/node/syndication/news"),
));
$output = t($output, array("%amphetadesk" => "<a href=\"http://www.disobey.com/amphetadesk/\">AmphetaDesk</a>", "%rss" => "<a href=\"http://groups.yahoo.com/group/rss-dev/files/specification.html\">Rich Site Summary</a>", "%slashdot-rss" => "<a href=\"http://slashdot.org/slashdot.rdf\">http://slashdot.org/slashdot.rfd</a>", "%syndic8" => "<a href=\"http://www.syndic8.com/\">Syndic8</a>", "%rss-what" => "<a href=\"http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html\">What is RSS</a>", "%rss-evolution" => "<a href=\"http://www.webreference.com/authoring/languages/xml/rss/1/\">The Evolution of RSS</a>", "%admin-news" => l(t("RSS/RDF"), "admin/node/syndication/news"), "%new-feed" => l(t("new feed"), "admin/node/syndication/news/add/feed"), "%update-items" => l(t("update items"), "admin/node/syndication/news")));
break;
case 'admin/system/modules':
case 'admin/system/modules#description':
$output = t("Used to aggregate syndicated content (RSS and RDF).");
break;
case 'admin/system/modules/import':
$output = 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.");
break;
case 'admin/node/syndication/news':
$output = 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 <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/system/block") ));
$output = 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 <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/system/block")));
break;
case 'admin/node/syndication/news/add/feed':
$output = t("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") ));
$output = t("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 = 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 <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") ));
$output = 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 <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 = t("This allows you to see and change an news item's \"tag\". All articles are originally tagged with the \"Attributes\" of their feed.");
......@@ -86,15 +76,6 @@ function import_help($section = "admin/import/help") {
return $output;
}
function import_system($field){
$output = "";
$system["description"] = import_help("admin/system/modules");
$system["admin_help"] = import_help("admin/system/modules/import");
return $system[$field];
}
function import_settings() {
$number = array(5 => 5, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 45 => 45, 50 => 50, 55 => 55, 60 => 60, 65 => 65, 70 => 70, 75 => 75, 80 => 80, 85 => 85, 90 => 90, 95 => 95, 100 => 100);
$output .= form_select(t("Items per block"), "import_block_limit", variable_get("import_block_limit", 15), $number, t("The maximum number of news items displayed in one block."));
......@@ -119,7 +100,7 @@ function import_link($type) {
if (user_access("administer news feeds")) {
menu("admin/node/syndication", t("syndication"), NULL, NULL, 5);
menu("admin/node/syndication/news", t("RSS/RDF"), "import_admin", import_help("admin/node/syndication/news") );
menu("admin/node/syndication/news", t("RSS/RDF"), "import_admin", import_help("admin/node/syndication/news"));
menu("admin/node/syndication/news/add/feed", t("new feed"), "import_admin", import_help("admin/node/syndication/news/add/feed"), 2);
menu("admin/node/syndication/news/add/bundle", t("new bundle"), "import_admin", import_help("admin/node/syndication/news/add/bundle"), 3);
menu("admin/node/syndication/news/tag", t("tag items"), "import_admin", import_help("admin/node/syndication/news/tag"), 4);
......@@ -535,7 +516,7 @@ function import_get_bundle($bid) {
function import_view() {
$result = db_query("SELECT f.*, COUNT(i.iid) AS items FROM {feed} f LEFT JOIN {item} i ON f.fid = i.fid GROUP BY f.fid, f.title, f.url, f.refresh, f.timestamp, f.attributes, f.link, f.description ORDER BY f.title");
$output .= "<h3>". t("Feed overview"). "</h3>";
$output .= "<h3>". t("Feed overview") ."</h3>";
$header = array(t("title"), t("attributes"), t("items"), t("last update"), t("next update"), array("data" => t("operations"), "colspan" => 3));
unset($rows);
......@@ -546,7 +527,7 @@ function import_view() {
$result = db_query("SELECT * FROM {bundle} ORDER BY title");
$output .= "<h3>". t("Bundle overview"). "</h3>";
$output .= "<h3>". t("Bundle overview") ."</h3>";
$header = array(t("title"), t("attributes"), t("operations"));
unset($rows);
......@@ -568,7 +549,7 @@ function import_tag() {
}
$output .= table($header, $rows);
$output .= "<input type=\"submit\" name=\"op\" value=\"" . t("Save attributes") . "\" />\n";
$output .= "<input type=\"submit\" name=\"op\" value=\"". t("Save attributes") ."\" />\n";
return form($output);
}
......@@ -768,7 +749,7 @@ function import_page_sources() {
$output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />";
}
$output .= "<div style=\"text-align: right\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) . "</div><br />";
$output .= "<div style=\"text-align: right\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />";
theme("header");
theme("box", t("News feeds"), import_page_info());
......
......@@ -5,7 +5,7 @@ function archive_help($section) {
$output = "";
switch ($section) {
case 'admin/system/modules':
case 'admin/system/modules#description':
$output = t("Displays a calendar to navigate old content.");
break;
case 'admin/system/modules/archive':
......@@ -15,14 +15,6 @@ function archive_help($section) {
return $output;
}
function archive_system($field){
$output = "";
if ($field == "description") { $output = archive_help("admin/system/modules"); }
else if ($field == "admin_help") { $output = archive_help("admin/system/modules/archive"); };
return $output;
}
function archive_calendar($original = 0) {
global $user;
......@@ -64,7 +56,7 @@ function archive_calendar($original = 0) {
// Extract last day of the month:
$last = date("t", $start_of_month);
$end_of_month = mktime(23,59,59, $month, $last, $year);
$end_of_month = mktime(23, 59, 59, $month, $last, $year);
$cache = cache_get("archive:calendar:$start_of_month");
......@@ -97,7 +89,7 @@ function archive_calendar($original = 0) {
$weekstart = variable_get("default_firstday", 0);
// Last day of week
($weekstart - 1 == -1 ) ? $lastday = 6 : $lastday = $weekstart - 1;
($weekstart - 1 == -1) ? $lastday = 6 : $lastday = $weekstart - 1;
// Generate the days of the week:
$firstcolumn = mktime(0, 0, 0, 3, 20 + $weekstart, 1994);
......
......@@ -5,7 +5,7 @@ function archive_help($section) {
$output = "";
switch ($section) {
case 'admin/system/modules':
case 'admin/system/modules#description':
$output = t("Displays a calendar to navigate old content.");
break;
case 'admin/system/modules/archive':
......@@ -15,14 +15,6 @@ function archive_help($section) {
return $output;
}
function archive_system($field){
$output = "";
if ($field == "description") { $output = archive_help("admin/system/modules"); }
else if ($field == "admin_help") { $output = archive_help("admin/system/modules/archive"); };
return $output;
}
function archive_calendar($original = 0) {
global $user;
......@@ -64,7 +56,7 @@ function archive_calendar($original = 0) {
// Extract last day of the month:
$last = date("t", $start_of_month);
$end_of_month = mktime(23,59,59, $month, $last, $year);
$end_of_month = mktime(23, 59, 59, $month, $last, $year);
$cache = cache_get("archive:calendar:$start_of_month");
......@@ -97,7 +89,7 @@ function archive_calendar($original = 0) {
$weekstart = variable_get("default_firstday", 0);
// Last day of week
($weekstart - 1 == -1 ) ? $lastday = 6 : $lastday = $weekstart - 1;
($weekstart - 1 == -1) ? $lastday = 6 : $lastday = $weekstart - 1;
// Generate the days of the week:
$firstcolumn = mktime(0, 0, 0, 3, 20 + $weekstart, 1994);
......
......@@ -36,7 +36,7 @@ function block_help($section = "admin/block/help") {
$output .= "<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>";
$output = t($output, array("%pcre" => "<a href=\"http://php.net/pcre/\">". t("Perl-Compatible Regular Expressions (PCRE)") ."</a>"));
break;
case 'admin/system/modules':
case 'admin/system/modules#description':
$output = t("Controls the boxes that are displayed around the main content.");
break;
case 'admin/system/block':
......@@ -53,14 +53,6 @@ function block_help($section = "admin/block/help") {
return $output;
}
function block_system($field){
$output = "";
if ($field == "description") { $output = block_help("admin/system/modules"); }
return $output;
}
function block_perm() {
return array("administer blocks");
}
......@@ -337,7 +329,7 @@ function block_user($type, &$edit, &$user) {
while ($block = db_fetch_object($result)) {
$data = module_invoke($block->module, "block", "list");
if ($data[$block->delta]["info"]) {
$form .= "<tr><td>".$data[$block->delta]["info"]."</td><td>". form_checkbox(NULL, "block][$block->module][$block->delta", 1, $user->block[$block->module][$block->delta]) ."</td></tr>\n";
$form .= "<tr><td>". $data[$block->delta]["info"] ."</td><td>". form_checkbox(NULL, "block][$block->module][$block->delta", 1, $user->block[$block->module][$block->delta]) ."</td></tr>\n";
}
}
......
......@@ -36,7 +36,7 @@ function block_help($section = "admin/block/help") {
$output .= "<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>";
$output = t($output, array("%pcre" => "<a href=\"http://php.net/pcre/\">". t("Perl-Compatible Regular Expressions (PCRE)") ."</a>"));
break;
case 'admin/system/modules':
case 'admin/system/modules#description':
$output = t("Controls the boxes that are displayed around the main content.");
break;
case 'admin/system/block':
......@@ -53,14 +53,6 @@ function block_help($section = "admin/block/help") {
return $output;
}
function block_system($field){
$output = "";
if ($field == "description") { $output = block_help("admin/system/modules"); }
return $output;
}
function block_perm() {
return array("administer blocks");
}
......@@ -337,7 +329,7 @@ function block_user($type, &$edit, &$user) {
while ($block = db_fetch_object($result)) {
$data = module_invoke($block->module, "block", "list");
if ($data[$block->delta]["info"]) {
$form .= "<tr><td>".$data[$block->delta]["info"]."</td><td>". form_checkbox(NULL, "block][$block->module][$block->delta", 1, $user->block[$block->module][$block->delta]) ."</td></tr>\n";
$form .= "<tr><td>". $data[$block->delta]["info"] ."</td><td>". form_checkbox(NULL, "block][$block->module][$block->delta", 1, $user->block[$block->module][$block->delta]) ."</td></tr>\n";
}
}
......
<?php
// $Id$
function blog_system($field){
$output = "";
if ($field == "description") { $output = blog_help("admin/system/modules"); }
else if ($field == "admin_help") { $output = blog_help("admin/system/modules/blog"); };
return $output;
}
function blog_settings() {
$output = form_textarea(t("Explanation or submission guidelines"), "blog_help", variable_get("blog_help", ""), 70, 4, t("This text is displayed at the top of the blog submission form. It's useful for helping or instructing your users."));
$words = t("words");
......@@ -84,9 +75,9 @@ function blog_help($section) {
$output .= "<p>Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.</p>";
$output .= "<p>The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.</p>";
$output .= "<p>If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link <b>(b)</b> next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.</p>";
$output = t($output,array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>" ));
$output = t($output, array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>" ));
break;
case 'admin/system/modules':
case 'admin/system/modules#description':
$output .= t("Enables keeping a blog or easily and regularly updated web page.");
break;
case 'admin/system/modules/blog':
......@@ -108,7 +99,7 @@ function blog_feed_user($uid = 0) {
}
$result = db_query_range("SELECT n.nid, n.title, n.teaser, n.created, u.name, u.uid FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.type = 'blog' AND u.uid = %d AND n.status = 1 ORDER BY n.nid DESC", $uid, 0, 15);
$channel["title"] = $account->name. "'s blog";
$channel["title"] = $account->name ."'s blog";
$channel["link"] = url("blog/view/$uid");
$channel["description"] = $term->description;
node_feed($result, $channel);
......@@ -136,7 +127,7 @@ function blog_page_user($uid) {
node_view(node_load(array("nid" => $node->nid)), 1);
}
print pager_display(NULL, variable_get("default_nodes_main", 10));
print "<div style=\"text-align: right\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array ("%username" => $account->name)))) . "</div>";
print "<div style=\"text-align: right\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array("%username" => $account->name)))) . "</div>";
}
function blog_page_last() {
......@@ -247,7 +238,7 @@ function blog_view($node, $main = 0) {
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = l(t("%name's blog", array("%name" => $node->name)), "blog/$node->uid");
// print the breadcrumb
theme("breadcrumb",$breadcrumb);
theme("breadcrumb", $breadcrumb);
}
// prepair the node content
$node = blog_content($node);
......@@ -265,7 +256,7 @@ function blog_link($type, $node = 0, $main) {
menu("node/add/blog", t("blog entry"), "blog_page", NULL, 0);
}
if (user_access("maintain personal blog")) {
menu("blog/" . $user->uid,t("my blog"), "user_page", NULL, 1);
menu("blog/" . $user->uid, t("my blog"), "user_page", NULL, 1);
}
}
......
<?php
// $Id$
function blog_system($field){
$output = "";
if ($field == "description") { $output = blog_help("admin/system/modules"); }
else if ($field == "admin_help") { $output = blog_help("admin/system/modules/blog"); };
return $output;
}
function blog_settings() {
$output = form_textarea(t("Explanation or submission guidelines"), "blog_help", variable_get("blog_help", ""), 70, 4, t("This text is displayed at the top of the blog submission form. It's useful for helping or instructing your users."));
$words = t("words");
......@@ -84,9 +75,9 @@ function blog_help($section) {
$output .= "<p>Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.</p>";
$output .= "<p>The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.</p>";
$output .= "<p>If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link <b>(b)</b> next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.</p>";
$output = t($output,array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>" ));
$output = t($output, array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>" ));
break;
case 'admin/system/modules':
case 'admin/system/modules#description':
$output .= t("Enables keeping a blog or easily and regularly updated web page.");
break;
case 'admin/system/modules/blog':
......@@ -108,7 +99,7 @@ function blog_feed_user($uid = 0) {
}
$result = db_query_range("SELECT n.nid, n.title, n.teaser, n.created, u.name, u.uid FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.type = 'blog' AND u.uid = %d AND n.status = 1 ORDER BY n.nid DESC", $uid, 0, 15);
$channel["title"] = $account->name. "'s blog";
$channel["title"] = $account->name ."'s blog";
$channel["link"] = url("blog/view/$uid");
$channel["description"] = $term->description;
node_feed($result, $channel);
......@@ -136,7 +127,7 @@ function blog_page_user($uid) {
node_view(node_load(array("nid" => $node->nid)), 1);
}
print pager_display(NULL, variable_get("default_nodes_main", 10));
print "<div style=\"text-align: right\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array ("%username" => $account->name)))) . "</div>";
print "<div style=\"text-align: right\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array("%username" => $account->name)))) . "</div>";
}
function blog_page_last() {
......@@ -247,7 +238,7 @@ function blog_view($node, $main = 0) {
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = l(t("%name's blog", array("%name" => $node->name)), "blog/$node->uid");
// print the breadcrumb
theme("breadcrumb",$breadcrumb);
theme("breadcrumb", $breadcrumb);
}
// prepair the node content
$node = blog_content($node);
......@@ -265,7 +256,7 @@ function blog_link($type, $node = 0, $main) {
menu("node/add/blog", t("blog entry"), "blog_page", NULL, 0);
}
if (user_access("maintain personal blog")) {
menu("blog/" . $user->uid,t("my blog"), "user_page", NULL, 1);
menu("blog/" . $user->uid, t("my blog"), "user_page", NULL, 1);
}
}
......
......@@ -154,7 +154,7 @@ function bloggerapi_driver($method, $params = 0, $error = 0) {
case "editPost":
$node = node_load(array("nid" => $cparams[1]));
if ($node->uid == $user->uid) {
return array("nid" => $cparams[1], "type" => "blog", "name" => $user->name, "title" => $title, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0);
return array("nid" => $cparams[1], "uid" => $user->uid, "type" => "blog", "name" => $user->name, "title" => $title, "body" => $cparams[4], "status" => 1, "moderate" => 0, "comment" => 2, "promote" => 0, "revision" => 0);
}
else {
return bloggerapi_error("Error updating node");
......@@ -190,7 +190,7 @@ function bloggerapi_user_blogs() {
global $user;
if ($user->uid) {
$struct = new xmlrpcval(array("url" => new xmlrpcval(url("blog/$user->uid")), "blogid" => new xmlrpcval($user->uid), "blogName" => new xmlrpcval($user->name . "'s blog at ". variable_get("site_name", "drupal"))),"struct");
$struct = new xmlrpcval(array("url" => new xmlrpcval(url("blog/$user->uid")), "blogid" => new xmlrpcval($user->uid), "blogName" => new xmlrpcval($user->name . "'s blog at ". variable_get("site_name", "drupal"))), "struct");
return new xmlrpcval(array($struct), "array");
}
else {
......@@ -218,13 +218,13 @@ function bloggerapi_user_info() {
function bloggerapi_node_load($nid) {
global $user;
$blog = node_load(array("nid" => $nid));
$blog = node_load(array("nid" => $nid, "type" => "blog"));
if ($blog->uid == $user->uid) {
$body = "<title>$blog->title</title>\n". $blog->body;
return new xmlrpcval(array("userid" => new xmlrpcval($user->name, "string"),
"dateCreated" => new xmlrpcval(iso8601_encode($blog->timestamp),"dateTime.iso8601"),
"content" => new xmlrpcval($body,"string"),
"postid" => new xmlrpcval($blog->nid,"string")
"dateCreated" => new xmlrpcval(iso8601_encode($blog->timestamp), "dateTime.iso8601"),
"content" => new xmlrpcval($body, "string"),
"postid" => new xmlrpcval($blog->nid, "string")
), "struct");
}
else {
......@@ -236,14 +236,14 @@ function bloggerapi_node_recent($num) {
global $user;
if (($num == 0) or ($num > 100)) $num = 50;
$result = db_query_range("SELECT n.*, u.name FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.uid = %d ORDER BY n.nid DESC", $user->uid, 0, $num);
$result = db_query_range("SELECT n.*, u.name FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.type = 'blog' AND n.uid = %d ORDER BY n.nid DESC", $user->uid, 0, $num);
if ($result) {
while ($blog = db_fetch_object($result)) {
$body = "<title>$blog->title</title>\n". $blog->body;
$blogs[] = new xmlrpcval(array("userid" => new xmlrpcval($blog->name,"string"),
"dateCreated" => new xmlrpcval(iso8601_encode($blog->created),"dateTime.iso8601"),
"content" => new xmlrpcval($body,"string"),
"postid" => new xmlrpcval($blog->nid,"string")
$blogs[] = new xmlrpcval(array("userid" => new xmlrpcval($blog->name, "string"),
"dateCreated" => new xmlrpcval(iso8601_encode($blog->created), "dateTime.iso8601"),
"content" => new xmlrpcval($body, "string"),
"postid" => new xmlrpcval($blog->nid, "string")
), "struct");
}
return new xmlrpcval($blogs, "array");
......@@ -257,7 +257,7 @@ function bloggerapi_node_recent($num) {
function bloggerapi_node_delete($nid) {
global $user;
$node = node_load(array("nid" => $nid));
$node = node_load(array("nid" => $nid, "type" => "blog"));
if ($node->uid == $user->uid) {
if (node_access("delete", $node)) {
......@@ -270,7 +270,7 @@ function bloggerapi_node_delete($nid) {
watchdog("special", "$node->type: deleted '$node->title', via Blogger API");
$message = "Node: $node->nid, was deleted";
return new xmlrpcval($message, "string");
return new xmlrpcval(1, "boolean");
}
}
else {
......@@ -282,7 +282,7 @@ function bloggerapi_node_delete($nid) {
** Helper functions
*/
function tt(){
function tt() {
$tt = array_flip(get_html_translation_table(HTML_ENTITIES));
$tt["&apos;"] = "'";
return $tt;
......@@ -293,7 +293,7 @@ function bloggerapi_error($message) {
$error->error = 1;
$error->error_msg = $message;
$error->error_resp = new xmlrpcresp(0, $xmlrpcerruser+1, $message);
$error->error_resp = new xmlrpcresp(0, $xmlrpcerruser + 1, $message);
return $error;
}
......@@ -321,7 +321,7 @@ function bloggerapi_convert($params) {