Commit 8d2b1238 authored by Dries's avatar Dries

- Michael Frankowski's excellent help text improvements!
parent 3cebcdf6
......@@ -9,14 +9,21 @@ function status($message) {
}
}
function admin_system($field){
$system["description"] = t("Handles the administration pages.");
return $system[$field];
}
function admin_link($type) {
if ($type == "admin") {
menu("admin", "Administration", NULL);
menu("admin/sitemap", "sitemap", "sitemap_callback", NULL, 8);
$help["admin"] = t("Welcome to the administration page. Below are the most recent system events. To get started please choose an item in the left column. If there is an arrow it will expand into a submenu. To jump up a level use the link above this block of text. To return to the home page click on the site name, and to go to Drupal's home page click on Druplicon, the drop on to the right.", array("%sitemonitor" => url("admin/watchdog")));
$help["overview"] = t("This is a complete overview of the site administration page.");
menu("admin", "Administration", NULL, $help["admin"]);
menu("admin/overview", "Administration overview", "overview_callback", $help["overview"], 8);
}
}
function sitemap_callback() {
function overview_callback() {
return menu_map("admin");
}
......
......@@ -2,17 +2,17 @@
// $Id$
function import_help() {
?>
<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>
<p>Your newly created bundle will now show up in the list of blocks that you can see at the block related administration pages. There you can customize where and when your bundles will be displayed.</p>
<?php
$output .= "<p>**REWRITE** 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>";
$output .= "<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>";
$output .= "<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>";
$output .= "<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>";
$output .= "<p>Your newly created bundle will now show up in the list of blocks that you can see at the block related administration pages. There you can customize where and when your bundles will be displayed.</p>";
return t($output);
}
function import_system($field){
$system["description"] = t("Used to aggregate syndicated content (RSS and RDF).");
$system["admin_help"] = t("Drupal's news aggregator controls how many RSS/RDF items from a single source are displayed in a \"Block\", and on the page that goes with that block.");
return $system[$field];
}
......@@ -33,17 +33,20 @@ function import_link($type) {
$links = array();
if ($type == "page" && user_access("access news feeds")) {
$links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated websites.")));
$links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated web sites.")));
}
if ($type == "admin" && user_access("administer news feeds")) {
$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>.";
$help["general"] = t("Several web sites, especially news related sites, syndicate parts of their site's content for other web sites to display. Usually, the syndicated content includes the latest headlines with a direct link to that story on the remote site. Some syndicated content also includes a description of the headline. The standard method of syndication is using the XML based Rich Site Summary (RSS). To get a feed to work you <b>must</b> run \"cron.php\". To display the feed in a block you must turn on the <a href=\"%block\">feed's block</a>. <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" => url("admin/block")));
$help["addfeed"] = t("Add a site to that has an RSS/RDF feed. The URL is the full path to the RSS feed file. For the feed to update you must run \"cron.php\". The \"Attributes\" are used to bundle this feed with other feeds (See <a href=\"%bundle\">add new bundle</a>, and to tag articles from this feed.<br />Note: If you already have another feed with the URL you are planning to use, the system will not accept your entry.", array("%bundle" => url("admin/syndication/news/add/bundle")));
$help["bundles"] = t("Bundles provide a generalized way of creating composite feeds. They allow you, for example, to combine various sport-related feeds into one bundle called <i>Sport</i>. If an article from a feed has been \"tag\"-ged (See <a href=\"%tag\">tag news item</a> too look at and change tags.) with a matching \"Attribute\" then it will be added to the bundle.", array("%tag" => url("admin/syndication/news/tag")));
$help["tag"] = t("This allows you to see and change an news item's \"tag\". All articles are originally tagged with the \"Attributes\" of their feed.");
menu("admin/syndication", "content syndication", NULL, NULL, 5);
menu("admin/syndication/news", "news aggregation", "import_admin", $help["general"]);
menu("admin/syndication/news/add/feed", "add new feed", "import_admin", NULL, 2);
menu("admin/syndication/news/add/feed", "add new feed", "import_admin", $help["addfeed"], 2);
menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", $help["bundles"], 3);
menu("admin/syndication/news/tag", "tag news items", "import_admin", NULL, 4);
menu("admin/syndication/news/tag", "tag news items", "import_admin", $help["tag"], 4);
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
}
......@@ -400,7 +403,7 @@ function import_form_feed($edit = array()) {
$edit["refresh"] = 3600;
}
$form .= form_textfield("Title", "title", $edit["title"], 50, 64, "The name of the feed; typically the name of the website you syndicate content from.");
$form .= form_textfield("Title", "title", $edit["title"], 50, 64, "The name of the feed; typically the name of the web site you syndicate content from.");
$form .= form_textfield("Url", "url", $edit["url"], 50, 128, "The fully-qualified URL of the feed.");
$form .= form_textfield("Attributes", "attributes", $edit["attributes"], 50, 128, "A comma-separated list of keywords describing the feed.");
$form .= form_select("Update interval", "refresh", $edit["refresh"], $period, "The refresh interval indicating how often you want to update this feed. Requires crontab.");
......@@ -552,10 +555,10 @@ function import_admin() {
function import_page_info() {
$links[] = l(t("latest news"), "import", array("title" => t("Read the latest news from syndicated websites.")));
$links[] = l(t("latest news"), "import", array("title" => t("Read the latest news from syndicated web sites.")));
$links[] = l(t("news by source"), "import/feeds", array("title" => t("View the latest headlines sorted by source.")));
$links[] = l(t("news by topic"), "import/bundles", array("title" => t("View the latest headlines sorted by topic.")));
$links[] = l(t("news sources"), "import/sources", array("title" => t("View a list of all the websites we syndicate from.")));
$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.")));
......@@ -680,7 +683,7 @@ function import_page_sources() {
$output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />";
}
$output .= l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", "import/fd", array("title" => t("View the list of syndicated websites in XML format."))) ."<br />";
$output .= l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."<br />";
theme("header");
theme("box", t("News feeds"), import_page_info());
......
......@@ -2,17 +2,17 @@
// $Id$
function import_help() {
?>
<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>
<p>Your newly created bundle will now show up in the list of blocks that you can see at the block related administration pages. There you can customize where and when your bundles will be displayed.</p>
<?php
$output .= "<p>**REWRITE** 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>";
$output .= "<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>";
$output .= "<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>";
$output .= "<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>";
$output .= "<p>Your newly created bundle will now show up in the list of blocks that you can see at the block related administration pages. There you can customize where and when your bundles will be displayed.</p>";
return t($output);
}
function import_system($field){
$system["description"] = t("Used to aggregate syndicated content (RSS and RDF).");
$system["admin_help"] = t("Drupal's news aggregator controls how many RSS/RDF items from a single source are displayed in a \"Block\", and on the page that goes with that block.");
return $system[$field];
}
......@@ -33,17 +33,20 @@ function import_link($type) {
$links = array();
if ($type == "page" && user_access("access news feeds")) {
$links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated websites.")));
$links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated web sites.")));
}
if ($type == "admin" && user_access("administer news feeds")) {
$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>.";
$help["general"] = t("Several web sites, especially news related sites, syndicate parts of their site's content for other web sites to display. Usually, the syndicated content includes the latest headlines with a direct link to that story on the remote site. Some syndicated content also includes a description of the headline. The standard method of syndication is using the XML based Rich Site Summary (RSS). To get a feed to work you <b>must</b> run \"cron.php\". To display the feed in a block you must turn on the <a href=\"%block\">feed's block</a>. <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" => url("admin/block")));
$help["addfeed"] = t("Add a site to that has an RSS/RDF feed. The URL is the full path to the RSS feed file. For the feed to update you must run \"cron.php\". The \"Attributes\" are used to bundle this feed with other feeds (See <a href=\"%bundle\">add new bundle</a>, and to tag articles from this feed.<br />Note: If you already have another feed with the URL you are planning to use, the system will not accept your entry.", array("%bundle" => url("admin/syndication/news/add/bundle")));
$help["bundles"] = t("Bundles provide a generalized way of creating composite feeds. They allow you, for example, to combine various sport-related feeds into one bundle called <i>Sport</i>. If an article from a feed has been \"tag\"-ged (See <a href=\"%tag\">tag news item</a> too look at and change tags.) with a matching \"Attribute\" then it will be added to the bundle.", array("%tag" => url("admin/syndication/news/tag")));
$help["tag"] = t("This allows you to see and change an news item's \"tag\". All articles are originally tagged with the \"Attributes\" of their feed.");
menu("admin/syndication", "content syndication", NULL, NULL, 5);
menu("admin/syndication/news", "news aggregation", "import_admin", $help["general"]);
menu("admin/syndication/news/add/feed", "add new feed", "import_admin", NULL, 2);
menu("admin/syndication/news/add/feed", "add new feed", "import_admin", $help["addfeed"], 2);
menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", $help["bundles"], 3);
menu("admin/syndication/news/tag", "tag news items", "import_admin", NULL, 4);
menu("admin/syndication/news/tag", "tag news items", "import_admin", $help["tag"], 4);
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
}
......@@ -400,7 +403,7 @@ function import_form_feed($edit = array()) {
$edit["refresh"] = 3600;
}
$form .= form_textfield("Title", "title", $edit["title"], 50, 64, "The name of the feed; typically the name of the website you syndicate content from.");
$form .= form_textfield("Title", "title", $edit["title"], 50, 64, "The name of the feed; typically the name of the web site you syndicate content from.");
$form .= form_textfield("Url", "url", $edit["url"], 50, 128, "The fully-qualified URL of the feed.");
$form .= form_textfield("Attributes", "attributes", $edit["attributes"], 50, 128, "A comma-separated list of keywords describing the feed.");
$form .= form_select("Update interval", "refresh", $edit["refresh"], $period, "The refresh interval indicating how often you want to update this feed. Requires crontab.");
......@@ -552,10 +555,10 @@ function import_admin() {
function import_page_info() {
$links[] = l(t("latest news"), "import", array("title" => t("Read the latest news from syndicated websites.")));
$links[] = l(t("latest news"), "import", array("title" => t("Read the latest news from syndicated web sites.")));
$links[] = l(t("news by source"), "import/feeds", array("title" => t("View the latest headlines sorted by source.")));
$links[] = l(t("news by topic"), "import/bundles", array("title" => t("View the latest headlines sorted by topic.")));
$links[] = l(t("news sources"), "import/sources", array("title" => t("View a list of all the websites we syndicate from.")));
$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.")));
......@@ -680,7 +683,7 @@ function import_page_sources() {
$output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />";
}
$output .= l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", "import/fd", array("title" => t("View the list of syndicated websites in XML format."))) ."<br />";
$output .= l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."<br />";
theme("header");
theme("box", t("News feeds"), import_page_info());
......
......@@ -3,6 +3,7 @@
function archive_system($field){
$system["description"] = t("Displays a calendar to navigate old content.");
$system["admin_help"] = t("Choose the starting \"day of the week\" for the displayed calendar block.");
return $system[$field];
}
......
......@@ -3,6 +3,7 @@
function archive_system($field){
$system["description"] = t("Displays a calendar to navigate old content.");
$system["admin_help"] = t("Choose the starting \"day of the week\" for the displayed calendar block.");
return $system[$field];
}
......
......@@ -2,40 +2,36 @@
// $Id$
function block_help() {
?>
<p>Blocks are the boxes visible in the side bars on the left- and right-hand side of the website. They are either exported by the engine or by any of the active modules. To really get your teeth into a Drupal website, you are going to have to deal with blocks and administering blocks in a fairly sophisticated fashion. This means you will need to understand how the block placement strategy works.</p>
<p>The placement of blocks is delegated to the administrator. In most cases (i.e., the "custom" blocks), the user has complete control -- using preferences -- over whether or not they are enabled.</p>
<p>An administrator can lay out and arrange the available blocks to fit in two regions: "left" and "right". Regions simply contain blocks. In addition, an administrator can assign each block (within a region) a weight to sort them vertically. The heavier blocks will sink and the lighter blocks will be positioned nearer the top.</p>
<p>As mentioned, blocks may be arranged to fit in two regions: left and right. For theme builders, each region is identified by a corresponding constant: "left" and "right".</p>
<p>The path setting lets you define which pages you want the specific blocks to be shown. If you leave the path blank it will show on all pages. The path uses a regular expression syntax so remember to escape special characters!<br />Examples:
<ul><li>Only show on node pages: ^/node\.php</li><li>Only show on the user page: ^/module\.php\?mod=user</li><li>Show in main page and blog page: ^/(index\.php|module\.php\?mod=blog)</li></ul>
<hr /></p>
<p>The content of the site can be almost entirely altered through <i>boxes</i>. Simply put, boxes are small bits of text, HTML or PHP code which will get plugged into the site just like any other block. Boxes are typically used to add custom blocks to the site.</p>
<p>Each box consists of a title and an associated block of text, HTML or PHP code that can be as long as you wish and that will 'render' the content of the box.</p>
<h3>PHP boxes</h3>
<p>If you know how to script in PHP, PHP boxes are easy to create. Don't worry if you're no PHP-wizard: simply use HTML boxes instead.</p>
<p>You can use any piece of PHP code to make up the content of a PHP box: this implies that you can declare and use functions, consult the SQL database, access configuration settings and much more. A PHP box's code is stored in the database and the engine will dynamically embed the PHP code just-in-time for execution.</p>
<p>There are however some factors to keep in mind when using and creating PHP boxes: PHP boxes can be extremely useful and flexible, yet they can be dangerous and insecure if not properly used. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP boxes because you can - and probably will - corrupt your database or render your site unusable! If you don't plan to do fancy stuff with boxes then you're probably better off with HTML boxes.</p>
<p>Remember that the code within each PHP box must be valid PHP code -- including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your boxes separately using a simple test script on top of a test database before migrating to your production environment.</p>
<p>Note that you can use global variables such as configuration parameters within the scope of a PHP box. Also keep in mind that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.</p>
<p>You can use the <code>return</code> statement to return the actual content for your block as well.</p>
<p><u>A basic example:</u></p>
<p>Given the box with title "Welcome", used to create a "<i>Welcome</i>" box. The content for this box could be created by using:</p>
<pre>
return "Welcome visitor, ... welcome message goes here ...";
</pre>
<p>If we are however dealing with a registered user, we can customize the message by using:</p>
<pre>
if ($user->uid) {
return "Welcome $user->name, ... welcome message goes here ...";
}
else {
return "Welcome visitor, ... welcome message goes here ...";
}
</pre>
<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>
<?php
$output .= "<p>Blocks are the boxes visible in the side bars on the left- and/or right-hand side of the web site, depending on the choosen theme. They are either exported by the Drupal engine or by any of the active modules. To really get your teeth into a Drupal web site, you are going to have to deal with blocks and administering blocks in a fairly sophisticated fashion. This means you will need to understand how the block placement strategy works.</p>";
$output .= "<p>The placement of blocks is delegated to the administrator. In most cases (i.e., the ". l("\"custom\" blocks","admin/block/add") ."), the user has complete control -- using preferences -- over whether or not they are enabled.</p>";
$output .= "<p>An administrator can lay out and arrange the available blocks to fit in two regions: \"left\" and \"right\". Regions simply contain blocks. In addition, an administrator can assign each block (within a region) a weight to sort them vertically. The heavier blocks will \"sink\" towards the bottom of the column while the lighter blocks will \"float\" towards the top.</p>";
$output .= "<p>As mentioned, blocks may be arranged to fit in two regions: left and right. For theme builders, each region is identified by a corresponding constant: \"left\" and \"right\". If there is only one region all the blocks are sorted by weight.</p>";
$output .= "<p>The path setting lets you define which pages you want the specific block to be shown. If you leave the path blank it will show on all pages. The path uses a regular expression syntax so remember to escape special characters!<br />Examples:<ul><li>Only the show block on node pages: ^/node\\.php</li><li>Only show the block on the user page: ^/module\\.php\\?mod=user</li><li>Show the block in main and blog pages: ^/(index\\.php|module\\.php\\?mod=blog)</li></ul><hr /></p>";
$output .= "<p>The content of the site can be almost entirely altered through ". l("<i>custom blocks</i>", "admin/block/add") .". Simply put, custom blocks are small bits of text, HTML or PHP code which will get plugged into the site just like any other block.</p>";
$output .= "<p>Each custom block consists of a title, a description, and a body of text, HTML, or PHP code which can be as long as you wish. The Drupal engine will 'render' the content of the custom block.</p>";
$output .= "<h3>PHP in custom blocks</h3><p>If you know how to script in PHP, PHP custom blocks are easy to create. But don't worry if you're no PHP-wizard: simply use HTML instead.</p>";
$output .= "<p>You can use any piece of PHP code to make up the content of a PHP custom block: this implies that you can declare and use functions, consult the SQL database, access configuration settings and much more. A PHP custom blocks' code is stored in the database and the engine will dynamically embed the PHP code just-in-time for execution.</p>";
$output .= "<p>There are however some factors to keep in mind when using and creating PHP custom blocks: PHP custom blocks can be extremely useful and flexible, yet they can be dangerous and insecure if not properly used. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP custom blocks because you can - and probably will - corrupt your database or render your site unusable! If you don't plan to do fancy stuff with custom blocks then you're probably better off with HTML.</p>";
$output .= "<p>Remember that the code within each PHP custom block must be valid PHP code -- including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your cusom blocks separately using a simple test script on top of a test database before migrating to your production environment.</p>";
$output .= "<p>Note:<br /><ul><li>You can use global variables, such as configuration parameters, within the scope of a PHP box but remember that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.</li><li>register_globals is now set to <b>off</b>. If you need form information you need to get it from the \"superglobals\" \$_POST, \$_GET, etc.</li></ul></p>";
$output .= "<p>You can use the <code>return</code> statement to return the actual content for your block as well.</p>";
$output .= "<p><u>A basic example:</u></p>";
$output .= "<p>Given the box with title \"Welcome\", used to create a \"<i>Welcome</i>\" box. The content for this box could be created by using:</p>";
$output .= "<pre>
return t(\"Welcome visitor, ... welcome message goes here ...\");
</pre>";
$output .= "<p>If we are however dealing with a registered user, we can customize the message by using:</p>";
$output .= "<pre>
if (\$user->uid) {
return t(\"Welcome \$user->name, ... welcome message goes here ...\");
}
else {
return t(\"Welcome visitor, ... welcome message goes here ...\");
}
</pre>";
$output .= "<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>";
return t($output);
}
function block_system($field){
......@@ -49,11 +45,13 @@ function block_perm() {
function block_link($type) {
if ($type == "admin" && user_access("administer blocks")) {
$help["block"] = "Blocks are the boxes visible in the side bars on the left- and right-hand side of the website. They are either exported by the Drupal or by any of the active modules. Adminstrators can enable or disable block, as well control the block placement by assigning them a region and/or by assigning each block (within a region) a weight to sort them vertically. The path setting lets you define which pages you want the specific blocks to be shown.";
$help["block"] = t("Blocks are the boxes visible in the side bars on the left- and right-hand side of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled, then you can assign the block's placement by giving it a region and/or a weight within that region. This sorts them vertically, the smaller the weight, the lighter the block and it will \"float\" towards the top of the page. The path setting is a mask which lets you define on which pages you want the specific block to be shown. The custom checkbox tells Drupal to use a custom designed block, see both <a href=\"%help\">help</a> and <a href=\"%block\">create new block</a> for more information on custom blocks. If you have a custom block then the \"edit\" and \"delete\" operations will be displayed to edit/delete your custom block.", array("%help" => url("admin/block/help"), "%block" => url("admin/block/add")));
$help["create"] = t("Below create a block to be used in the side bars. Once you have created this block you must make it active, and give it a place on the page by using <a href=\"%overview\">block management</a>. The title is used when displaying the block. The description is used in the \"block\" column on the <a href=\"%overview\">block management</a> page. If you are going to place PHP code in the block, and you have <b>create PHP content</b> permission (see <a href=\"%permission\">user management >> user permissions</a>) you <B>must</b> change the type to PHP to make your code active.", array("%overview" => url("admin/block"), "%permission" => url("admin/user/permission")));
$help["preview"] = t("This page shows you the placement of your blocks. Each block is represented by its block name, and it's weight. <b>Layout scheme #1</b> is a layout with both left and right columns. <b>Layout scheme #2</b> has only a right column. And <b>layout scheme #3</b> only a left column.");
menu("admin/block", "block management", "block_admin", $help["block"], 3);
menu("admin/block/add", "create new block", "block_admin", $help["block"], 2);
menu("admin/block/preview", "preview placement", "block_admin", $help["block"], 3);
menu("admin/block/add", "create new block", "block_admin", $help["create"], 2);
menu("admin/block/preview", "preview placement", "block_admin", $help["preview"], 3);
menu("admin/block/help", "help", "block_help", NULL, 9);
}
}
......
......@@ -2,40 +2,36 @@
// $Id$
function block_help() {
?>
<p>Blocks are the boxes visible in the side bars on the left- and right-hand side of the website. They are either exported by the engine or by any of the active modules. To really get your teeth into a Drupal website, you are going to have to deal with blocks and administering blocks in a fairly sophisticated fashion. This means you will need to understand how the block placement strategy works.</p>
<p>The placement of blocks is delegated to the administrator. In most cases (i.e., the "custom" blocks), the user has complete control -- using preferences -- over whether or not they are enabled.</p>
<p>An administrator can lay out and arrange the available blocks to fit in two regions: "left" and "right". Regions simply contain blocks. In addition, an administrator can assign each block (within a region) a weight to sort them vertically. The heavier blocks will sink and the lighter blocks will be positioned nearer the top.</p>
<p>As mentioned, blocks may be arranged to fit in two regions: left and right. For theme builders, each region is identified by a corresponding constant: "left" and "right".</p>
<p>The path setting lets you define which pages you want the specific blocks to be shown. If you leave the path blank it will show on all pages. The path uses a regular expression syntax so remember to escape special characters!<br />Examples:
<ul><li>Only show on node pages: ^/node\.php</li><li>Only show on the user page: ^/module\.php\?mod=user</li><li>Show in main page and blog page: ^/(index\.php|module\.php\?mod=blog)</li></ul>
<hr /></p>
<p>The content of the site can be almost entirely altered through <i>boxes</i>. Simply put, boxes are small bits of text, HTML or PHP code which will get plugged into the site just like any other block. Boxes are typically used to add custom blocks to the site.</p>
<p>Each box consists of a title and an associated block of text, HTML or PHP code that can be as long as you wish and that will 'render' the content of the box.</p>
<h3>PHP boxes</h3>
<p>If you know how to script in PHP, PHP boxes are easy to create. Don't worry if you're no PHP-wizard: simply use HTML boxes instead.</p>
<p>You can use any piece of PHP code to make up the content of a PHP box: this implies that you can declare and use functions, consult the SQL database, access configuration settings and much more. A PHP box's code is stored in the database and the engine will dynamically embed the PHP code just-in-time for execution.</p>
<p>There are however some factors to keep in mind when using and creating PHP boxes: PHP boxes can be extremely useful and flexible, yet they can be dangerous and insecure if not properly used. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP boxes because you can - and probably will - corrupt your database or render your site unusable! If you don't plan to do fancy stuff with boxes then you're probably better off with HTML boxes.</p>
<p>Remember that the code within each PHP box must be valid PHP code -- including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your boxes separately using a simple test script on top of a test database before migrating to your production environment.</p>
<p>Note that you can use global variables such as configuration parameters within the scope of a PHP box. Also keep in mind that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.</p>
<p>You can use the <code>return</code> statement to return the actual content for your block as well.</p>
<p><u>A basic example:</u></p>
<p>Given the box with title "Welcome", used to create a "<i>Welcome</i>" box. The content for this box could be created by using:</p>
<pre>
return "Welcome visitor, ... welcome message goes here ...";
</pre>
<p>If we are however dealing with a registered user, we can customize the message by using:</p>
<pre>
if ($user->uid) {
return "Welcome $user->name, ... welcome message goes here ...";
}
else {
return "Welcome visitor, ... welcome message goes here ...";
}
</pre>
<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>
<?php
$output .= "<p>Blocks are the boxes visible in the side bars on the left- and/or right-hand side of the web site, depending on the choosen theme. They are either exported by the Drupal engine or by any of the active modules. To really get your teeth into a Drupal web site, you are going to have to deal with blocks and administering blocks in a fairly sophisticated fashion. This means you will need to understand how the block placement strategy works.</p>";
$output .= "<p>The placement of blocks is delegated to the administrator. In most cases (i.e., the ". l("\"custom\" blocks","admin/block/add") ."), the user has complete control -- using preferences -- over whether or not they are enabled.</p>";
$output .= "<p>An administrator can lay out and arrange the available blocks to fit in two regions: \"left\" and \"right\". Regions simply contain blocks. In addition, an administrator can assign each block (within a region) a weight to sort them vertically. The heavier blocks will \"sink\" towards the bottom of the column while the lighter blocks will \"float\" towards the top.</p>";
$output .= "<p>As mentioned, blocks may be arranged to fit in two regions: left and right. For theme builders, each region is identified by a corresponding constant: \"left\" and \"right\". If there is only one region all the blocks are sorted by weight.</p>";
$output .= "<p>The path setting lets you define which pages you want the specific block to be shown. If you leave the path blank it will show on all pages. The path uses a regular expression syntax so remember to escape special characters!<br />Examples:<ul><li>Only the show block on node pages: ^/node\\.php</li><li>Only show the block on the user page: ^/module\\.php\\?mod=user</li><li>Show the block in main and blog pages: ^/(index\\.php|module\\.php\\?mod=blog)</li></ul><hr /></p>";
$output .= "<p>The content of the site can be almost entirely altered through ". l("<i>custom blocks</i>", "admin/block/add") .". Simply put, custom blocks are small bits of text, HTML or PHP code which will get plugged into the site just like any other block.</p>";
$output .= "<p>Each custom block consists of a title, a description, and a body of text, HTML, or PHP code which can be as long as you wish. The Drupal engine will 'render' the content of the custom block.</p>";
$output .= "<h3>PHP in custom blocks</h3><p>If you know how to script in PHP, PHP custom blocks are easy to create. But don't worry if you're no PHP-wizard: simply use HTML instead.</p>";
$output .= "<p>You can use any piece of PHP code to make up the content of a PHP custom block: this implies that you can declare and use functions, consult the SQL database, access configuration settings and much more. A PHP custom blocks' code is stored in the database and the engine will dynamically embed the PHP code just-in-time for execution.</p>";
$output .= "<p>There are however some factors to keep in mind when using and creating PHP custom blocks: PHP custom blocks can be extremely useful and flexible, yet they can be dangerous and insecure if not properly used. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP custom blocks because you can - and probably will - corrupt your database or render your site unusable! If you don't plan to do fancy stuff with custom blocks then you're probably better off with HTML.</p>";
$output .= "<p>Remember that the code within each PHP custom block must be valid PHP code -- including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your cusom blocks separately using a simple test script on top of a test database before migrating to your production environment.</p>";
$output .= "<p>Note:<br /><ul><li>You can use global variables, such as configuration parameters, within the scope of a PHP box but remember that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.</li><li>register_globals is now set to <b>off</b>. If you need form information you need to get it from the \"superglobals\" \$_POST, \$_GET, etc.</li></ul></p>";
$output .= "<p>You can use the <code>return</code> statement to return the actual content for your block as well.</p>";
$output .= "<p><u>A basic example:</u></p>";
$output .= "<p>Given the box with title \"Welcome\", used to create a \"<i>Welcome</i>\" box. The content for this box could be created by using:</p>";
$output .= "<pre>
return t(\"Welcome visitor, ... welcome message goes here ...\");
</pre>";
$output .= "<p>If we are however dealing with a registered user, we can customize the message by using:</p>";
$output .= "<pre>
if (\$user->uid) {
return t(\"Welcome \$user->name, ... welcome message goes here ...\");
}
else {
return t(\"Welcome visitor, ... welcome message goes here ...\");
}
</pre>";
$output .= "<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>";
return t($output);
}
function block_system($field){
......@@ -49,11 +45,13 @@ function block_perm() {
function block_link($type) {
if ($type == "admin" && user_access("administer blocks")) {
$help["block"] = "Blocks are the boxes visible in the side bars on the left- and right-hand side of the website. They are either exported by the Drupal or by any of the active modules. Adminstrators can enable or disable block, as well control the block placement by assigning them a region and/or by assigning each block (within a region) a weight to sort them vertically. The path setting lets you define which pages you want the specific blocks to be shown.";
$help["block"] = t("Blocks are the boxes visible in the side bars on the left- and right-hand side of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled, then you can assign the block's placement by giving it a region and/or a weight within that region. This sorts them vertically, the smaller the weight, the lighter the block and it will \"float\" towards the top of the page. The path setting is a mask which lets you define on which pages you want the specific block to be shown. The custom checkbox tells Drupal to use a custom designed block, see both <a href=\"%help\">help</a> and <a href=\"%block\">create new block</a> for more information on custom blocks. If you have a custom block then the \"edit\" and \"delete\" operations will be displayed to edit/delete your custom block.", array("%help" => url("admin/block/help"), "%block" => url("admin/block/add")));
$help["create"] = t("Below create a block to be used in the side bars. Once you have created this block you must make it active, and give it a place on the page by using <a href=\"%overview\">block management</a>. The title is used when displaying the block. The description is used in the \"block\" column on the <a href=\"%overview\">block management</a> page. If you are going to place PHP code in the block, and you have <b>create PHP content</b> permission (see <a href=\"%permission\">user management >> user permissions</a>) you <B>must</b> change the type to PHP to make your code active.", array("%overview" => url("admin/block"), "%permission" => url("admin/user/permission")));
$help["preview"] = t("This page shows you the placement of your blocks. Each block is represented by its block name, and it's weight. <b>Layout scheme #1</b> is a layout with both left and right columns. <b>Layout scheme #2</b> has only a right column. And <b>layout scheme #3</b> only a left column.");
menu("admin/block", "block management", "block_admin", $help["block"], 3);
menu("admin/block/add", "create new block", "block_admin", $help["block"], 2);
menu("admin/block/preview", "preview placement", "block_admin", $help["block"], 3);
menu("admin/block/add", "create new block", "block_admin", $help["create"], 2);
menu("admin/block/preview", "preview placement", "block_admin", $help["preview"], 3);
menu("admin/block/help", "help", "block_help", NULL, 9);
}
}
......
......@@ -3,6 +3,7 @@
function blog_system($field){
$system["description"] = t("Enables keeping a blog or easily and regularly updated web page.");
$system["admin_help"] = t("A weBLOG is a running journal of a users ideas. Enter the minimum word count for a single entry, and the text displayed on the entry submission form");
return $system[$field];
}
......@@ -70,12 +71,13 @@ function blog_user($type, &$edit, &$user) {
}
function blog_help() {
?>
<p>Drupal's blog module allows registered users to maintain an online blog, often referred to as an online journal or diary. They can be filled with daily thoughts, poetry, boneless blabber, spiritual theories, intimate details, valuable experiences, cynical rants, semi-coherent comments, writing experiments, artistic babblings, critics on current facts, fresh insights, diverse dreams, chronicles and mumbling madness available for public consumption. It is made up of individual entries that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen, or agree/disagree with. A typical example of a long term blog can be seen at <a href="http://www.scripting.com/">http://www.scripting.com/</a>.</p>
<p>The blog module adds a couple of menu options. Everyone gets to see the "latest blogs", a page that displays the most recent blog entries from every participant. If you are logged in, your personal menu also has "submit a blog" link which will lead you to a submission form. You are also presented a "view personal blog" menu option that displays your blog entries as other people will see it. For you only, there is an edit link at the bottom left of a page that lets you edit or delete old entries.</p>
<p>Both in the import module (news aggregator) and the blog module displays glyphs that looks like a pinboard stickit note. Click on this and you are taken to the blog submission form. The system helpfully copies the title, a link to the item, and a link to the source into the body text 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.</p>
<p>For Drupal administrators a blog entry is just another node that can be administered from the "content management" page in the administration pages.</p>
<?php
$output .= "<p>Drupal's blog module allows registered users to maintain an online weblog (commonly known as a blog), often referred to as an online journal or diary. They can be filled with daily thoughts, poetry, boneless blabber, spiritual theories, intimate details, valuable experiences, cynical rants, semi-coherent comments, writing experiments, artistic babblings, critics on current facts, fresh insights, diverse dreams, chronicles and mumbling madness available for public consumption.";
$output .= " Blogs 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, or agree/disagree with. A typical example of a long term blog can be seen at <a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>.</p>";
$output .= "<p>The blog module adds a couple of menu options. \"user blogs\", a page that everyone gets to see that displays the most recent blog entries from every participant. Your personal menu adds a \"create a blog entry\" link which takes you to a submission form, a \"view personal blog\" link which displays your blog entries as <i>other</i> people will see them. And, on the bottom of each of your blog entry, there is an \"edit this blog entry\" link that lets you edit or delete old entries.</p>";
$output .= "<p>In the import module (news aggregator) a glyph that looks like a pinboard stickit note is displayed. Click on this and you are taken to the blog submission form. The system helpfully copies the title, a link to the item, and a link to the source into the body text 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.</p>";
return t($output);
}
function blog_feed_user($uid = 0) {
......
......@@ -3,6 +3,7 @@
function blog_system($field){
$system["description"] = t("Enables keeping a blog or easily and regularly updated web page.");
$system["admin_help"] = t("A weBLOG is a running journal of a users ideas. Enter the minimum word count for a single entry, and the text displayed on the entry submission form");
return $system[$field];
}
......@@ -70,12 +71,13 @@ function blog_user($type, &$edit, &$user) {
}
function blog_help() {
?>
<p>Drupal's blog module allows registered users to maintain an online blog, often referred to as an online journal or diary. They can be filled with daily thoughts, poetry, boneless blabber, spiritual theories, intimate details, valuable experiences, cynical rants, semi-coherent comments, writing experiments, artistic babblings, critics on current facts, fresh insights, diverse dreams, chronicles and mumbling madness available for public consumption. It is made up of individual entries that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen, or agree/disagree with. A typical example of a long term blog can be seen at <a href="http://www.scripting.com/">http://www.scripting.com/</a>.</p>
<p>The blog module adds a couple of menu options. Everyone gets to see the "latest blogs", a page that displays the most recent blog entries from every participant. If you are logged in, your personal menu also has "submit a blog" link which will lead you to a submission form. You are also presented a "view personal blog" menu option that displays your blog entries as other people will see it. For you only, there is an edit link at the bottom left of a page that lets you edit or delete old entries.</p>
<p>Both in the import module (news aggregator) and the blog module displays glyphs that looks like a pinboard stickit note. Click on this and you are taken to the blog submission form. The system helpfully copies the title, a link to the item, and a link to the source into the body text 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.</p>
<p>For Drupal administrators a blog entry is just another node that can be administered from the "content management" page in the administration pages.</p>
<?php
$output .= "<p>Drupal's blog module allows registered users to maintain an online weblog (commonly known as a blog), often referred to as an online journal or diary. They can be filled with daily thoughts, poetry, boneless blabber, spiritual theories, intimate details, valuable experiences, cynical rants, semi-coherent comments, writing experiments, artistic babblings, critics on current facts, fresh insights, diverse dreams, chronicles and mumbling madness available for public consumption.";
$output .= " Blogs 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, or agree/disagree with. A typical example of a long term blog can be seen at <a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>.</p>";
$output .= "<p>The blog module adds a couple of menu options. \"user blogs\", a page that everyone gets to see that displays the most recent blog entries from every participant. Your personal menu adds a \"create a blog entry\" link which takes you to a submission form, a \"view personal blog\" link which displays your blog entries as <i>other</i> people will see them. And, on the bottom of each of your blog entry, there is an \"edit this blog entry\" link that lets you edit or delete old entries.</p>";
$output .= "<p>In the import module (news aggregator) a glyph that looks like a pinboard stickit note is displayed. Click on this and you are taken to the blog submission form. The system helpfully copies the title, a link to the item, and a link to the source into the body text 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.</p>";
return t($output);
}
function blog_feed_user($uid = 0) {
......
......@@ -370,56 +370,22 @@ function bloggerapi_system($field){
}
function bloggerapi_help() {
?>
<h3>Introduction</h3>
$output .= "<h3>Introduction</h3><p><a href=\"http://www.blogger.com\">Blogger</a>, the well-known public weblog service, provides an application programing interface (API) to allow remote procedure calls (RPC) to the Blogger service. Drupal supports this <a href=\"http://plant.blogger.com/api/index.html\">Blogger API</a>, which means that many remote clients (e.g. <a href=\"radio.userland.com\">Radio</a>, <a href=\"http://simon.kittle.info/textrouter\">TextRouter</a>, <a href=\"http://blogbuddy.sourceforge.net/\">Blogbuddy</a>, <a href=\"http://www.wbloggar.com/\">w.bloggar</a>, <a href=\"http://www.tswoam.co.uk/index.php?n_go=16\">PerlyBlog</a>), may post to Drupal. These clients provide a bevy of interesting capabilities like offline composing, spellcheck, and WYSIWYG editing; many folks prefer to blog with a client application over typical web forms. By supporting the Blogger API, Drupal grows grander than a web site engine, it's a <i>content accepting machine</i>&trade;.</p>";
$output .= "<p>The <a href=\"http://plant.blogger.com/api/index.html\">Blogger RPC API</a> uses the <a href=\"http://www.xmlrpc.com\">XML-RPC</a> protocol for communicating with the outside world. XML-RPC, originally developed by Dave Winer of <a href=\"http://www.userland.com\">UserLand Software</a>, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses XML-RPC for several other tasks (e.g. notifiying <a href=\"http://www.weblogs.com\">weblogs.com</a> of blog updates and making/accepting ". l("distributed authentication", "user/help") ." requests)</p>";
$output .= "<h3>Blogger API implementation</h3><p>A word of warning on the Blogger API: it is <b>unofficial</b>. It exists because Blogger is one of the most popular services and also they were first to implement an XML-RPC interface to their service. It is certainly not the best implementation of a distributed weblog API. For a promising candidate, see <a href=\"http://www.wasabii.org\">Wasabii</a>.</p>";
$output .= "<p>Drupal's support for the Blogger API is quite complete. Each method with an asterisk below has been implemented in Drupal.</p>";
$output .= "<p><a href=\"http://plant.blogger.com/api/xmlrpc_newPost.html\">blogger.newPost()*</a><br /><a href=\"http://plant.blogger.com/api/xmlrpc_editPost.html\">blogger.editPost()*</a><br /><a href=\"http://plant.blogger.com/api/xmlrpc_getUsersBlogs.html\">blogger.getUsersBlogs()*</a><br /><a href=\"http://plant.blogger.com/api/xmlrpc_getUserInfo.html\">blogger.getUserInfo()*</a><br /><a href=\"http://plant.blogger.com/api/xmlrpc_getTemplate.html\">blogger.getTemplate()</a><br /><a href=\"http://plant.blogger.com/api/xmlrpc_setTemplate.html\">blogger.setTemplate()</a><br /></p>";
$output .= "<p>Drupal also supports the following methods. These methods were added after the those listed above and are not documented on the Blogger API web site. Each method is linked to its corresponding blogger-dev mailing list posts:</p>";
$output .= "<p><a href=\"http://groups.yahoo.com/group/bloggerDev/message/296\">blogger.getPost()*</a><br /><a href=\"http://groups.yahoo.com/group/bloggerDev/message/225\">blogger.getRecentPosts()*</a><br /><a href=\"http://groups.yahoo.com/group/bloggerDev/message/147\">blogger.deletePost()*</a><br /></p>";
$output .= "<h3>Installation and usage</h3><p>To install the Blogger API module, enable the module in the ". l("Administration &gt;&gt; site configuration &gt;&gt; modules", "admin/systems/modules") ." tab in the administration pages. Also make sure you have your permissions set correctly for accessing the Blogger API, the relevant settings can be found under the ". l("user management", "admin/user/permission") ." section in the administration menu. Check the checkbox behind the line \"access Blogger API\" for the roles that are allowed to use the Blogger API.</p>";
$output .= "<p>Once the API is enabled you can download one of the above mentioned Blogger API clients and get blogging.</p>";
$output .= "<h3>Setup of the client</h3><p>The Drupal page you need to call in order to connect using the Blogger API is <i>http://server/xmlrpc.php</i> where <i>server</i> is the URL of the site you want to post to. As an example when posting to drupal.org, the account settings for <a href=\"http://www.wbloggar.com/\">w.bloggar</a> would be: host: www.drupal.org (default = plant.blogger.com) and page: xmlrpc.php (default = /api/RPC2).</p>";
$output .= "<p>You can't use remote authentication when posting using a Blogger API enabled client, even when you could use that to authenticate on the site itself. You will have to use the site's local username, enter a password for that account, and then use that combination to post using the Blogger API client.</p>";
$output .= "<h3>Notes and limitations</h3><ul><li>The Blogger API contains an AppKey that is discarded in the Drupal Implementation.</li><li>The Blogger API does not allow for a title element. Our work around for this is either to use &lt;title&gt;&lt;/title&gt; tags in the body of your post or let the module create a title by inspecting the first few lines of the post body.</li><li>The publish parameter is always set to <i>1</i>.</li><li>When using the <i>getUserInfo</i> call, Drupal attempts to generate a first and last name from the Drupal username; no distinction is made internally</li><li><i>GetUsersBlogs</i> only returns one blog because unlike Blogger, Drupal only allows one blog per user.</li></ul>";
$output .= "<h3>Credits</h3><p>The original Drupal Blogger API implementation was authored by <a href=\"http://www.voidstar.com/\">Julian Bond</a>, and updated by the Drupal team.</a>";
return t($output);
<p><a href="http://www.blogger.com">Blogger</a>, the well-known public weblog service, provides an application programing interface (API) to allow remote procedure calls (RPC) to the Blogger service. Drupal supports this <a href="http://plant.blogger.com/api/index.html">Blogger API</a>, which means that many remote clients (e.g. <a href="radio.userland.com">Radio</a>, <a href="http://simon.kittle.info/textrouter">TextRouter</a>, <a href="http://blogbuddy.sourceforge.net/">Blogbuddy</a>, <a href="http://www.wbloggar.com/">w.bloggar</a>, <a href="http://www.tswoam.co.uk/index.php?n_go=16">PerlyBlog</a>), may post to Drupal. These clients provide a bevy of interesting capabilities like offline composing, spellcheck, and WYSIWYG editing; many folks prefer to blog with a client application over typical web forms. By supporting the Blogger API, Drupal grows grander than a web site engine, it's a <i>content accepting machine</i>&trade;.
<p>The <a href="http://plant.blogger.com/api/index.html">Blogger RPC API</a> uses the <a href="http://www.xmlrpc.com">XML-RPC</a> protocol for communicating with the outside world. XML-RPC, originally developed by Dave Winer of <a href="http://www.userland.com">UserLand Software</a>, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses XML-RPC for several other tasks (e.g. notifiying <a href="http://www.weblogs.com">weblogs.com</a> of blog updates and making/accepting <?php echo l("distributed authentication", "user/help"); ?> requests)</p>
<h3>Blogger API implementation</h3>
<p>A word of warning on the Blogger API: it is unofficial. It exists because Blogger is one of the most popular services and also they were first to implement an XML-RPC interface to their service. It is certainly not the best implementation of a distributed weblog API. For a promising candidate, see <a href="http://www.wasabii.org">Wasabii</a>.</p>
<p>Drupal's support for the Blogger API is quite complete. Each method with an asterisk below has been implemented in Drupal.</p>
<p>
<a href="http://plant.blogger.com/api/xmlrpc_newPost.html">blogger.newPost()*</a><br />
<a href="http://plant.blogger.com/api/xmlrpc_editPost.html">blogger.editPost()*</a><br />
<a href="http://plant.blogger.com/api/xmlrpc_getUsersBlogs.html">blogger.getUsersBlogs()*</a><br />
<a href="http://plant.blogger.com/api/xmlrpc_getUserInfo.html">blogger.getUserInfo()*</a><br />
<a href="http://plant.blogger.com/api/xmlrpc_getTemplate.html">blogger.getTemplate()</a><br />
<a href="http://plant.blogger.com/api/xmlrpc_setTemplate.html">blogger.setTemplate()</a><br /></p>
<p>Drupal also supports the following methods. These methods were added after the those listed above and are not documented on the Blogger API website. Each method is linked to its corresponding blogger-dev mailing list posts:</p>
<p>
<a href="http://groups.yahoo.com/group/bloggerDev/message/296">blogger.getPost()*</a><br />
<a href="http://groups.yahoo.com/group/bloggerDev/message/225">blogger.getRecentPosts()*</a><br />
<a href="http://groups.yahoo.com/group/bloggerDev/message/147">blogger.deletePost()*</a><br /></p>
<h3>Installation and usage</h3>
<p>To install the Blogger API module, enable the module in the <i>site configuration - modules</i> tab in the administration pages. Also make sure you have your permissions set correctly for accessing the Blogger API, the relevant settings can be found under the <i>user management</i> tab in the administration menu. Check the checkbox behind the line "access Blogger API" for the roles that are allowed to use the Blogger API.</p>
<p>Once the API is enabled you can download one of the above mentioned Blogger API clients and get blogging.</p>
<h3>Setup of the client</h3>
<p>The Drupal page you need to call in order to connect using the Blogger API is <i>http://server/xmlrpc.php</i> where <i>server</i> is the URL of the site you want to post to. When posting to drupal.org, the account settings for i.e. <a href="http://www.wbloggar.com/">w.bloggar</a> would be: host: www.drupal.org (default = plant.blogger.com) and page: xmlrpc.php (default = /api/RPC2).</p>
<p>You can't use remote authentication when posting using a Blogger API enabled client, even when you could use that to authenticate on the site itself. You will have to use the site's local username, enter a password for that account, and then use that combination to post using the Blogger API client.</p>
<h3>Notes and limitations</h3>
<ul>
<li>The Blogger API contains an AppKey that is discarded in the Drupal Implementation.</li>
<li>The Blogger API does not allow for a title element. Our work around for this is either to use &lt;title&gt;&lt;/title&gt; tags in the body of your post or let the module create a title by inspecting the first few lines of the post body.</li>
<li>The publish parameter is always set to <i>1</i>.</li>
<li>When using the <i>getUserInfo</i> call, Drupal attempts to generate a first and last name from the Drupal username; no distinction is made internally</li>
<li><i>GetUsersBlogs</i> only returns one blog because unlike Blogger, Drupal only allows one blog per user.</li>
</ul>
<h3>Credits</h3>
<p>The original Drupal Blogger API implementation was authored by <a href="http://www.voidstar.com/">Julian Bond</a>, and updated by the Drupal team.</a>
<?php
}
?>
......@@ -80,7 +80,7 @@ function book_link($type, $node = 0, $main = 0) {
if ($type == "admin" && user_access("maintain books")) {
$help["book"] = "The collaborative book offers a mean to organize content, authored by many users, in an online manual, outline or FAQ.";
$help["orphan"] = "As pages in a book are edited, reorganized and removed, child pages might be left behind. We refer to such pages as 'orphan pages'. On this page, administrators can review their books for orphans and reaffiliate those pages as desired.";
$help["orphan"] = "Pages in a book are like a tree. As pages are edited, reorganized and removed, child pages might be left with no link to the rest of the book. Such pages are refered to as 'orphan pages'. On this page, administrators can review their books for orphans and reattach those pages as desired.";
menu("admin/node/book", "collaborative books", "book_admin", $help["book"], 4);
menu("admin/node/book/orphan", "orphan pages", "book_admin", $help["orphan"], 8);
......@@ -748,33 +748,17 @@ function book_admin() {
}
function book_help() {
?>
<p>The <i>collaborative book</i> is a magnificient mechanism for organizing content authored by many users. You may use it to organize a manual, to <a href="#faq">maintain a FAQ</a>, or to manage any outline-like content. Books can have chapters, sections, etc. In fact, books can have an arbitrarily deep nesting strucuture.</p>
$output .= "<p>The <i>collaborative book</i> is a magnificient mechanism for organizing content authored by many users. You may use it to organize a manual, to <a href=\"#faq\">maintain a FAQ</a>, or to manage any outline-like content. Books can have chapters, sections, etc. In fact, books can have an arbitrarily deep nesting strucuture.</p>";
$output .= "<p>Under the covers, a book is only an organization of nodes. These nodes are often of type <i>book page</i>, but can be of any content type. Every node in the book has a <i>Parent</i>. The parent is the node which \"contains\" the child node. This is how book.module establishes its hierarchy. On any given level in the hierarchy, a book can contain many nodes. Book uses the Weight field to order these sibling nodes.</p>";
$output .= "<p>Book pages are a special, powerful node type. These nodes are specifically designed to be included in a book. Their special power comes from the abilility to embed PHP within the body of the page. This capability is only offerred to administrators, since malicious users could abuse this power. In addiiton, book pages contain a <i>log message</i> field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is usually stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that become desirable.</p>";
$output .= "<p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use ". l("permissions", "admin/user/permission") ." to determine who may read and write to them. Only administrators are allowed to create new books, which are really just nodes whose parent is <i>&lt;root&gt;</i>. To include an existing node in your book, click on the \"administer\"-link in that node. At the bottom of this administration page, click on the <i>edit book outline</i> button. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the <i>create book page</i> link.</p>";
$output .= "<p>Administrators may review the hierarchy of their books by clicking on the ". l("collaborative book", "admin/node/book")." link in the adminstration pages. There, nodes may be edited, reorganized, removed from book, and deleted. This behavior may change in the future. When a parent node is deleted, he may leave behind child nodes. These nodes are now <i>orphans</i>. Administrators should periodically ". l("review their books for orphans", "admin/node/book/orphan") ." and reaffiliate those pages as desired. Finally, administrators may also ". l("export their books", "book/print") ." to a single, flat HTML page which is suitable for printing.</p>";
$output .= "<a name=\"faq\"></a><h3>Maintain a FAQ using a collaborative book</h3>";
$output .= "<p>The collaborative book (i.e. <code>book.module</code>) in Drupal is a terrific way to easily manage an FAQ (Frequently Asked Questions) section of your web site. The main benefit for an administrator is that you don't have to write all the questions/answers by yourself. Let the community do it for you!</p>";
$output .= "<p>In order to setup the FAQ, you have to create a new <i>Book</i> which will hold all your content. To do so, click on <i>Create Book Page</i> in your user box. Give it a thoughtful Title, and Body. A title like \"Estonia Travel - FAQ\" is nice. You may always edit these fields later. You will probably want to designate <i>&lt;root&gt;</i> as the parent of this page. Leave the <i>log message</i> and <i>type</i> fields blank for now. After you have submitted this book page, you are ready to begin filling up your book with questions that are frequently asked.</p>";
$output .= "<p>Whenever you come across a post which you want to include in your FAQ, click on the <i>administer</i> link. Then click on the <i>edit book outline</i> button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a <i>parent</i>. Books are quite flexible. They can have sections like <i>Flying to Estonia</i>, <i>Eating in Estonia</i> and so on. As you get more experienced with the <i>collaborative book</i>, you can reorganize posts in your book so that it stays organized.</p>";
$output .= "<p>Notes:</p><ul><li>Any comments attached to those relevant posts which you designate as book pages will also be transported into your book. This is a great feature, since much wisdom is shared via comments. And remember that all future comments and edits will automatically be reflected in your book.</li><li>You may wish to edit the title and teaser of posts when adding them to your FAQ. This is done on the same page as the <i>Edit book outline</i> button. Clear titles help users navigate quickly to the information that they seek.</li><li>Book pages may come from any content type (blog, story, page, etc.). If you are creating a post solely for inclusion in your book, then use the <i>Create book page</i> link.</li><li>If you don't see the <i>administer</i> link, then you probably have insufficient ". l("permissions", "admin/user/permission") .".</li><li>If you want to get really fancy, note that Books are one of the few content types which allow raw PHP in their <i>body</i>. So you've got lots of geeky possibilities there.</li></ul>";
return t($output);
<p>Under the covers, a book is only an organization of nodes. These nodes are often of type <i>book page</i>, but can be of any content type. Every node in the book has a <i>Parent</i>. The parent is the node which "contains" the child node. This is how book.module establishes its hierarchy. On any given level in the hierarchy, a book can contain many nodes. Book uses the Weight field to order these sibling nodes.</p>
<p>Book pages are a special, powerful node type. These nodes are specifically designed to be included in a book. Their special power comes from the bilility to embed PHP within the body of the page. This capability is only offerred to administrators, since malicious users could abuse this power. In addiiton, book pages contain a <i>log message</i> field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is usually stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that become desirable.</p>
<p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use <?php echo l("permissions", "admin/user/permission") ?> to determine who may read and write to them. Only administrators are allowed to create new books, which are really just nodes whose parent is <i>&lt;root&gt;</i>. To include an existing node in your book, click on the "administer"-link in that node. At the bottom of this administration page, click on the <i>edit book outline</i> button. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the <i>create book page</i> link.</p>
<p>Administrators may review the hierarchy of their books by clicking on the <?php echo l("collaborative book link", "admin/book") ?> in the adminstration pages. There, nodes may be edited, reorganized, removed from book, and deleted. This behavior may change in the future. When a parent node is deleted, he may leave behind child nodes. These nodes are now <i>orphans</i>. Administrators should periodically <?php echo l("review their books for orphans", "admin/book/orphan") ?> and reaffiliate those pages as desired. Finally, administrators may also <?php echo l("export their books", "book/print") ?> to a single, flat HTML page which is suitable for printing.</p>
<a name="faq"></a><h3>Maintain a FAQ using a collaborative book</h3>