summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-05-29 09:15:00 +0000
committerDries Buytaert <dries@buytaert.net>2003-05-29 09:15:00 +0000
commit8d2b1238b4d8ebd57848fde665b7f93c3a03cd90 (patch)
tree8f6c64926b931489dd73f3075aad2ffd549009da /modules
parent3cebcdf636f7eb47d6304a48057b34ddbaf43f04 (diff)
downloadbrdo-8d2b1238b4d8ebd57848fde665b7f93c3a03cd90.tar.gz
brdo-8d2b1238b4d8ebd57848fde665b7f93c3a03cd90.tar.bz2
- Michael Frankowski's excellent help text improvements!
Diffstat (limited to 'modules')
-rw-r--r--modules/admin.module13
-rw-r--r--modules/aggregator.module35
-rw-r--r--modules/aggregator/aggregator.module35
-rw-r--r--modules/archive.module1
-rw-r--r--modules/archive/archive.module1
-rw-r--r--modules/block.module72
-rw-r--r--modules/block/block.module72
-rw-r--r--modules/blog.module14
-rw-r--r--modules/blog/blog.module14
-rw-r--r--modules/bloggerapi.module66
-rw-r--r--modules/book.module40
-rw-r--r--modules/book/book.module40
-rw-r--r--modules/cloud.module15
-rw-r--r--modules/comment.module70
-rw-r--r--modules/comment/comment.module70
-rw-r--r--modules/drupal.module23
-rw-r--r--modules/drupal/drupal.module23
-rw-r--r--modules/forum.module28
-rw-r--r--modules/forum/forum.module28
-rw-r--r--modules/import.module35
-rw-r--r--modules/jabber.module5
-rw-r--r--modules/locale.module61
-rw-r--r--modules/locale/locale.module61
-rw-r--r--modules/node.module36
-rw-r--r--modules/node/node.module36
-rw-r--r--modules/ping.module4
-rw-r--r--modules/ping/ping.module4
-rw-r--r--modules/poll.module5
-rw-r--r--modules/poll/poll.module5
-rw-r--r--modules/profile.module1
-rw-r--r--modules/profile/profile.module1
-rw-r--r--modules/queue.module1
-rw-r--r--modules/search.module3
-rw-r--r--modules/search/search.module3
-rw-r--r--modules/statistics.module158
-rw-r--r--modules/statistics/statistics.module158
-rw-r--r--modules/story.module3
-rw-r--r--modules/story/story.module3
-rw-r--r--modules/system.module25
-rw-r--r--modules/system/system.module25
-rw-r--r--modules/taxonomy.module73
-rw-r--r--modules/taxonomy/taxonomy.module73
-rw-r--r--modules/throttle.module95
-rw-r--r--modules/throttle/throttle.module95
-rw-r--r--modules/user.module392
-rw-r--r--modules/user/user.module392
-rw-r--r--modules/watchdog.module35
-rw-r--r--modules/watchdog/watchdog.module35
48 files changed, 958 insertions, 1525 deletions
diff --git a/modules/admin.module b/modules/admin.module
index e5f2fdb9b..cb5d36a86 100644
--- a/modules/admin.module
+++ b/modules/admin.module
@@ -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");
}
diff --git a/modules/aggregator.module b/modules/aggregator.module
index b5ed8f92b..ed70162b4 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -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());
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index b5ed8f92b..ed70162b4 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -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());
diff --git a/modules/archive.module b/modules/archive.module
index a77176e43..5953223ba 100644
--- a/modules/archive.module
+++ b/modules/archive.module
@@ -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];
}
diff --git a/modules/archive/archive.module b/modules/archive/archive.module
index a77176e43..5953223ba 100644
--- a/modules/archive/archive.module
+++ b/modules/archive/archive.module
@@ -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];
}
diff --git a/modules/block.module b/modules/block.module
index c70f0f6c5..bd5a3785c 100644
--- a/modules/block.module
+++ b/modules/block.module
@@ -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);
}
}
diff --git a/modules/block/block.module b/modules/block/block.module
index c70f0f6c5..bd5a3785c 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -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);
}
}
diff --git a/modules/blog.module b/modules/blog.module
index ae096a19d..5eef0f34d 100644
--- a/modules/blog.module
+++ b/modules/blog.module
@@ -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) {
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index ae096a19d..5eef0f34d 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -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) {
diff --git a/modules/bloggerapi.module b/modules/bloggerapi.module
index c21202c1e..3b27261bd 100644
--- a/modules/bloggerapi.module
+++ b/modules/bloggerapi.module
@@ -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
}
?>
diff --git a/modules/book.module b/modules/book.module
index 200ea3c11..8e2c6057a 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -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>
-
-<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>
-
-<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>
-
-<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>
-
-<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 <?php echo 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>
- <?php
}
?>
diff --git a/modules/book/book.module b/modules/book/book.module
index 200ea3c11..8e2c6057a 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -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>
-
-<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>
-
-<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>
-
-<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>
-
-<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 <?php echo 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>
- <?php
}
?>
diff --git a/modules/cloud.module b/modules/cloud.module
index 613771943..339fedc38 100644
--- a/modules/cloud.module
+++ b/modules/cloud.module
@@ -3,13 +3,13 @@
function cloud_help($type = "administrator") {
if ($type == "user") {
- $output .= "<p>". t("The cloud monitor tracks or crawls other interesting websites and displays their latest modification dates. It acts as a link watcher such that you can keep an eye on the other sites in our cloud.") ."</p>";
+ $output .= "<p>". t("The cloud monitor tracks or crawls other interesting web sites and displays their latest modification dates. It acts as a link watcher such that you can keep an eye on the other sites in our cloud.") ."</p>";
}
else {
- $output .= "The cloud monitor tracks or crawls other interesting websites and displays their last modification dates. Visitors to the host site learn about relevant sites and can easily see if there is new content. Here is how it works:";
+ $output .= "The cloud monitor tracks or crawls other interesting web sites and displays their last modification dates. Visitors to the host site learn about relevant sites and can easily see if there is new content. Here is how it works:";
$output .= "<ul>";
$output .= " <li>The site administrator enters names and URLs of the relevant pages on the cloud monitor administration page.</li>";
- $output .= " <li>Drupal's cron function, triggers the cloud module to check all the registered websites for recent changes or updates. (A page is updated when there is a <i>x</i>-byte difference since the last time it checked, where <i>x</i> is a configuration option.)</li>";
+ $output .= " <li>Drupal's cron function, triggers the cloud module to check all the registered web sites for recent changes or updates. (A page is updated when there is a <i>x</i>-byte difference since the last time it checked, where <i>x</i> is a configuration option.)</li>";
$output .= " <li>The module exports both a page and a block that display the registered sites ordered by their last modification date.</li>";
$output .= "</ul>";
}
@@ -42,11 +42,12 @@ function cloud_link($type) {
}
if ($type == "admin" && user_access("administer site cloud")) {
- $help["general"] = "The cloud monitor tracks or crawls other interesting websites and displays their last modification dates. Visitors to the host site learn about relevant sites and can easily see if there is new content.";
+ $help["general"] = t("The cloud monitor tracks or crawls other interesting web sites and displays their last modification dates. Visitors to the host site learn about relevant sites and can easily see if there is new content. To get the blogroll to work you <b>must</b> setup cron support. To get the blogroll block to display you must turn on the <a href=\"%block\">Site cloud block</a>. To go to a monitored site, click on the site name, to load and/or update the blogroll for that site immediately click on \"update site\", to delete the site go to \"edit site\". ", array("%block" => url("admin/block")));
+ $help["add"] = t("Add a site too the blogroll. Don't forget the \"http://\" for your URLs.");
menu("admin/syndication", "content syndication", NULL, NULL, 5);
menu("admin/syndication/cloud", "blogrolling", "cloud_admin", $help["general"]);
- menu("admin/syndication/cloud/add", "add new site", "cloud_admin", $help["general"]);
+ menu("admin/syndication/cloud/add", "add new site", "cloud_admin", $help["add"]);
menu("admin/syndication/cloud/help", "help", "cloud_help", NULL, 9);
}
@@ -92,8 +93,8 @@ function cloud_form($edit = array()) {
$period = array(900 => format_interval(900), 1800 => format_interval(1800), 3600 => format_interval(3600), 7200 => format_interval(7200), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 64800 => format_interval(64800), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200));
$threshold = array(1 => "1 byte", 10 => "10 bytes", 20 => "20 bytes", 40 => "40 bytes", 60 => "60 bytes", 80 => "80 bytes", 100 => "100 bytes", 120 => "120 bytes", 140 => "140 bytes", 160 => "160 bytes", 320 => "320 bytes", 640 => "640 bytes");
- $form .= form_textfield("Site name", "name", $edit["name"], 50, 128, "The name of the website you want to monitor for updates.");
- $form .= form_textfield("Site URL", "link", $edit["link"], 50, 255, "The URL of the website you want to monitor for updates.");
+ $form .= form_textfield("Site name", "name", $edit["name"], 50, 128, "The name of the web site you want to monitor for updates.");
+ $form .= form_textfield("Site URL", "link", $edit["link"], 50, 255, "The URL of the web site you want to monitor for updates.");
$form .= form_textfield("URL to monitor", "feed", $edit["feed"], 50, 255, "The URL of the page you want to monitor for updates. Likely to be same as the site's URL but useful to monitor framed pages and more accurate when pointed to a XML/RSS/RDF feed.");
$form .= form_select("Update interval", "refresh", ($edit["refresh"] ? $edit["refresh"] : 3600), $period, "The refresh interval indicating how often you want to check this site for updates. Requires crontab.");
$form .= form_select("Change threshold", "threshold", ($edit["threshold"] ? $edit["threshold"] : 40), $threshold, "The number of bytes the site must have been modified before considered changed.");
diff --git a/modules/comment.module b/modules/comment.module
index e7412ee23..05ee522ac 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -5,18 +5,18 @@ $GLOBALS["cmodes"] = array(1 => t("Flat list - collapsed"), 2 => t("Flat list -
$GLOBALS["corder"] = array(1 => t("Date - newest first"), 2 => t("Date - oldest first"));
function comment_help() {
- $output .= "<p>The comment module enables users to submit posts that are directly associated with a piece of content. These associated posts are called <i>comments</i>. Comments may be <i>threaded</i>, which means that Drupal keeps track of multiple subconversations around a piece of content. Threading helps to keep the comment conversation more organized. Users are presented with several ways to view the comment conversation, and if desired, users may easily choose a <i>flat</i> presentation of comments instead of threaded. Further, users may choose to order their comments view by <i>newest first</i> or by <i>oldest first</i>. Finally, users may view a folded list or an expanded list of comments. Folded limits the comment display to <i>subject</i> only. Drupal remembers the comment view preference of each registered user whenever he changes a view setting.</p>";
- $output .= "<p>Users may also choose to view a maximum number of comments; if there are more comments, navigation links are dispayed.</p>";
- $output .= "<p>Since a busy site generates lots of comments, Drupal takes care to present a personalized view of comments for each user. The home page lists displays the number of read and unread comments for a given post for the current user. Also, the tracker module (when installed) displays all recent comments on the site. Finally, comments which the user has not yet read are highlighted with a red star (this graphic may depend on the current theme).</p>";
- $output .= "<p>Comments behave like other user submissions in Drupal. Specifically, ". l("filters", "admin/system/filters") ." like smileys and HTML work fine if the administrator has enabled them. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>";
- $output .= "<p>Administrators may control which persons are allowed to submit and administer comments. These controls appear in the ". l("user permissions", "admin/user/permission") ." administration page. Additionally, administrators may edit or search through comments on the ". l("comments admininistration page", "admin/comment") .", as well as set the default display view for new users. Administrators can also state whether a certain role will have their comments published immediately, or just put in a queue to be reviewed.</p>";
- $output .= "<p>If you really have a lot of comments, you can enable moderation. You assign moderation permissions to role(s), then setup some \"moderation votes\"; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, a value, which can be either positive or negative; use the moderation matrix to do this. This allows for some roles having greater \"weight\" in their moderation, if you wish. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Finally, you may want to setup the comment thresholds: these are floor/ceiling values which users see in the comment control panel. Thresholds are useful for hiding poorly rated comments while reading your site.</p>";
+- $output .= t("<p>The comment module enables users to submit posts that are directly associated with a piece of content, a node. These associated posts are called <i>comments</i>. Comments may be <i>threaded</i>, which means that Drupal keeps track of multiple subconversations around a piece of content. Threading helps to keep the comment conversation organized. Users are presented with several ways to view the comment conversation, and if desired, users may easily choose a <i>flat</i> presentation of comments instead of a threaded one. Further, users may choose to order their comments view by <i>newest comments first</i> or by <i>oldest comments first</i>. Finally, users may view a folded list, where only comment <i>subjects</i> are displayed, or an expanded list, where the whole comment is shown.</p>");
+- $output .= t("<p>Since a busy site generates lots of comments, Drupal takes care to present a personalized view of comments for each user. A user can setup how they want they comments displayed -- Threaded/Flat, Expanded/Folded -- and how many comments to display per page. If there are more comments than you have configured to display on a page, navigation links are displayed. The home page displays, for the current user, the number of read and unread comments for a given node. Also, the tracker module (when installed) displays all recent comments on the site. Finally, comments which the user has not yet read are highlighted with a red star (this graphic may depend on the current theme).</p>");
+- $output .= t("<p>Comments behave like other user submissions in Drupal. Specifically, if the administrator has enabled them, ". l("filters", "admin/system/filters") .", like smileys and HTML, work fine. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>");
+- $output .= t("<p>Administrators may control which roles are allowed to submit, submit without moderation, view and administer comments using the \"post comments\", \"post comments without approval\", \"access comments\", and \"administrate comments\" ". l("user permissions", "admin/user/permission") .". Additionally, administrators may set the default display view, edit or search through comments on the ". l("comments admininistration page", "admin/comment") .".</p>");
+- $output .= t("<p>If you really have a lot of comments, you can enable moderation. You assign ". l("moderation permissions", "admin/user/permission") ." to role(s), then setup some \"". l("moderation votes","admin/comment/moderation/votes") ."\"; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, ". l("a value", "admin/comment/moderation/matrix") .", which can be either positive or negative. This allows, if you wish, some roles to have greater \"weight\" in their moderation. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Next your have to setup the \"". l("Queue settings", "admin/system/modules/queue") ."\" to allow a moderated comment to either be posted or dumpped. Finally, you may want to setup the ". l("comment thresholds", "admin/comment/moderation/threshold") .": these are floor/ceiling values which users can set in the comment control panel. Thresholds are useful for hiding poorly rated comments from your users while they are reading.</p>");
return $output;
}
function comment_system($field) {
$system["description"] = t("Enables user to comment on content (nodes).");
+ $system["admin_help"] = t("Comments can be attached to any node. Below are the settings for comments. The display comes in two types, a \"flat list\" where everything is flush to the left side, and comments come in cronological order, and a \"threaded list\" where comments to other comments are placed immediately below the orignal, and slightly indented forming an outline of comments. They also come in two styles: \"expanded\", where you get to see both the title and the contents, and \"collapsed\" where you only see the titles. To set the default threshold you first have to set up thresholds in the <a href=\"%threshold\">comment management &gt;&gt; comment moderation &gt;&gt; thresholds</a> area. Preview comment forces a user to click on a \"Preview\" button so they can see what their comment will look like before they can actually add the comment to the system. If \"New comment form\" is enabled then at the bottom of every comment page there will be a form too add a new comment.", array("%threshold" => url("admin/comment/moderation/filters")));
return $system[$field];
}
@@ -652,22 +652,32 @@ function comment_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && user_access("administer comments")) {
- $help["general"] = t("Comments let users give feedback to content authors. Here you may review/approve/deny recent comments, and configure moderation if desired.");
-+ $help["settings"] = t("If you really have a lot of comments, you can enable moderation. You assign moderation permissions to role(s), then setup some 'moderation votes'; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, a value, which can be either positive or negative; use the moderation matrix to do this. This allows for some roles having greater 'weight' in their moderation, if you wish. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Finally, you may want to setup the comment thresholds: these are floor/ceiling values which users see in the comment control panel. Threshholds are useful for hiding poorly rated comments while reading your site.");
+ $help["general"] = t("Comments let users give feedback to content authors. Here you may review/approve/deny recent comments, and configure moderation if desired.");
+ $help["post-overview"] = t("Click on <a href=\"%nup\">new or updated comments</a> to see your latest comments, or <a href=\"%queue\">comment approval queue</a> to approve new comments.", array("%nup" => url("admin/comment/0"), "%queue" => url("admin/comment/1")));
+ $help["new-update"] = t("Below is a list of the latest comments posted your site. Click on a subject to see the comment, the author's name to edit the author's user information , \"edit comment\" to edit the comment, and \"delete comment\" to remove the comment.");
+ $help["queue"] = t("Below is a list of the comments posted to your site that need <b>approval</b>. To approve a comment click on <b>\"edit comment\"</b> and then change it's <b>moderation status</b> to Approved.<br />Click on a subject to see the comment, the author's name to edit the author's user information, \"edit comment\" to edit the comment, and \"delete comment\" to remove the comment.");
+ $help["moderation-overview"] = t("If you have a get a lot of comments, you can enable comment moderation. Once moderation is enabled users can vote on a comment based on dropdown menus. <a href=\"%votes\">votes</a> sets up the names of each item, and the order of the menu, using weights. <a href=\"%matrix\">matrix</a> sets up the value of each user's vote, and <a href=\"%threshold\">threshold</a> sets up the levels at which a comment will be displayed.", array("%votes" => url("admin/comment/moderation/votes"), "%matrix" => url("admin/comment/moderation/matrix"), "%threshold" => url("admin/comment/moderation/threshold")));
+ $help["moderation-vote"] = t("Here is where you setup the names of each type of vote. Weight lets you set the order of the drop down menu. Click <b>edit</b> to edit a current vote weight.<br />Notes: <ul><li>you can have more than one type with the same name. The system does not protect you from this.</li><li>To <b>delete</b> a name/weight combiniation go to the <b>edit</b> area.</li></ul>");
+ $help["moderation-matrix"] = t("Here is where you assign a value to each item in the dropdown. This value is added to the vote total, which is then divided by the number of users who have voted and rounded off to the nearest integer.<br />Notes:<ul><li>In order to use comment moderation, every text box on this page should be populated.</li><li>You must assign the <b>moderate comments</b> permission to at least one role in order to use this page.</li><li>Every box not filled in will have a value of zero, which will have the effect of <b>lowering</b> a comments over all score.</li></ul> ");
+ $help["moderation-threshold"] = t("<i>Optional</i> Here you can setup the name and minimum \"cut off\" score to help your users hide comments that they don't want too see. These thresholds appear in the Comment Control Panel. Click \"edit\" to edit the values of an already exsisting threashold. To <b>delete</b> a threshold click on \"edit\". ");
+ $help["initial"] = t("Here you can setup the <b>initial</b> vote value of a comment posted by each user role. This value is used before any other users vote on the comment.<br />Note: Blank entries are valued at zero");
+ $help["search"] = t("Enter a simple pattern ( '*' maybe used as a wildcard match) to search for a comment. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.");
menu("admin/comment", "comment management", "comment_admin", $help["general"], 2);
- menu("admin/comment/0", "new or updated comments", "comment_admin");
- menu("admin/comment/1", "comments that await approval", "comment_admin");
- menu("admin/comment/search", "search comments", "comment_admin", NULL, 8);
+ menu("admin/comment/comments", "comment overview",NULL, $help["post-overview"], 2);
+ menu("admin/comment/comments/0", "new or updated comments", "comment_admin", $help["new-update"], 1);
+ menu("admin/comment/comments/1", "comment approval queue", "comment_admin", $help["queue"], 2);
+ menu("admin/comment/search", "search comments", "comment_admin", $help["search"], 8);
menu("admin/comment/help", "help", "comment_help", NULL, 9);
menu("admin/comment/edit", "edit comment", "comment_admin", NULL, 0, 1);
// comment settings:
if (user_access("administer moderation")) {
- menu("admin/comment/votes", "comment moderation votes", "comment_admin", $help["settings"], 5);
- menu("admin/comment/matrix", "comment moderation matrix", "comment_admin", $help["settings"], 5);
- menu("admin/comment/filters", "comment moderation thresholds", "comment_admin", $help["settings"], 5);
- menu("admin/comment/roles", "initial comment scores", "comment_admin", $help["settings"], 5);
+ menu("admin/comment/moderation", "comment moderation", NULL, $help["moderation-overview"], 3);
+ menu("admin/comment/moderation/votes", "votes", "comment_admin", $help["moderation-vote"]);
+ menu("admin/comment/moderation/matrix", "matrix", "comment_admin", $help["moderation-matrix"]);
+ menu("admin/comment/moderation/filters", "thresholds", "comment_admin", $help["moderation-threshold"]);
+ menu("admin/comment/roles", "initial comment scores", "comment_admin", $help["initial"], 6);
}
}
@@ -814,14 +824,12 @@ function comment_admin_overview($status = 0) {
function comment_mod_matrix($edit) {
$output .= "<h3>Moderators/vote values matrix</h3>";
- $output .= "<p><small><b>Note:</b> you must assign the <b>moderate comments</b> permission to at least one role in order to use this page.</small></p>";
- $output .= "<p>In order to use comment moderation, every textbox on this page should be populated with an integer. On this page, you also might wish to value the votes from some users more than others. For example, administrator votes might count twice as much as authenticated users.</p>";
if ($edit) {
db_query("DELETE FROM moderation_roles");
foreach ($edit as $role_id => $votes) {
foreach ($votes as $mid => $value) {
- $sql[] = "('$mid', '$role_id', '$value')";
+ $sql[] = "('$mid', '$role_id', '". ($value ? $value : 0 ) ."')";
}
}
db_query("INSERT INTO moderation_roles (mid, rid, value) VALUES ". implode(", ", $sql));
@@ -857,7 +865,6 @@ function comment_mod_matrix($edit) {
function comment_mod_roles($edit) {
$output .= "<h3>Initial comment scores</h3>";
- $output .= "<p>Here is your opportunity to value comments from some users more than others. For example, administrator comments might count twice as much as authenticated users. Enter an integer into the <b>initial score</b> column.</p>";
if ($edit) {
variable_set("comment_roles", $edit);
@@ -882,7 +889,7 @@ function comment_mod_roles($edit) {
function comment_mod_votes($edit) {
$op = $_POST["op"];
- $mid = arg(3);
+ $mid = arg(4);
if ($op == t("Save vote")) {
db_query("UPDATE moderation_votes SET vote = '%s', weight = %d WHERE mid = %d", $edit["vote"], $edit["weight"], $mid);
@@ -894,7 +901,7 @@ function comment_mod_votes($edit) {
$mid = 0;
}
else if ($op == t("Add new vote")) {
- db_query("INSERT INTO moderation_votes (mid, vote, weight) VALUES (NULL, '%s', %d)", $edit["vote"], $edit["weight"]);
+ db_query("INSERT INTO moderation_votes (vote, weight) VALUES ('%s', %d)", $edit["vote"], $edit["weight"]);
$mid = 0;
}
@@ -903,7 +910,7 @@ function comment_mod_votes($edit) {
$result = db_query("SELECT mid, vote, weight FROM moderation_votes ORDER BY weight");
while ($vote = db_fetch_object($result)) {
- $rows[] = array($vote->vote, array("data" => $vote->weight, "align" => "center"), array("data" => l(t("edit"), "admin/comment/votes/$vote->mid"), "align" => "center"));
+ $rows[] = array($vote->vote, array("data" => $vote->weight, "align" => "center"), array("data" => l(t("edit"), "admin/comment/moderation/votes/$vote->mid"), "align" => "center"));
}
$output .= table($header, $rows);
@@ -911,7 +918,7 @@ function comment_mod_votes($edit) {
$vote = db_fetch_object(db_query("SELECT vote, weight FROM moderation_votes WHERE mid = %d", $mid));
}
- $output .= "<br /><h3>Add new moderation option</h3>";
+ $output .= "<br /><h3>". (isset($mid) ? "Edit" : "Add new") ."moderation option</h3>";
$form .= form_textfield(t("Vote"), "vote", $vote->vote, 32, 64, t("The name of this vote. Example: 'off topic', 'excellent', 'sucky'."));
$form .= form_textfield(t("Weight"), "weight", $vote->weight, 32, 64, t("Used to order votes in the comment control box; heavier sink."));
if ($mid) {
@@ -930,7 +937,7 @@ function comment_mod_votes($edit) {
function comment_mod_filters($edit) {
$op = $_POST["op"];
- $fid = arg(3);
+ $fid = arg(4);
if ($op == t("Save threshold")) {
db_query("UPDATE moderation_filters SET filter = '%s', minimum = %d WHERE fid = %d", $edit["filter"], $edit["minimum"], $fid);
@@ -941,18 +948,17 @@ function comment_mod_filters($edit) {
$fid = 0;
}
else if ($op == t("Add new threshold")) {
- db_query("INSERT INTO moderation_filters (fid, filter, minimum) VALUES (NULL, '%s', %d)", $edit["filter"], $edit["minimum"]);
+ db_query("INSERT INTO moderation_filters (filter, minimum) VALUES ('%s', %d)", $edit["filter"], $edit["minimum"]);
$fid = 0;
}
$output .= "<h3>Comment threshold overview</h3>";
- $output .= "<p><i>Optional</i>. If your site gets lots of comments, you may offer your users thresholds, which are used to hide all comments whose moderation score is lower than the threshold. This cuts down on clutter while your readers view the site. These thresholds appear in the Comment Control Panel.</p>";
$header = array(t("name"), t("minimum score"), t("operations"));
$result = db_query("SELECT fid, filter, minimum FROM moderation_filters ORDER BY minimum");
while ($filter = db_fetch_object($result)) {
- $rows[] = array($filter->filter, array("data" => $filter->minimum, "align" => "center"), array("data" => l(t("edit"), "admin/comment/filters/$filter->fid"), "align" => "center"));
+ $rows[] = array($filter->filter, array("data" => $filter->minimum, "align" => "center"), array("data" => l(t("edit"), "admin/comment/moderation/filters/$filter->fid"), "align" => "center"));
}
$output .= table($header, $rows);
@@ -960,9 +966,9 @@ function comment_mod_filters($edit) {
$filter = db_fetch_object(db_query("SELECT filter, fid, minimum FROM moderation_filters WHERE fid = %d", $fid));
}
- $output .= "<br /><h3>Add new threshold</h3>";
+ $output .= "<br /><h3>". (isset($fid) ? "Edit" : "Add new") ." threshold</h3>";
$form .= form_textfield(t("Threshhold name"), "filter", $filter->filter, 32, 64, t("The name of this threshold. Example: 'good comments', '+1 comments', 'everything'."));
- $form .= form_textfield(t("Minimum score"), "minimum", $filter->minimum, 32, 64, t("Show all comments whose score is larger or equal to the provided minimal score. Range: -127 + 128"));
+ $form .= form_textfield(t("Minimum score"), "minimum", $filter->minimum, 32, 64, t("Show all comments whose score is larger or equal to the provided minimal score. Range: -127 +128"));
if ($fid) {
$form .= form_submit(t("Save threshold"));
$form .= form_submit(t("Delete threshold"));
@@ -987,6 +993,10 @@ function comment_admin() {
$op = arg(2);
}
+ if ($op == t("moderation")) {
+ $op = arg(3);
+ }
+
if (user_access("administer comments")) {
switch ($op) {
case "edit":
@@ -1043,7 +1053,7 @@ function comment_admin() {
print comment_admin_overview(0);
break;
default:
- if (arg(2) == 1) {
+ if (arg(3) == 1) {
print comment_admin_overview(1);
}
else {
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index e7412ee23..05ee522ac 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -5,18 +5,18 @@ $GLOBALS["cmodes"] = array(1 => t("Flat list - collapsed"), 2 => t("Flat list -
$GLOBALS["corder"] = array(1 => t("Date - newest first"), 2 => t("Date - oldest first"));
function comment_help() {
- $output .= "<p>The comment module enables users to submit posts that are directly associated with a piece of content. These associated posts are called <i>comments</i>. Comments may be <i>threaded</i>, which means that Drupal keeps track of multiple subconversations around a piece of content. Threading helps to keep the comment conversation more organized. Users are presented with several ways to view the comment conversation, and if desired, users may easily choose a <i>flat</i> presentation of comments instead of threaded. Further, users may choose to order their comments view by <i>newest first</i> or by <i>oldest first</i>. Finally, users may view a folded list or an expanded list of comments. Folded limits the comment display to <i>subject</i> only. Drupal remembers the comment view preference of each registered user whenever he changes a view setting.</p>";
- $output .= "<p>Users may also choose to view a maximum number of comments; if there are more comments, navigation links are dispayed.</p>";
- $output .= "<p>Since a busy site generates lots of comments, Drupal takes care to present a personalized view of comments for each user. The home page lists displays the number of read and unread comments for a given post for the current user. Also, the tracker module (when installed) displays all recent comments on the site. Finally, comments which the user has not yet read are highlighted with a red star (this graphic may depend on the current theme).</p>";
- $output .= "<p>Comments behave like other user submissions in Drupal. Specifically, ". l("filters", "admin/system/filters") ." like smileys and HTML work fine if the administrator has enabled them. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>";
- $output .= "<p>Administrators may control which persons are allowed to submit and administer comments. These controls appear in the ". l("user permissions", "admin/user/permission") ." administration page. Additionally, administrators may edit or search through comments on the ". l("comments admininistration page", "admin/comment") .", as well as set the default display view for new users. Administrators can also state whether a certain role will have their comments published immediately, or just put in a queue to be reviewed.</p>";
- $output .= "<p>If you really have a lot of comments, you can enable moderation. You assign moderation permissions to role(s), then setup some \"moderation votes\"; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, a value, which can be either positive or negative; use the moderation matrix to do this. This allows for some roles having greater \"weight\" in their moderation, if you wish. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Finally, you may want to setup the comment thresholds: these are floor/ceiling values which users see in the comment control panel. Thresholds are useful for hiding poorly rated comments while reading your site.</p>";
+- $output .= t("<p>The comment module enables users to submit posts that are directly associated with a piece of content, a node. These associated posts are called <i>comments</i>. Comments may be <i>threaded</i>, which means that Drupal keeps track of multiple subconversations around a piece of content. Threading helps to keep the comment conversation organized. Users are presented with several ways to view the comment conversation, and if desired, users may easily choose a <i>flat</i> presentation of comments instead of a threaded one. Further, users may choose to order their comments view by <i>newest comments first</i> or by <i>oldest comments first</i>. Finally, users may view a folded list, where only comment <i>subjects</i> are displayed, or an expanded list, where the whole comment is shown.</p>");
+- $output .= t("<p>Since a busy site generates lots of comments, Drupal takes care to present a personalized view of comments for each user. A user can setup how they want they comments displayed -- Threaded/Flat, Expanded/Folded -- and how many comments to display per page. If there are more comments than you have configured to display on a page, navigation links are displayed. The home page displays, for the current user, the number of read and unread comments for a given node. Also, the tracker module (when installed) displays all recent comments on the site. Finally, comments which the user has not yet read are highlighted with a red star (this graphic may depend on the current theme).</p>");
+- $output .= t("<p>Comments behave like other user submissions in Drupal. Specifically, if the administrator has enabled them, ". l("filters", "admin/system/filters") .", like smileys and HTML, work fine. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>");
+- $output .= t("<p>Administrators may control which roles are allowed to submit, submit without moderation, view and administer comments using the \"post comments\", \"post comments without approval\", \"access comments\", and \"administrate comments\" ". l("user permissions", "admin/user/permission") .". Additionally, administrators may set the default display view, edit or search through comments on the ". l("comments admininistration page", "admin/comment") .".</p>");
+- $output .= t("<p>If you really have a lot of comments, you can enable moderation. You assign ". l("moderation permissions", "admin/user/permission") ." to role(s), then setup some \"". l("moderation votes","admin/comment/moderation/votes") ."\"; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, ". l("a value", "admin/comment/moderation/matrix") .", which can be either positive or negative. This allows, if you wish, some roles to have greater \"weight\" in their moderation. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Next your have to setup the \"". l("Queue settings", "admin/system/modules/queue") ."\" to allow a moderated comment to either be posted or dumpped. Finally, you may want to setup the ". l("comment thresholds", "admin/comment/moderation/threshold") .": these are floor/ceiling values which users can set in the comment control panel. Thresholds are useful for hiding poorly rated comments from your users while they are reading.</p>");
return $output;
}
function comment_system($field) {
$system["description"] = t("Enables user to comment on content (nodes).");
+ $system["admin_help"] = t("Comments can be attached to any node. Below are the settings for comments. The display comes in two types, a \"flat list\" where everything is flush to the left side, and comments come in cronological order, and a \"threaded list\" where comments to other comments are placed immediately below the orignal, and slightly indented forming an outline of comments. They also come in two styles: \"expanded\", where you get to see both the title and the contents, and \"collapsed\" where you only see the titles. To set the default threshold you first have to set up thresholds in the <a href=\"%threshold\">comment management &gt;&gt; comment moderation &gt;&gt; thresholds</a> area. Preview comment forces a user to click on a \"Preview\" button so they can see what their comment will look like before they can actually add the comment to the system. If \"New comment form\" is enabled then at the bottom of every comment page there will be a form too add a new comment.", array("%threshold" => url("admin/comment/moderation/filters")));
return $system[$field];
}
@@ -652,22 +652,32 @@ function comment_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && user_access("administer comments")) {
- $help["general"] = t("Comments let users give feedback to content authors. Here you may review/approve/deny recent comments, and configure moderation if desired.");
-+ $help["settings"] = t("If you really have a lot of comments, you can enable moderation. You assign moderation permissions to role(s), then setup some 'moderation votes'; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, a value, which can be either positive or negative; use the moderation matrix to do this. This allows for some roles having greater 'weight' in their moderation, if you wish. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Finally, you may want to setup the comment thresholds: these are floor/ceiling values which users see in the comment control panel. Threshholds are useful for hiding poorly rated comments while reading your site.");
+ $help["general"] = t("Comments let users give feedback to content authors. Here you may review/approve/deny recent comments, and configure moderation if desired.");
+ $help["post-overview"] = t("Click on <a href=\"%nup\">new or updated comments</a> to see your latest comments, or <a href=\"%queue\">comment approval queue</a> to approve new comments.", array("%nup" => url("admin/comment/0"), "%queue" => url("admin/comment/1")));
+ $help["new-update"] = t("Below is a list of the latest comments posted your site. Click on a subject to see the comment, the author's name to edit the author's user information , \"edit comment\" to edit the comment, and \"delete comment\" to remove the comment.");
+ $help["queue"] = t("Below is a list of the comments posted to your site that need <b>approval</b>. To approve a comment click on <b>\"edit comment\"</b> and then change it's <b>moderation status</b> to Approved.<br />Click on a subject to see the comment, the author's name to edit the author's user information, \"edit comment\" to edit the comment, and \"delete comment\" to remove the comment.");
+ $help["moderation-overview"] = t("If you have a get a lot of comments, you can enable comment moderation. Once moderation is enabled users can vote on a comment based on dropdown menus. <a href=\"%votes\">votes</a> sets up the names of each item, and the order of the menu, using weights. <a href=\"%matrix\">matrix</a> sets up the value of each user's vote, and <a href=\"%threshold\">threshold</a> sets up the levels at which a comment will be displayed.", array("%votes" => url("admin/comment/moderation/votes"), "%matrix" => url("admin/comment/moderation/matrix"), "%threshold" => url("admin/comment/moderation/threshold")));
+ $help["moderation-vote"] = t("Here is where you setup the names of each type of vote. Weight lets you set the order of the drop down menu. Click <b>edit</b> to edit a current vote weight.<br />Notes: <ul><li>you can have more than one type with the same name. The system does not protect you from this.</li><li>To <b>delete</b> a name/weight combiniation go to the <b>edit</b> area.</li></ul>");
+ $help["moderation-matrix"] = t("Here is where you assign a value to each item in the dropdown. This value is added to the vote total, which is then divided by the number of users who have voted and rounded off to the nearest integer.<br />Notes:<ul><li>In order to use comment moderation, every text box on this page should be populated.</li><li>You must assign the <b>moderate comments</b> permission to at least one role in order to use this page.</li><li>Every box not filled in will have a value of zero, which will have the effect of <b>lowering</b> a comments over all score.</li></ul> ");
+ $help["moderation-threshold"] = t("<i>Optional</i> Here you can setup the name and minimum \"cut off\" score to help your users hide comments that they don't want too see. These thresholds appear in the Comment Control Panel. Click \"edit\" to edit the values of an already exsisting threashold. To <b>delete</b> a threshold click on \"edit\". ");
+ $help["initial"] = t("Here you can setup the <b>initial</b> vote value of a comment posted by each user role. This value is used before any other users vote on the comment.<br />Note: Blank entries are valued at zero");
+ $help["search"] = t("Enter a simple pattern ( '*' maybe used as a wildcard match) to search for a comment. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.");
menu("admin/comment", "comment management", "comment_admin", $help["general"], 2);
- menu("admin/comment/0", "new or updated comments", "comment_admin");
- menu("admin/comment/1", "comments that await approval", "comment_admin");
- menu("admin/comment/search", "search comments", "comment_admin", NULL, 8);
+ menu("admin/comment/comments", "comment overview",NULL, $help["post-overview"], 2);
+ menu("admin/comment/comments/0", "new or updated comments", "comment_admin", $help["new-update"], 1);
+ menu("admin/comment/comments/1", "comment approval queue", "comment_admin", $help["queue"], 2);
+ menu("admin/comment/search", "search comments", "comment_admin", $help["search"], 8);
menu("admin/comment/help", "help", "comment_help", NULL, 9);
menu("admin/comment/edit", "edit comment", "comment_admin", NULL, 0, 1);
// comment settings:
if (user_access("administer moderation")) {
- menu("admin/comment/votes", "comment moderation votes", "comment_admin", $help["settings"], 5);
- menu("admin/comment/matrix", "comment moderation matrix", "comment_admin", $help["settings"], 5);
- menu("admin/comment/filters", "comment moderation thresholds", "comment_admin", $help["settings"], 5);
- menu("admin/comment/roles", "initial comment scores", "comment_admin", $help["settings"], 5);
+ menu("admin/comment/moderation", "comment moderation", NULL, $help["moderation-overview"], 3);
+ menu("admin/comment/moderation/votes", "votes", "comment_admin", $help["moderation-vote"]);
+ menu("admin/comment/moderation/matrix", "matrix", "comment_admin", $help["moderation-matrix"]);
+ menu("admin/comment/moderation/filters", "thresholds", "comment_admin", $help["moderation-threshold"]);
+ menu("admin/comment/roles", "initial comment scores", "comment_admin", $help["initial"], 6);
}
}
@@ -814,14 +824,12 @@ function comment_admin_overview($status = 0) {
function comment_mod_matrix($edit) {
$output .= "<h3>Moderators/vote values matrix</h3>";
- $output .= "<p><small><b>Note:</b> you must assign the <b>moderate comments</b> permission to at least one role in order to use this page.</small></p>";
- $output .= "<p>In order to use comment moderation, every textbox on this page should be populated with an integer. On this page, you also might wish to value the votes from some users more than others. For example, administrator votes might count twice as much as authenticated users.</p>";
if ($edit) {
db_query("DELETE FROM moderation_roles");
foreach ($edit as $role_id => $votes) {
foreach ($votes as $mid => $value) {
- $sql[] = "('$mid', '$role_id', '$value')";
+ $sql[] = "('$mid', '$role_id', '". ($value ? $value : 0 ) ."')";
}
}
db_query("INSERT INTO moderation_roles (mid, rid, value) VALUES ". implode(", ", $sql));
@@ -857,7 +865,6 @@ function comment_mod_matrix($edit) {
function comment_mod_roles($edit) {
$output .= "<h3>Initial comment scores</h3>";
- $output .= "<p>Here is your opportunity to value comments from some users more than others. For example, administrator comments might count twice as much as authenticated users. Enter an integer into the <b>initial score</b> column.</p>";
if ($edit) {
variable_set("comment_roles", $edit);
@@ -882,7 +889,7 @@ function comment_mod_roles($edit) {
function comment_mod_votes($edit) {
$op = $_POST["op"];
- $mid = arg(3);
+ $mid = arg(4);
if ($op == t("Save vote")) {
db_query("UPDATE moderation_votes SET vote = '%s', weight = %d WHERE mid = %d", $edit["vote"], $edit["weight"], $mid);
@@ -894,7 +901,7 @@ function comment_mod_votes($edit) {
$mid = 0;
}
else if ($op == t("Add new vote")) {
- db_query("INSERT INTO moderation_votes (mid, vote, weight) VALUES (NULL, '%s', %d)", $edit["vote"], $edit["weight"]);
+ db_query("INSERT INTO moderation_votes (vote, weight) VALUES ('%s', %d)", $edit["vote"], $edit["weight"]);
$mid = 0;
}
@@ -903,7 +910,7 @@ function comment_mod_votes($edit) {
$result = db_query("SELECT mid, vote, weight FROM moderation_votes ORDER BY weight");
while ($vote = db_fetch_object($result)) {
- $rows[] = array($vote->vote, array("data" => $vote->weight, "align" => "center"), array("data" => l(t("edit"), "admin/comment/votes/$vote->mid"), "align" => "center"));
+ $rows[] = array($vote->vote, array("data" => $vote->weight, "align" => "center"), array("data" => l(t("edit"), "admin/comment/moderation/votes/$vote->mid"), "align" => "center"));
}
$output .= table($header, $rows);
@@ -911,7 +918,7 @@ function comment_mod_votes($edit) {
$vote = db_fetch_object(db_query("SELECT vote, weight FROM moderation_votes WHERE mid = %d", $mid));
}
- $output .= "<br /><h3>Add new moderation option</h3>";
+ $output .= "<br /><h3>". (isset($mid) ? "Edit" : "Add new") ."moderation option</h3>";
$form .= form_textfield(t("Vote"), "vote", $vote->vote, 32, 64, t("The name of this vote. Example: 'off topic', 'excellent', 'sucky'."));
$form .= form_textfield(t("Weight"), "weight", $vote->weight, 32, 64, t("Used to order votes in the comment control box; heavier sink."));
if ($mid) {
@@ -930,7 +937,7 @@ function comment_mod_votes($edit) {
function comment_mod_filters($edit) {
$op = $_POST["op"];
- $fid = arg(3);
+ $fid = arg(4);
if ($op == t("Save threshold")) {
db_query("UPDATE moderation_filters SET filter = '%s', minimum = %d WHERE fid = %d", $edit["filter"], $edit["minimum"], $fid);
@@ -941,18 +948,17 @@ function comment_mod_filters($edit) {
$fid = 0;
}
else if ($op == t("Add new threshold")) {
- db_query("INSERT INTO moderation_filters (fid, filter, minimum) VALUES (NULL, '%s', %d)", $edit["filter"], $edit["minimum"]);
+ db_query("INSERT INTO moderation_filters (filter, minimum) VALUES ('%s', %d)", $edit["filter"], $edit["minimum"]);
$fid = 0;
}
$output .= "<h3>Comment threshold overview</h3>";
- $output .= "<p><i>Optional</i>. If your site gets lots of comments, you may offer your users thresholds, which are used to hide all comments whose moderation score is lower than the threshold. This cuts down on clutter while your readers view the site. These thresholds appear in the Comment Control Panel.</p>";
$header = array(t("name"), t("minimum score"), t("operations"));
$result = db_query("SELECT fid, filter, minimum FROM moderation_filters ORDER BY minimum");
while ($filter = db_fetch_object($result)) {
- $rows[] = array($filter->filter, array("data" => $filter->minimum, "align" => "center"), array("data" => l(t("edit"), "admin/comment/filters/$filter->fid"), "align" => "center"));
+ $rows[] = array($filter->filter, array("data" => $filter->minimum, "align" => "center"), array("data" => l(t("edit"), "admin/comment/moderation/filters/$filter->fid"), "align" => "center"));
}
$output .= table($header, $rows);
@@ -960,9 +966,9 @@ function comment_mod_filters($edit) {
$filter = db_fetch_object(db_query("SELECT filter, fid, minimum FROM moderation_filters WHERE fid = %d", $fid));
}
- $output .= "<br /><h3>Add new threshold</h3>";
+ $output .= "<br /><h3>". (isset($fid) ? "Edit" : "Add new") ." threshold</h3>";
$form .= form_textfield(t("Threshhold name"), "filter", $filter->filter, 32, 64, t("The name of this threshold. Example: 'good comments', '+1 comments', 'everything'."));
- $form .= form_textfield(t("Minimum score"), "minimum", $filter->minimum, 32, 64, t("Show all comments whose score is larger or equal to the provided minimal score. Range: -127 + 128"));
+ $form .= form_textfield(t("Minimum score"), "minimum", $filter->minimum, 32, 64, t("Show all comments whose score is larger or equal to the provided minimal score. Range: -127 +128"));
if ($fid) {
$form .= form_submit(t("Save threshold"));
$form .= form_submit(t("Delete threshold"));
@@ -987,6 +993,10 @@ function comment_admin() {
$op = arg(2);
}
+ if ($op == t("moderation")) {
+ $op = arg(3);
+ }
+
if (user_access("administer comments")) {
switch ($op) {
case "edit":
@@ -1043,7 +1053,7 @@ function comment_admin() {
print comment_admin_overview(0);
break;
default:
- if (arg(2) == 1) {
+ if (arg(3) == 1) {
print comment_admin_overview(1);
}
else {
diff --git a/modules/drupal.module b/modules/drupal.module
index 1489c321e..dfd84738b 100644
--- a/modules/drupal.module
+++ b/modules/drupal.module
@@ -2,27 +2,28 @@
// $Id$
function drupal_help_directory() {
- ?>
- <p>The "drupal" module features a capability whereby other drupal sites may <i>call home</i> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>
- <p>Currently, the main application of this feature is the <a href="http://www.drupal.org/node/view/3">Drupal sites page</a>. By default, fresh Drupal installations can use <a href="http://www.drupal.org/">drupal.org</a> as their <i>directory server</i> and report their existence. This reporting occurs via scheduled <a href="http://www.xmlrpc.com/">XML-RPC</a> pings.</p>
- <p>Drupal administrators should simply enable this feature to get listed on the <a href="http://www.drupal.org/node/view/3">Drupal sites page</a>; just set your site's name, e-mail address, slogan and mission statement. Then make sure that the field called <i>Drupal XML-RPC server</i> on the <i>site settings</i> tab of the <i>site configuration</i> page is set to http://www.drupal.org/xmlrpc.php. Also, make sure you enable this feature using the checkbox directly below.</p>
- <p>The listing of your site will occur shortly after your site's next ". l("cron run", "admin/system/help") .". Note that cron.php should be called using the domain name which you want to have listed at <a href="http://www.drupal.org/">drupal.org</a>. For example, don't kick off cron by requesting http://127.0.0.1/cron.php. Instead, use a publicly accessible domain name such as http:// www.mydomain.org/cron.php.</p>
- <p>Also note that your installation need not use drupal.org as its directory server. For example, this feature is perfectly capable of aggregating pings from all of your departmental drupal installations sites within an enterprise.</p>
- <?php
+
+ $output .= "<p>The \"Drupal\" module features a capability whereby other drupal sites may <i>call home</i> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>";
+ $output .= "<p>Currently, the main application of this feature is the <a href=\"http://www.drupal.org/node/view/3\">Drupal sites page</a>. By default, fresh Drupal installations can use <a href=\"http://www.drupal.org/\">drupal.org</a> as their <i>directory server</i> and report their existence. This reporting occurs via scheduled <a href=\"http://www.xmlrpc.com/\">XML-RPC</a> pings.</p>";
+ $output .= "<p>Drupal administrators should simply enable this feature to get listed on the <a href=\"http://www.drupal.org/node/view/3\">Drupal sites page</a>; just set your site's name, e-mail address, slogan and mission statement. Then make sure that the field called <i>Drupal XML-RPC server</i> on the <i>site settings</i> tab of the <i>site configuration</i> page is set to http://www.drupal.org/xmlrpc.php. Also, make sure you enable this feature using the checkbox directly below.</p>";
+ $output .= "<p>The listing of your site will occur shortly after your site's next ". l("cron run", "admin/system/help") .". Note that cron.php should be called using the domain name which you want to have listed at <a href=\"http://www.drupal.org/\">drupal.org</a>. For example, don't kick off cron by requesting http://127.0.0.1/cron.php. Instead, use a publicly accessible domain name such as http://www.mydomain.org/cron.php.</p>";
+ $output .= "<p>Also note that your installation need not use drupal.org as its directory server. For example, this feature is perfectly capable of aggregating pings from all of your departmental drupal installations sites within an enterprise.</p>";
+ return t($output);
}
function drupal_help() {
- drupal_help_directory();
+ return drupal_help_directory();
}
function drupal_system($field) {
$system["description"] = t("Lets users log in using a Drupal ID and can notify drupal.org about your site.");
+ $system["admin_help"] = t("Using this your Drupal site can \"call home\" and add itself to the Drupal directory. If you want it to add itself to a different directory server you can change the \"Drupal XML-RPC server\" setting -- but the directory server has to be able to handle Drupal XML. To get a full listing go to <a href=\"%general\">site configuration</a> and set:<ul><li>The site name,</li><li>Site E-Mail address,</li><li>Site slogan, and</li><li>The sire mission statement.</li></ul>",array("%general" => url("admin/system")));
return $system[$field];
}
function drupal_settings() {
$output .= form_textfield("Drupal XML-RPC server", "drupal_server", variable_get("drupal_server", "http://www.drupal.org/xmlrpc.php"), 55, 128, "The URL of your root Drupal XML-RPC server.");
- $output .= form_select("Drupal directory", "drupal_directory", variable_get("drupal_directory", 0), array("Disabled", "Enabled"), "If enabled, your Drupal site will make itself known to the Drupal directory at the specified Drupal XML-RPC server. For this to work properly, you have to set your site's name, e-mail address, slogan and mission statement. When the \"Drupal XML-RPC server\" field is set to \"http://www.drupal.org/xmlrpc.php\", your website will get listed on <a href=\"http://www.drupal.org/\">http://www.drupal.org/</a>. Requires crontab.");
+ $output .= form_select("Drupal directory", "drupal_directory", variable_get("drupal_directory", 0), array("Disabled", "Enabled"), "If enabled, your Drupal site will make itself known to the Drupal directory at the specified Drupal XML-RPC server. For this to work properly, you have to set your site's name, e-mail address, slogan and mission statement. When the \"Drupal XML-RPC server\" field is set to \"http://www.drupal.org/xmlrpc.php\", your web site will get listed on <a href=\"http://www.drupal.org/\">http://www.drupal.org/</a>. Requires crontab.");
return $output;
}
@@ -168,8 +169,8 @@ function drupal_login($arguments) {
function drupal_auth_help() {
$site = variable_get("site_name", "this web site");
- $output = "<p><a href=\"http://www.drupal.org\">Drupal</a> is the name of the software which powers %s. There are Drupal websites all over the world, and many of them share their registration databases so that users may freely login to any Drupal site using a single <b>Drupal ID</b>.</p>\n";
- $output .= "<p>So please feel free to login to your account here at %s with a username from another Drupal site. The format of a Drupal ID is similar to an email address: <b>username</b>@<i>server</i>. An example of valid Drupal ID is <b>mwlily</b><i>@www.drupal.org</i>.</p>";
+ $output = "<p><a href=\"http://www.drupal.org\">Drupal</a> is the name of the software which powers %s. There are Drupal web sites all over the world, and many of them share their registration databases so that users may freely login to any Drupal site using a single <b>Drupal ID</b>.</p>\n";
+ $output .= "<p>So please feel free to login to your account here at %s with a username from another Drupal site. The format of a Drupal ID is similar to an email address: <b>username</b>@<i>server</i>. An example of valid Drupal ID is <b>mwlily</b>@<i>www.drupal.org</i>.</p>";
return t($output, array("%s" => "<i>$site</i>"));
}
diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module
index 1489c321e..dfd84738b 100644
--- a/modules/drupal/drupal.module
+++ b/modules/drupal/drupal.module
@@ -2,27 +2,28 @@
// $Id$
function drupal_help_directory() {
- ?>
- <p>The "drupal" module features a capability whereby other drupal sites may <i>call home</i> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>
- <p>Currently, the main application of this feature is the <a href="http://www.drupal.org/node/view/3">Drupal sites page</a>. By default, fresh Drupal installations can use <a href="http://www.drupal.org/">drupal.org</a> as their <i>directory server</i> and report their existence. This reporting occurs via scheduled <a href="http://www.xmlrpc.com/">XML-RPC</a> pings.</p>
- <p>Drupal administrators should simply enable this feature to get listed on the <a href="http://www.drupal.org/node/view/3">Drupal sites page</a>; just set your site's name, e-mail address, slogan and mission statement. Then make sure that the field called <i>Drupal XML-RPC server</i> on the <i>site settings</i> tab of the <i>site configuration</i> page is set to http://www.drupal.org/xmlrpc.php. Also, make sure you enable this feature using the checkbox directly below.</p>
- <p>The listing of your site will occur shortly after your site's next ". l("cron run", "admin/system/help") .". Note that cron.php should be called using the domain name which you want to have listed at <a href="http://www.drupal.org/">drupal.org</a>. For example, don't kick off cron by requesting http://127.0.0.1/cron.php. Instead, use a publicly accessible domain name such as http:// www.mydomain.org/cron.php.</p>
- <p>Also note that your installation need not use drupal.org as its directory server. For example, this feature is perfectly capable of aggregating pings from all of your departmental drupal installations sites within an enterprise.</p>
- <?php
+
+ $output .= "<p>The \"Drupal\" module features a capability whereby other drupal sites may <i>call home</i> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>";
+ $output .= "<p>Currently, the main application of this feature is the <a href=\"http://www.drupal.org/node/view/3\">Drupal sites page</a>. By default, fresh Drupal installations can use <a href=\"http://www.drupal.org/\">drupal.org</a> as their <i>directory server</i> and report their existence. This reporting occurs via scheduled <a href=\"http://www.xmlrpc.com/\">XML-RPC</a> pings.</p>";
+ $output .= "<p>Drupal administrators should simply enable this feature to get listed on the <a href=\"http://www.drupal.org/node/view/3\">Drupal sites page</a>; just set your site's name, e-mail address, slogan and mission statement. Then make sure that the field called <i>Drupal XML-RPC server</i> on the <i>site settings</i> tab of the <i>site configuration</i> page is set to http://www.drupal.org/xmlrpc.php. Also, make sure you enable this feature using the checkbox directly below.</p>";
+ $output .= "<p>The listing of your site will occur shortly after your site's next ". l("cron run", "admin/system/help") .". Note that cron.php should be called using the domain name which you want to have listed at <a href=\"http://www.drupal.org/\">drupal.org</a>. For example, don't kick off cron by requesting http://127.0.0.1/cron.php. Instead, use a publicly accessible domain name such as http://www.mydomain.org/cron.php.</p>";
+ $output .= "<p>Also note that your installation need not use drupal.org as its directory server. For example, this feature is perfectly capable of aggregating pings from all of your departmental drupal installations sites within an enterprise.</p>";
+ return t($output);
}
function drupal_help() {
- drupal_help_directory();
+ return drupal_help_directory();
}
function drupal_system($field) {
$system["description"] = t("Lets users log in using a Drupal ID and can notify drupal.org about your site.");
+ $system["admin_help"] = t("Using this your Drupal site can \"call home\" and add itself to the Drupal directory. If you want it to add itself to a different directory server you can change the \"Drupal XML-RPC server\" setting -- but the directory server has to be able to handle Drupal XML. To get a full listing go to <a href=\"%general\">site configuration</a> and set:<ul><li>The site name,</li><li>Site E-Mail address,</li><li>Site slogan, and</li><li>The sire mission statement.</li></ul>",array("%general" => url("admin/system")));
return $system[$field];
}
function drupal_settings() {
$output .= form_textfield("Drupal XML-RPC server", "drupal_server", variable_get("drupal_server", "http://www.drupal.org/xmlrpc.php"), 55, 128, "The URL of your root Drupal XML-RPC server.");
- $output .= form_select("Drupal directory", "drupal_directory", variable_get("drupal_directory", 0), array("Disabled", "Enabled"), "If enabled, your Drupal site will make itself known to the Drupal directory at the specified Drupal XML-RPC server. For this to work properly, you have to set your site's name, e-mail address, slogan and mission statement. When the \"Drupal XML-RPC server\" field is set to \"http://www.drupal.org/xmlrpc.php\", your website will get listed on <a href=\"http://www.drupal.org/\">http://www.drupal.org/</a>. Requires crontab.");
+ $output .= form_select("Drupal directory", "drupal_directory", variable_get("drupal_directory", 0), array("Disabled", "Enabled"), "If enabled, your Drupal site will make itself known to the Drupal directory at the specified Drupal XML-RPC server. For this to work properly, you have to set your site's name, e-mail address, slogan and mission statement. When the \"Drupal XML-RPC server\" field is set to \"http://www.drupal.org/xmlrpc.php\", your web site will get listed on <a href=\"http://www.drupal.org/\">http://www.drupal.org/</a>. Requires crontab.");
return $output;
}
@@ -168,8 +169,8 @@ function drupal_login($arguments) {
function drupal_auth_help() {
$site = variable_get("site_name", "this web site");
- $output = "<p><a href=\"http://www.drupal.org\">Drupal</a> is the name of the software which powers %s. There are Drupal websites all over the world, and many of them share their registration databases so that users may freely login to any Drupal site using a single <b>Drupal ID</b>.</p>\n";
- $output .= "<p>So please feel free to login to your account here at %s with a username from another Drupal site. The format of a Drupal ID is similar to an email address: <b>username</b>@<i>server</i>. An example of valid Drupal ID is <b>mwlily</b><i>@www.drupal.org</i>.</p>";
+ $output = "<p><a href=\"http://www.drupal.org\">Drupal</a> is the name of the software which powers %s. There are Drupal web sites all over the world, and many of them share their registration databases so that users may freely login to any Drupal site using a single <b>Drupal ID</b>.</p>\n";
+ $output .= "<p>So please feel free to login to your account here at %s with a username from another Drupal site. The format of a Drupal ID is similar to an email address: <b>username</b>@<i>server</i>. An example of valid Drupal ID is <b>mwlily</b>@<i>www.drupal.org</i>.</p>";
return t($output, array("%s" => "<i>$site</i>"));
}
diff --git a/modules/forum.module b/modules/forum.module
index e5f2db09b..a1ea30a38 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -3,6 +3,7 @@
function forum_system($field){
$system["description"] = t("Enable threaded discussions about general topics.");
+ $system["admin_help"] = t("Forums are threaded discussions based on the taxonomy system so you must first define a <a href=\"%taxonomy-create\">taxonomy</a> of type \"forum\" to place the forum tree in. Then <a href=\"%taxonomy\">add terms</a> to this taxonomy. Each term becomes the name of a forum. If you define a term as a \"Container\" (See below) the term is not a forum itself, but rather holds forms. This lets you group your forums.", array("%taxonomy-create" => url("admin/taxonomy/add/vocabulary"), "%taxonomy" => url("admin/taxonomy")));
return $system[$field];
}
@@ -710,24 +711,15 @@ function _forum_get_topic_order($sortby) {
}
function forum_help() {
- ?>
- <h3>Creating a forum</h3>
- <p>Drupal lets you setup a countless number of forums by using the powerful taxonomy module. Therefore to create a forum you first have to create a taxonomy vocuabulary and add some terms to it, each term will be a forum. Creating a vocabulary is done by going the <b>taxonomy</b> page of the administration pages, then selecting the <b>add new vocabulary</b> link. Choose a name for the vocabulary (example: forum, message boards, or debates), and make sure under Types that forum is selected. Nothing else needs to be configured, so unless you have more advanced needs save the vocabulary. Now add a term to the vocabulary just added to create a forum. In the <b>add term</b> window enter the name of the forum (example: general, off topic, support), a description to make it clear to the users what the forum is about, and then save the term. You can now add a new forum by entering another term, repeat until all the forums are entered.</p>
- <p>Once a vocabulary is entered go to <b>site configuration</b> in the administration pages and set the <b>Forum vocabulary</b>, don't forget to save! There will now be forums active on the site. For users to access them the proper user permissions must be given in the <b>user management</b> pages.</p>
- <h3>Containers</h3>
- <p>By designating a forum as a Container, users are not allowed to post into that forum. The forum will be visible on the forum listing page, so it acts as a section delimiter if you will. This is useful if you have a lots of forums which are nested. For example,</p>
-<p> Marketing<br />
- -- Market research<br />
- -- Brand management<br />
- <br />
- Sales<br />
- -- Closing the deal<br />
- -- Avoiding ear and throat pain</p>
- <p>If you don't want people posting into the Marketing or Sales folders, you designate them as Containers.</p>
- <h4>Icons</h4>
- <p>To disable icons, set the icon paths as blank in Admin -> Site Configuration -> Forum</p>
- <p>All files in the icon directory are assumed to be images. Usually it is best to use GIF or JPG files as icons. You may use images of whatever size you wish, but it is customary to use 15x15 or 16x16.</p>
- <?php
+ $output .= "<h3>Creating a forum</h3><p>Drupal lets you set up a countless number of forums by using the powerful taxonomy module. Therefore to create a forum you first have to create a ". l("taxonomy vocuabulary", "admin/taxonomy/add/vocabulary") ." and ". l("add some terms", "admin/taxonomy") ." to it; each term will become a forum. Choose a name for the vocabulary (examples: forum, message boards, or debates), and make sure under \"Types\" that forum is selected. Nothing else needs to be configured, so unless you have more advanced needs save the vocabulary. Now ". l("add a term", "admin/taxonomy") ." to the vocabulary just created (examples: general, off topic, support), and a description to make it clear to the users what the forum is about. Each term become a forum. Continue creating fora by adding terms until you are satisfied.";
+ $output .= "<p>Once a vocabulary is entered go to ". l("site configuration &raquo; modules &raquo; forum","admin/system/modules/forum") ." and set the <b>Forum vocabulary</b> (don't forget to save). There will now be fora active on the site. For users to access them they must have the \"access content\" permission and to create a topic they must have \"create forum topics\" permission. The permissions can be set in the ". l("user management", "admin/user/permission") ." pages.</p>";
+ $output .= "<h3>Containers</h3><p>By designating a forum as a <i>container</i>, users are not allowed to post into that forum. The forum will be visible on the forum listing page, so it acts as a section delimiter if you will. This is useful if you have a lots of forums which are nested. For example,</p>";
+ $output .= "<p>Marketing<br />-- Market research<br />-- Brand management<br /><br />Sales<br />-- Closing the deal<br />-- Avoiding ear and throat pain</p>";
+ $output .= "<p>If you don't want people posting into the Marketing or Sales folders, you designate them as Containers.</p>";
+ $output .= "<h4>Icons</h4><p>To disable icons, set the icon path as blank in ". l("site configuration &raquo; modules &raquo; forums","admin/system/module/forum") ."</p>";
+ $output .= "<p>All files in the icon directory are assumed to be images. You may use images of whatever size you wish, but it is customary to use 15x15 or 16x16.</p>";
+ return t($output);
+
}
?>
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index e5f2db09b..a1ea30a38 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -3,6 +3,7 @@
function forum_system($field){
$system["description"] = t("Enable threaded discussions about general topics.");
+ $system["admin_help"] = t("Forums are threaded discussions based on the taxonomy system so you must first define a <a href=\"%taxonomy-create\">taxonomy</a> of type \"forum\" to place the forum tree in. Then <a href=\"%taxonomy\">add terms</a> to this taxonomy. Each term becomes the name of a forum. If you define a term as a \"Container\" (See below) the term is not a forum itself, but rather holds forms. This lets you group your forums.", array("%taxonomy-create" => url("admin/taxonomy/add/vocabulary"), "%taxonomy" => url("admin/taxonomy")));
return $system[$field];
}
@@ -710,24 +711,15 @@ function _forum_get_topic_order($sortby) {
}
function forum_help() {
- ?>
- <h3>Creating a forum</h3>
- <p>Drupal lets you setup a countless number of forums by using the powerful taxonomy module. Therefore to create a forum you first have to create a taxonomy vocuabulary and add some terms to it, each term will be a forum. Creating a vocabulary is done by going the <b>taxonomy</b> page of the administration pages, then selecting the <b>add new vocabulary</b> link. Choose a name for the vocabulary (example: forum, message boards, or debates), and make sure under Types that forum is selected. Nothing else needs to be configured, so unless you have more advanced needs save the vocabulary. Now add a term to the vocabulary just added to create a forum. In the <b>add term</b> window enter the name of the forum (example: general, off topic, support), a description to make it clear to the users what the forum is about, and then save the term. You can now add a new forum by entering another term, repeat until all the forums are entered.</p>
- <p>Once a vocabulary is entered go to <b>site configuration</b> in the administration pages and set the <b>Forum vocabulary</b>, don't forget to save! There will now be forums active on the site. For users to access them the proper user permissions must be given in the <b>user management</b> pages.</p>
- <h3>Containers</h3>
- <p>By designating a forum as a Container, users are not allowed to post into that forum. The forum will be visible on the forum listing page, so it acts as a section delimiter if you will. This is useful if you have a lots of forums which are nested. For example,</p>
-<p> Marketing<br />
- -- Market research<br />
- -- Brand management<br />
- <br />
- Sales<br />
- -- Closing the deal<br />
- -- Avoiding ear and throat pain</p>
- <p>If you don't want people posting into the Marketing or Sales folders, you designate them as Containers.</p>
- <h4>Icons</h4>
- <p>To disable icons, set the icon paths as blank in Admin -> Site Configuration -> Forum</p>
- <p>All files in the icon directory are assumed to be images. Usually it is best to use GIF or JPG files as icons. You may use images of whatever size you wish, but it is customary to use 15x15 or 16x16.</p>
- <?php
+ $output .= "<h3>Creating a forum</h3><p>Drupal lets you set up a countless number of forums by using the powerful taxonomy module. Therefore to create a forum you first have to create a ". l("taxonomy vocuabulary", "admin/taxonomy/add/vocabulary") ." and ". l("add some terms", "admin/taxonomy") ." to it; each term will become a forum. Choose a name for the vocabulary (examples: forum, message boards, or debates), and make sure under \"Types\" that forum is selected. Nothing else needs to be configured, so unless you have more advanced needs save the vocabulary. Now ". l("add a term", "admin/taxonomy") ." to the vocabulary just created (examples: general, off topic, support), and a description to make it clear to the users what the forum is about. Each term become a forum. Continue creating fora by adding terms until you are satisfied.";
+ $output .= "<p>Once a vocabulary is entered go to ". l("site configuration &raquo; modules &raquo; forum","admin/system/modules/forum") ." and set the <b>Forum vocabulary</b> (don't forget to save). There will now be fora active on the site. For users to access them they must have the \"access content\" permission and to create a topic they must have \"create forum topics\" permission. The permissions can be set in the ". l("user management", "admin/user/permission") ." pages.</p>";
+ $output .= "<h3>Containers</h3><p>By designating a forum as a <i>container</i>, users are not allowed to post into that forum. The forum will be visible on the forum listing page, so it acts as a section delimiter if you will. This is useful if you have a lots of forums which are nested. For example,</p>";
+ $output .= "<p>Marketing<br />-- Market research<br />-- Brand management<br /><br />Sales<br />-- Closing the deal<br />-- Avoiding ear and throat pain</p>";
+ $output .= "<p>If you don't want people posting into the Marketing or Sales folders, you designate them as Containers.</p>";
+ $output .= "<h4>Icons</h4><p>To disable icons, set the icon path as blank in ". l("site configuration &raquo; modules &raquo; forums","admin/system/module/forum") ."</p>";
+ $output .= "<p>All files in the icon directory are assumed to be images. You may use images of whatever size you wish, but it is customary to use 15x15 or 16x16.</p>";
+ return t($output);
+
}
?>
diff --git a/modules/import.module b/modules/import.module
index b5ed8f92b..ed70162b4 100644
--- a/modules/import.module
+++ b/modules/import.module
@@ -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());
diff --git a/modules/jabber.module b/modules/jabber.module
index d80435a2c..7e2117def 100644
--- a/modules/jabber.module
+++ b/modules/jabber.module
@@ -155,9 +155,8 @@ function jabber_page() {
function jabber_auth_help() {
$site = variable_get("site_name", "this web site");
- $output = "
- <p><a href=\"http://www.jabber.org/\">Jabber</a> is an <a href=\"http://www.opensource.org\">open source</a> instant messaging system designed to give the power of choice and freedom back to the users of instant messaging. Not only does Jabber allow its users to use (and create) clients for numerous platforms, but it allows people to communicate to whomever they want in the way which is most convenient for them.</p>
- <p>You may login to %s using a <b>Jabber ID</b>. The format of a Jabber ID is the same as an email address: <b>name</b><i>@server</i> An example of valid Jabber ID is <b>mwlily</b><i>@jabber.com</i>. Note that you must be able to access port 111 on the Jabber server from your web server. For example, sourceforge.net does not allow that such that Jabber authentication does not work.</p>";
+ $output = "<p><a href=\"http://www.jabber.org/\">Jabber</a> is an <a href=\"http://www.opensource.org\">open source</a> instant messaging system designed to give the power of choice and freedom back to the users of instant messaging. Not only does Jabber allow its users to use (and create) clients for numerous platforms, but it allows people to communicate to whomever they want in the way which is most convenient for them.</p>";
+ $output .= "<p>You may login to %s using a <b>Jabber ID</b>. The format of a Jabber ID is the same as an email address: <b>name</b>@<i>server</i> An example of valid Jabber ID is <b>mwlily</b>@<i>jabber.com</i>. Note that you must be able to access port 111 on the Jabber server from your web server. For example, sourceforge.net blocks port 111 so Jabber authentication does not work.</p>";
return t($output, array("%s" => "<i>$site</i>"));
}
diff --git a/modules/locale.module b/modules/locale.module
index 41197e51e..29e0c74f5 100644
--- a/modules/locale.module
+++ b/modules/locale.module
@@ -2,37 +2,31 @@
// $Id$
function locale_help() {
- ?>
- <p>Normally programs are written and documented in English, and use English to interact with users. This is true for a great deal of websites. However, most people are less comfortable with English than with their own native language, and would prefer to use their mother tongue as much as possible. Many people love see their website showing a lot less of English, and far more of their own language.</p>
- <p>Therefore Drupal provides a framework to setup a multi-lingual website, or to overwrite the default texts in English. We explored the various alternatives to support internationalization and decided to design the framework in such a way that the impact of internationalization on drupal's sources is minimized, modular and that it doesn't require a HTML or PHP wizard to maintain translations. Maintaining translations had to be simple so it became as easy as filling out forms on the administration page.</p>
-
- <h3>How to translate texts</h3>
-
- <p>The actual translation starts at the "overview" of the locale page of the administration pages. To allow a user to maintain the translations, he obviously needs access to the locale module. See the account documentation for more information on roles and permissions.</p>
- <p>At the locale page, users with the proper access rights will see the various texts that need translation on the left column of the table.</p>
- <p>Below the text you can see an URI where this text shows up one your site. Changes are most of these texts will be used and displayed on more than one page, though only one example URI is presented.</p>
- <p>The second column displays the supported languages as defined in the configuration file. See below for more information on how to support new languages. If the symbol for a language is seen like <strike>this</strike>, it means that this entry still needs to be translated into that language. If not, it has been translated already.</p>
- <p>To add or change a translation click the "edit locale" link in the third column, the "operations" column. You'll be presented the original text and fields for translation in the supported languages. Enter the translations and confirm by clicking the "Save translations" button. The translations need not be accurate; they are for your site so you can choose what to show to your users.</p>
- <p>To delete a translation, click the "delete locale" link at the overview page and the translation will be immediately deleted without confirmation. Deleting translations is convenient for removing texts that belonged to an obsolete module.</p>
- <p>In some texts special strings such as "%a" and "%b" show up. Those get replaced by some string at run-time when Drupal dynamically generate pages. You can find out which string this is by looking at the page where the text appears. This is where the above mentioned URI can come in handy.</p>
-
- <h3>How to add new languages</h3>
-
- <p>Adding a new language requires you to edit your configuration file and to edit your SQL database. Assuming you want to support Dutch (ISO 639 code: "nl") and French (ISO 639 code: "fr"), you add the following line to your configuration file's <code>$languages</code>-variable:</p>
- <pre>
- $languages = array("nl" => "Dutch / Nederlands", "fr" => "French / Francais");
- </pre>
- <p>Note that the default language must come first and that if you want to overwrite the default text you can add an entry for English (ISO 639 code: "en"):</p>
- <pre>
- $languages = array("en" => "English", "nl" => "Dutch / Nederlands", "fr" => "French / Francais");
- </pre>
- <p>After having edited your configuration file, make sure your SQL table "locales" has the required database fields setup to host your new translations. You can add the required rows to your "locales" table from the MySQL prompt:</p>
- <pre>
+ $output .= "<p>Normally programs are written and documented in English, and use English to interact with users. This is true for a great deal of web sites. However, most people are less comfortable with English than with their own native language, and would prefer to use their mother tongue as much as possible. Many people love see their web site showing a lot less of English, and far more of their own language.</p>";
+ $output .= "<p>Therefore Drupal provides a framework to setup a multi-lingual web site, or to overwrite the default texts in English. We explored the various alternatives to support internationalization and decided to design the framework in such a way that the impact of internationalization on drupal's sources is minimized, modular and that it doesn't require a HTML or PHP wizard to maintain translations. Maintaining translations had to be simple so it became as easy as filling out forms on the administration page.</p>";
+ $output .= "<h3>How to translate texts</h3><p>The actual translation starts at the ". l("overview","admin/locale") ." of the locale section of the administration pages. In the \"localization\" section you will see a list of the languages you have configured. Click on the name of the language to start translating. Looking at a page full of all the strings in the site can be a bit overwhelming, so Drupal allows you to limit the strings you are working on. If you want to limit based on translated strings click \"translated strings\", if you want to limit the string based on the untranslated strings click \"untranslated strings\". Both will take you to the same page. Once there enter the string pattern to limit on, choose the language to search for, and the status, weather translated, untranslated or both, finally where you want to look, modules, specific modules, or pages.</p>";
+ $output .= "<p>At the locale page, users with the proper access rights will see the various texts that need translation on the left column of the table.</p>";
+ $output .= "<p>Below the text you can see an URI where this text shows up one your site. Changes are most of these texts will be used and displayed on more than one page, though only one example URI is presented.</p>";
+ $output .= "<p>The second column displays the supported languages as defined in the configuration file. See below for more information on how to support new languages. If the symbol for a language is seen like <strike>this</strike>, it means that this entry still needs to be translated into that language. If not, it has been translated already.</p>";
+ $output .= "<p>To add or change a translation click the \"edit locale\" link in the third column, the \"operations\" column. You'll be presented the original text and fields for translation in the supported languages. Enter the translations and confirm by clicking the \"Save translations\" button. The translations need not be accurate; they are for your site so you can choose what to show to your users.</p>";
+ $output .= "<p>To delete a translation, click the \"delete locale\" link at the overview page and the translation will be immediately deleted without confirmation. Deleting translations is convenient for removing texts that belonged to an obsolete module.</p>";
+ $output .= "<p>In some texts special strings such as \"%a\" and \"%b\" show up. Those get replaced by some string at run-time when Drupal dynamically generate pages. You can find out which string this is by looking at the page where the text appears. This is where the above mentioned URI can come in handy.</p>";
+ $output .= "<h3>How to add new languages</h3><p>Adding a new language requires you to edit your configuration file and to edit your SQL database. Assuming you want to support Dutch (ISO 639 code: \"nl\") and French (ISO 639 code: \"fr\"), you add the following line to your configuration file's <code>\$languages</code>-variable:</p>";
+ $output .= "<pre>
+ \$languages = array(\"nl\" => \"Dutch / Nederlands\", \"fr\" => \"French / Francais\");
+ </pre>";
+
+ $output .= "<p>Note that the default language must come first and that if you want to overwrite the default text you can add an entry for English (ISO 639 code: \"en\"):</p>";
+ $output .= "<pre>
+ \$languages = array(\"en\" => \"English\", \"nl\" => \"Dutch / Nederlands\", \"fr\" => \"French / Francais\");
+ </pre>";
+ $output .= "<p>After having edited your configuration file, make sure your SQL table \"locales\" has the required database fields setup to host your new translations. You can add the required rows to your \"locales\" table from the MySQL prompt:</p>";
+ $output .= "<pre>
mysql> ALTER TABLE locales ADD en TEXT DEFAULT '' NOT NULL;
mysql> ALTER TABLE locales ADD nl TEXT DEFAULT '' NOT NULL;
mysql> ALTER TABLE locales ADD fr TEXT DEFAULT '' NOT NULL;
- </pre>
- <?php
+ </pre>";
+ return t($output);
}
function locale_system($field){
@@ -48,18 +42,21 @@ function locale_link($type) {
global $languages;
if ($type == "admin" && user_access("administer locales")) {
- $help["general"] = "The locale module handles translations into new languages. It also enables you to add jargon, slang or other special language as fits the website. For each language you want to support, a line needs to be added to your configuration file.";
+ $help["general"] = t("The locale module handles translations into new languages. It also enables you to add jargon, slang or other special language as fits the web site. For each language you want to support, a line needs to be added to your configuration file.");
+ $help["search"] = t("Search the localization database. ('*' can be used as a wildcard)");
+ $help["translated"] = t("Start by searching the translated strings.");
+ $help["untranslated"] = t("Start by searching the untranslated strings.");
menu("admin/locale", "localization", NULL, $help["general"], 5);
- menu("admin/locale/search", "search string", "locale_admin", NULL, 8);
+ menu("admin/locale/search", "search string", "locale_admin", $help["search"], 8);
menu("admin/locale/help", "help", "locale_help", NULL, 9);
menu("admin/locale/edit", "edit string", "locale_admin", NULL, 0, 1); // hidden menu
menu("admin/locale/delete", "delete string", "locale_admin", NULL, 0, 1); // hidden menu
foreach ($languages as $key => $value) {
menu("admin/locale/$key", "$value", NULL, $help["general"]);
- menu("admin/locale/$key/translated", "translated strings", "locale_admin");
- menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin");
+ menu("admin/locale/$key/translated", "translated strings", "locale_admin", $help["translated"]);
+ menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin", $help["untranslated"]);
}
}
}
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 41197e51e..29e0c74f5 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -2,37 +2,31 @@
// $Id$
function locale_help() {
- ?>
- <p>Normally programs are written and documented in English, and use English to interact with users. This is true for a great deal of websites. However, most people are less comfortable with English than with their own native language, and would prefer to use their mother tongue as much as possible. Many people love see their website showing a lot less of English, and far more of their own language.</p>
- <p>Therefore Drupal provides a framework to setup a multi-lingual website, or to overwrite the default texts in English. We explored the various alternatives to support internationalization and decided to design the framework in such a way that the impact of internationalization on drupal's sources is minimized, modular and that it doesn't require a HTML or PHP wizard to maintain translations. Maintaining translations had to be simple so it became as easy as filling out forms on the administration page.</p>
-
- <h3>How to translate texts</h3>
-
- <p>The actual translation starts at the "overview" of the locale page of the administration pages. To allow a user to maintain the translations, he obviously needs access to the locale module. See the account documentation for more information on roles and permissions.</p>
- <p>At the locale page, users with the proper access rights will see the various texts that need translation on the left column of the table.</p>
- <p>Below the text you can see an URI where this text shows up one your site. Changes are most of these texts will be used and displayed on more than one page, though only one example URI is presented.</p>
- <p>The second column displays the supported languages as defined in the configuration file. See below for more information on how to support new languages. If the symbol for a language is seen like <strike>this</strike>, it means that this entry still needs to be translated into that language. If not, it has been translated already.</p>
- <p>To add or change a translation click the "edit locale" link in the third column, the "operations" column. You'll be presented the original text and fields for translation in the supported languages. Enter the translations and confirm by clicking the "Save translations" button. The translations need not be accurate; they are for your site so you can choose what to show to your users.</p>
- <p>To delete a translation, click the "delete locale" link at the overview page and the translation will be immediately deleted without confirmation. Deleting translations is convenient for removing texts that belonged to an obsolete module.</p>
- <p>In some texts special strings such as "%a" and "%b" show up. Those get replaced by some string at run-time when Drupal dynamically generate pages. You can find out which string this is by looking at the page where the text appears. This is where the above mentioned URI can come in handy.</p>
-
- <h3>How to add new languages</h3>
-
- <p>Adding a new language requires you to edit your configuration file and to edit your SQL database. Assuming you want to support Dutch (ISO 639 code: "nl") and French (ISO 639 code: "fr"), you add the following line to your configuration file's <code>$languages</code>-variable:</p>
- <pre>
- $languages = array("nl" => "Dutch / Nederlands", "fr" => "French / Francais");
- </pre>
- <p>Note that the default language must come first and that if you want to overwrite the default text you can add an entry for English (ISO 639 code: "en"):</p>
- <pre>
- $languages = array("en" => "English", "nl" => "Dutch / Nederlands", "fr" => "French / Francais");
- </pre>
- <p>After having edited your configuration file, make sure your SQL table "locales" has the required database fields setup to host your new translations. You can add the required rows to your "locales" table from the MySQL prompt:</p>
- <pre>
+ $output .= "<p>Normally programs are written and documented in English, and use English to interact with users. This is true for a great deal of web sites. However, most people are less comfortable with English than with their own native language, and would prefer to use their mother tongue as much as possible. Many people love see their web site showing a lot less of English, and far more of their own language.</p>";
+ $output .= "<p>Therefore Drupal provides a framework to setup a multi-lingual web site, or to overwrite the default texts in English. We explored the various alternatives to support internationalization and decided to design the framework in such a way that the impact of internationalization on drupal's sources is minimized, modular and that it doesn't require a HTML or PHP wizard to maintain translations. Maintaining translations had to be simple so it became as easy as filling out forms on the administration page.</p>";
+ $output .= "<h3>How to translate texts</h3><p>The actual translation starts at the ". l("overview","admin/locale") ." of the locale section of the administration pages. In the \"localization\" section you will see a list of the languages you have configured. Click on the name of the language to start translating. Looking at a page full of all the strings in the site can be a bit overwhelming, so Drupal allows you to limit the strings you are working on. If you want to limit based on translated strings click \"translated strings\", if you want to limit the string based on the untranslated strings click \"untranslated strings\". Both will take you to the same page. Once there enter the string pattern to limit on, choose the language to search for, and the status, weather translated, untranslated or both, finally where you want to look, modules, specific modules, or pages.</p>";
+ $output .= "<p>At the locale page, users with the proper access rights will see the various texts that need translation on the left column of the table.</p>";
+ $output .= "<p>Below the text you can see an URI where this text shows up one your site. Changes are most of these texts will be used and displayed on more than one page, though only one example URI is presented.</p>";
+ $output .= "<p>The second column displays the supported languages as defined in the configuration file. See below for more information on how to support new languages. If the symbol for a language is seen like <strike>this</strike>, it means that this entry still needs to be translated into that language. If not, it has been translated already.</p>";
+ $output .= "<p>To add or change a translation click the \"edit locale\" link in the third column, the \"operations\" column. You'll be presented the original text and fields for translation in the supported languages. Enter the translations and confirm by clicking the \"Save translations\" button. The translations need not be accurate; they are for your site so you can choose what to show to your users.</p>";
+ $output .= "<p>To delete a translation, click the \"delete locale\" link at the overview page and the translation will be immediately deleted without confirmation. Deleting translations is convenient for removing texts that belonged to an obsolete module.</p>";
+ $output .= "<p>In some texts special strings such as \"%a\" and \"%b\" show up. Those get replaced by some string at run-time when Drupal dynamically generate pages. You can find out which string this is by looking at the page where the text appears. This is where the above mentioned URI can come in handy.</p>";
+ $output .= "<h3>How to add new languages</h3><p>Adding a new language requires you to edit your configuration file and to edit your SQL database. Assuming you want to support Dutch (ISO 639 code: \"nl\") and French (ISO 639 code: \"fr\"), you add the following line to your configuration file's <code>\$languages</code>-variable:</p>";
+ $output .= "<pre>
+ \$languages = array(\"nl\" => \"Dutch / Nederlands\", \"fr\" => \"French / Francais\");
+ </pre>";
+
+ $output .= "<p>Note that the default language must come first and that if you want to overwrite the default text you can add an entry for English (ISO 639 code: \"en\"):</p>";
+ $output .= "<pre>
+ \$languages = array(\"en\" => \"English\", \"nl\" => \"Dutch / Nederlands\", \"fr\" => \"French / Francais\");
+ </pre>";
+ $output .= "<p>After having edited your configuration file, make sure your SQL table \"locales\" has the required database fields setup to host your new translations. You can add the required rows to your \"locales\" table from the MySQL prompt:</p>";
+ $output .= "<pre>
mysql> ALTER TABLE locales ADD en TEXT DEFAULT '' NOT NULL;
mysql> ALTER TABLE locales ADD nl TEXT DEFAULT '' NOT NULL;
mysql> ALTER TABLE locales ADD fr TEXT DEFAULT '' NOT NULL;
- </pre>
- <?php
+ </pre>";
+ return t($output);
}
function locale_system($field){
@@ -48,18 +42,21 @@ function locale_link($type) {
global $languages;
if ($type == "admin" && user_access("administer locales")) {
- $help["general"] = "The locale module handles translations into new languages. It also enables you to add jargon, slang or other special language as fits the website. For each language you want to support, a line needs to be added to your configuration file.";
+ $help["general"] = t("The locale module handles translations into new languages. It also enables you to add jargon, slang or other special language as fits the web site. For each language you want to support, a line needs to be added to your configuration file.");
+ $help["search"] = t("Search the localization database. ('*' can be used as a wildcard)");
+ $help["translated"] = t("Start by searching the translated strings.");
+ $help["untranslated"] = t("Start by searching the untranslated strings.");
menu("admin/locale", "localization", NULL, $help["general"], 5);
- menu("admin/locale/search", "search string", "locale_admin", NULL, 8);
+ menu("admin/locale/search", "search string", "locale_admin", $help["search"], 8);
menu("admin/locale/help", "help", "locale_help", NULL, 9);
menu("admin/locale/edit", "edit string", "locale_admin", NULL, 0, 1); // hidden menu
menu("admin/locale/delete", "delete string", "locale_admin", NULL, 0, 1); // hidden menu
foreach ($languages as $key => $value) {
menu("admin/locale/$key", "$value", NULL, $help["general"]);
- menu("admin/locale/$key/translated", "translated strings", "locale_admin");
- menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin");
+ menu("admin/locale/$key/translated", "translated strings", "locale_admin", $help["translated"]);
+ menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin", $help["untranslated"]);
}
}
}
diff --git a/modules/node.module b/modules/node.module
index b01c05324..1c927e753 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -4,18 +4,29 @@
function node_help() {
global $mod;
- if ($mod == "node") {
+ $output .= "<h3>Nodes</h3>The core of the Drupal system is the node. All of the contents of the system are placed in nodes, or extensions of nodes.";
+ $output .= "A base node contains:<ul><li>A Title - Up to 128 characters of text that titles the node.</li><li>A Teaser - A small block of text that is ment to get you interested in the rest of node. Drupal automatically pulls a small amount of the body of the node to make the teaser (To configure how long the teaser will be ". l("click here","admin/system/modules/node") ."). The teaser can be changed if you don't like what Drupal grabs</li><li>The Body - This is it, the heart of the matter. Your text, what we want to read.</li><li>A Type - What kind of node is this? Blog, book, forum, comment, unextended, etc.</li><li>An Author - The author's name. It will either be \"anonymous\" or a valid user. You <i>cannot</i> set it to an arbitrary value.</li>";
+ $output .= "<li>Authored on - The date it was written on.</li><li>Changed - The last time this node was changed</li><li>Static on front page - The front page is configured to show the teaser's from only a few of the total nodes you have on your site (To configure how many teaser ". l("click here","admin/system/modules/node") ."), but if you think a node is important enough that you want it to stay on the front page enable this.</li><li>Allow user comments - A node can have comments, which are other nodes. These comments can be written by other users (Read-write), or only by admins (Read-only).</li>";
+ $output .= "<li>Attributes - A way to sort nodes.</li><li>revisions - Drupal has a revision system so that you can \"roll back\" to an older version of a node if the new version is not what you want.</li><li>Promote to front page - To get people to look at the new stuff on your site you want to move it to the front page. So promote it too the front page.</li>";
+ $output .= "<li>Moderation Status - Drupal has a moderation system. If it is active, a node is in one of three states. Approved and Published, Approved and UnPublished, and Awaiting Approval. If you are <b>not</b> moderating a node it should be Approved</li><li>votes - If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote if will either be Approved, or Dropped (To setup the number of votes needed and the promote and dump scores ". l("click here","admin/system/modules/queue") .".)</a>.</li><li>score - The score of the node is gotten by the votes it is given.</li>";
+ $output .= "<li>users - The list of users who have voted on a moderated node.</li><li>Public/Published - When using Drupal's moderation system a node remains UnPublished -- unavaliable to non-moderators -- until it is marked Public/Published.</li></ul>";
+ $output .= "Now that you know what is in a node, here are some of the types of nodes avalible:";
+
+ if ($mod == "admin") {
foreach (module_list() as $name) {
if (module_hook($name, "node") && $name != "node") {
- print "<h3>". t("%module type", array("%module" => ucfirst(module_invoke($name, "node", "name")))). "</h3>";
- print module_invoke($name, "help");
+ $output .= "<h3>". t("%module type", array("%module" => ucfirst(module_invoke($name, "node", "name")))). "</h3>";
+ $output .= module_invoke($name, "help");
+
}
}
}
+ return t($output);
}
function node_system($field){
$system["description"] = t("The core that allows content to be submitted to the site.");
+ $system["admin_help"] = t("Settings for the core of Drupal. Almost everything is a node so these settings will affect most of the site.");
return $system[$field];
}
@@ -522,16 +533,21 @@ function node_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && user_access("administer nodes")) {
- $help["search"] = "On this page you can search for a post. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.";
-
- menu("admin/node", "content management", "node_admin");
- menu("admin/node/nodes", "post overview");
- menu("admin/node/nodes/0", "new or updated posts", "node_admin", NULL, 0);
- menu("admin/node/nodes/1", "approval queue", "node_admin", NULL, 1);
+- $help["overview"] = t("Below is a list of all of the nodes in your site. Other content, such as ". l("comments", "admin/comment") .", are delt with in other areas.<br />Click on a node title to view the node, the author name to edit the author's user information.<br />Other work with nodes can be done with the menu on the left.");
+- $help["post-overview"] = t("Click on <a href=\"%nup\">new or updated posts</a> to see your latest nodes, or <a href=\"%queue\">approval queue</a> to approve new messages.", array("%nup" => url("admin/nodes/0"), "%queue" => url("admin/nodes/1")));
+- $help["new-update"] = t("Below is a list of the latest nodes in your site. Click on a node title to see the node, the author name to edit the author's user information , \"edit node\" to edit the node, and \"delete node\" to remove the node.");
+- $help["queue"] = t("Below is a list of the node in your site that need <b>approval</b>. To approve a node click on <b>\"edit node\"</b> and then change it's <b>moderation status</b> to Approved.<br />Click on a node title to see the node, the author name to edit the author's user information, \"edit node\" to edit the node, and \"delete node\" to remove the node.");
+- $help["search"] = t("Enter a simple pattern ( '*' maybe used as a wildcard match) to search for a post. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.");
+- $help["setting"] = t("The default settings for the different node types.<br /><b>content type</b> - the node type. <b>comment</b> - What kind of comments are associated with the node. <b>publish</b> - is this node publicly viewable, has it been published. <b>promote</b> - Is this node to be promoted to the front page. <b>moderate</b> - Does this node need approval before it can be viewed. <b>static</b> - Is this node to stay on the front page. <b>revision</b> - Will this node go into the revision system allowing multiple versions to be saved.");
+
+ menu("admin/node", "content management", "node_admin", $help["overview"]);
+ menu("admin/node/nodes", "post overview", NULL, $help["post-overview"]);
+ menu("admin/node/nodes/0", "new or updated posts", "node_admin", $help["new-update"], 0);
+ menu("admin/node/nodes/1", "approval queue", "node_admin", $help["queue"], 1);
menu("admin/node/search", "search posts", "node_admin", $help["search"], 8);
menu("admin/node/help", "help", "node_help", NULL, 9);
menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
- menu("admin/node/settings", "content settings", "node_admin", NULL, 8);
+ menu("admin/node/settings", "content settings", "node_admin", $help["setting"], 8);
}
return $links;
diff --git a/modules/node/node.module b/modules/node/node.module
index b01c05324..1c927e753 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -4,18 +4,29 @@
function node_help() {
global $mod;
- if ($mod == "node") {
+ $output .= "<h3>Nodes</h3>The core of the Drupal system is the node. All of the contents of the system are placed in nodes, or extensions of nodes.";
+ $output .= "A base node contains:<ul><li>A Title - Up to 128 characters of text that titles the node.</li><li>A Teaser - A small block of text that is ment to get you interested in the rest of node. Drupal automatically pulls a small amount of the body of the node to make the teaser (To configure how long the teaser will be ". l("click here","admin/system/modules/node") ."). The teaser can be changed if you don't like what Drupal grabs</li><li>The Body - This is it, the heart of the matter. Your text, what we want to read.</li><li>A Type - What kind of node is this? Blog, book, forum, comment, unextended, etc.</li><li>An Author - The author's name. It will either be \"anonymous\" or a valid user. You <i>cannot</i> set it to an arbitrary value.</li>";
+ $output .= "<li>Authored on - The date it was written on.</li><li>Changed - The last time this node was changed</li><li>Static on front page - The front page is configured to show the teaser's from only a few of the total nodes you have on your site (To configure how many teaser ". l("click here","admin/system/modules/node") ."), but if you think a node is important enough that you want it to stay on the front page enable this.</li><li>Allow user comments - A node can have comments, which are other nodes. These comments can be written by other users (Read-write), or only by admins (Read-only).</li>";
+ $output .= "<li>Attributes - A way to sort nodes.</li><li>revisions - Drupal has a revision system so that you can \"roll back\" to an older version of a node if the new version is not what you want.</li><li>Promote to front page - To get people to look at the new stuff on your site you want to move it to the front page. So promote it too the front page.</li>";
+ $output .= "<li>Moderation Status - Drupal has a moderation system. If it is active, a node is in one of three states. Approved and Published, Approved and UnPublished, and Awaiting Approval. If you are <b>not</b> moderating a node it should be Approved</li><li>votes - If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote if will either be Approved, or Dropped (To setup the number of votes needed and the promote and dump scores ". l("click here","admin/system/modules/queue") .".)</a>.</li><li>score - The score of the node is gotten by the votes it is given.</li>";
+ $output .= "<li>users - The list of users who have voted on a moderated node.</li><li>Public/Published - When using Drupal's moderation system a node remains UnPublished -- unavaliable to non-moderators -- until it is marked Public/Published.</li></ul>";
+ $output .= "Now that you know what is in a node, here are some of the types of nodes avalible:";
+
+ if ($mod == "admin") {
foreach (module_list() as $name) {
if (module_hook($name, "node") && $name != "node") {
- print "<h3>". t("%module type", array("%module" => ucfirst(module_invoke($name, "node", "name")))). "</h3>";
- print module_invoke($name, "help");
+ $output .= "<h3>". t("%module type", array("%module" => ucfirst(module_invoke($name, "node", "name")))). "</h3>";
+ $output .= module_invoke($name, "help");
+
}
}
}
+ return t($output);
}
function node_system($field){
$system["description"] = t("The core that allows content to be submitted to the site.");
+ $system["admin_help"] = t("Settings for the core of Drupal. Almost everything is a node so these settings will affect most of the site.");
return $system[$field];
}
@@ -522,16 +533,21 @@ function node_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && user_access("administer nodes")) {
- $help["search"] = "On this page you can search for a post. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.";
-
- menu("admin/node", "content management", "node_admin");
- menu("admin/node/nodes", "post overview");
- menu("admin/node/nodes/0", "new or updated posts", "node_admin", NULL, 0);
- menu("admin/node/nodes/1", "approval queue", "node_admin", NULL, 1);
+- $help["overview"] = t("Below is a list of all of the nodes in your site. Other content, such as ". l("comments", "admin/comment") .", are delt with in other areas.<br />Click on a node title to view the node, the author name to edit the author's user information.<br />Other work with nodes can be done with the menu on the left.");
+- $help["post-overview"] = t("Click on <a href=\"%nup\">new or updated posts</a> to see your latest nodes, or <a href=\"%queue\">approval queue</a> to approve new messages.", array("%nup" => url("admin/nodes/0"), "%queue" => url("admin/nodes/1")));
+- $help["new-update"] = t("Below is a list of the latest nodes in your site. Click on a node title to see the node, the author name to edit the author's user information , \"edit node\" to edit the node, and \"delete node\" to remove the node.");
+- $help["queue"] = t("Below is a list of the node in your site that need <b>approval</b>. To approve a node click on <b>\"edit node\"</b> and then change it's <b>moderation status</b> to Approved.<br />Click on a node title to see the node, the author name to edit the author's user information, \"edit node\" to edit the node, and \"delete node\" to remove the node.");
+- $help["search"] = t("Enter a simple pattern ( '*' maybe used as a wildcard match) to search for a post. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.");
+- $help["setting"] = t("The default settings for the different node types.<br /><b>content type</b> - the node type. <b>comment</b> - What kind of comments are associated with the node. <b>publish</b> - is this node publicly viewable, has it been published. <b>promote</b> - Is this node to be promoted to the front page. <b>moderate</b> - Does this node need approval before it can be viewed. <b>static</b> - Is this node to stay on the front page. <b>revision</b> - Will this node go into the revision system allowing multiple versions to be saved.");
+
+ menu("admin/node", "content management", "node_admin", $help["overview"]);
+ menu("admin/node/nodes", "post overview", NULL, $help["post-overview"]);
+ menu("admin/node/nodes/0", "new or updated posts", "node_admin", $help["new-update"], 0);
+ menu("admin/node/nodes/1", "approval queue", "node_admin", $help["queue"], 1);
menu("admin/node/search", "search posts", "node_admin", $help["search"], 8);
menu("admin/node/help", "help", "node_help", NULL, 9);
menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
- menu("admin/node/settings", "content settings", "node_admin", NULL, 8);
+ menu("admin/node/settings", "content settings", "node_admin", $help["setting"], 8);
}
return $links;
diff --git a/modules/ping.module b/modules/ping.module
index 1cfba0d6e..0dbe38996 100644
--- a/modules/ping.module
+++ b/modules/ping.module
@@ -3,8 +3,8 @@
function ping_help() {
$output = "<p>Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites :</p>";
- $output .= "<p><a href=\"http://www.weblogs.com/\">Weblogs.com</a>, a website that tracks and displays links to changed weblogs and news-oriented websites. To get your Drupal site listed, weblogs.com must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the <a href=\"http://www.weblogs.com/\">weblogs.com system</a>. The weblog module automatically notifies weblogs.com when your site is updated. To do so, Drupal implements the <a href=\"http://www.xmlrpc.com/weblogsCom/\">XML-RPC interface of weblogs.com</a>.</p>";
- $output .= "<p><a href=\"http://www.xmlrpc.com/weblogsComForRss\">Weblogs.Com for RSS</a>, a website that tracks and displays links to recently changed RSS feeds in XML format. To get your Drupal site listed, weblogs.com for RSS must be informed about updates to your RSS feed. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the <a href=\"http://www.weblogs.com/rssUpdates/changes.xml\">weblogs.com for RSS system</a>. The ping module automatically notifies weblogs.com for RSS when your site is updated.</p>";
+ $output .= "<p><a href=\"http://www.weblogs.com/\">Weblogs.com</a>, a web site that tracks and displays links to changed weblogs and news-oriented web sites. To get your Drupal site listed, weblogs.com must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the <a href=\"http://www.weblogs.com/\">weblogs.com system</a>. The weblog module automatically notifies weblogs.com when your site is updated. To do so, Drupal implements the <a href=\"http://www.xmlrpc.com/weblogsCom/\">XML-RPC interface of weblogs.com</a>.</p>";
+ $output .= "<p><a href=\"http://www.xmlrpc.com/weblogsComForRss\">Weblogs.Com for RSS</a>, a web site that tracks and displays links to recently changed RSS feeds in XML format. To get your Drupal site listed, weblogs.com for RSS must be informed about updates to your RSS feed. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the <a href=\"http://www.weblogs.com/rssUpdates/changes.xml\">weblogs.com for RSS system</a>. The ping module automatically notifies weblogs.com for RSS when your site is updated.</p>";
$output .= "<p><a href=\"http://blo.gs/\">blo.gs</a>, a directory of recently updated weblogs and tools for tracking interesting weblogs, in the spirit of services like <a href=\"http://www.weblogs.com/\">weblogs.com</a>, <a href=\"http://www.dansanderson.com/blogtracker/\">blogtracker</a> and <a href=\"http://www.blogrolling.com/\">blogrolling.com</a>. To get your Drupal site listed, blo.gs must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the <a href=\"http://blo.gs/\">blo.gs system</a>. The ping module automatically notifies blo.gs when your site is updated. To do so, Drupal implements the <a href=\"http://blo.gs/ping.php\">XML-RPC interface of blo.gs</a>.</p>";
// for optional modules that ping other sites
// $output .= module_invoke_all("ping_help");
diff --git a/modules/ping/ping.module b/modules/ping/ping.module
index 1cfba0d6e..0dbe38996 100644
--- a/modules/ping/ping.module
+++ b/modules/ping/ping.module
@@ -3,8 +3,8 @@
function ping_help() {
$output = "<p>Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites :</p>";
- $output .= "<p><a href=\"http://www.weblogs.com/\">Weblogs.com</a>, a website that tracks and displays links to changed weblogs and news-oriented websites. To get your Drupal site listed, weblogs.com must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the <a href=\"http://www.weblogs.com/\">weblogs.com system</a>. The weblog module automatically notifies weblogs.com when your site is updated. To do so, Drupal implements the <a href=\"http://www.xmlrpc.com/weblogsCom/\">XML-RPC interface of weblogs.com</a>.</p>";
- $output .= "<p><a href=\"http://www.xmlrpc.com/weblogsComForRss\">Weblogs.Com for RSS</a>, a website that tracks and displays links to recently changed RSS feeds in XML format. To get your Drupal site listed, weblogs.com for RSS must be informed about updates to your RSS feed. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the <a href=\"http://www.weblogs.com/rssUpdates/changes.xml\">weblogs.com for RSS system</a>. The ping module automatically notifies weblogs.com for RSS when your site is updated.</p>";
+ $output .= "<p><a href=\"http://www.weblogs.com/\">Weblogs.com</a>, a web site that tracks and displays links to changed weblogs and news-oriented web sites. To get your Drupal site listed, weblogs.com must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the <a href=\"http://www.weblogs.com/\">weblogs.com system</a>. The weblog module automatically notifies weblogs.com when your site is updated. To do so, Drupal implements the <a href=\"http://www.xmlrpc.com/weblogsCom/\">XML-RPC interface of weblogs.com</a>.</p>";
+ $output .= "<p><a href=\"http://www.xmlrpc.com/weblogsComForRss\">Weblogs.Com for RSS</a>, a web site that tracks and displays links to recently changed RSS feeds in XML format. To get your Drupal site listed, weblogs.com for RSS must be informed about updates to your RSS feed. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the <a href=\"http://www.weblogs.com/rssUpdates/changes.xml\">weblogs.com for RSS system</a>. The ping module automatically notifies weblogs.com for RSS when your site is updated.</p>";
$output .= "<p><a href=\"http://blo.gs/\">blo.gs</a>, a directory of recently updated weblogs and tools for tracking interesting weblogs, in the spirit of services like <a href=\"http://www.weblogs.com/\">weblogs.com</a>, <a href=\"http://www.dansanderson.com/blogtracker/\">blogtracker</a> and <a href=\"http://www.blogrolling.com/\">blogrolling.com</a>. To get your Drupal site listed, blo.gs must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the <a href=\"http://blo.gs/\">blo.gs system</a>. The ping module automatically notifies blo.gs when your site is updated. To do so, Drupal implements the <a href=\"http://blo.gs/ping.php\">XML-RPC interface of blo.gs</a>.</p>";
// for optional modules that ping other sites
// $output .= module_invoke_all("ping_help");
diff --git a/modules/poll.module b/modules/poll.module
index c4bdaa904..d0fa6f9ef 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -130,9 +130,8 @@ function poll_form(&$node, &$help, &$error) {
}
function poll_help() {
- ?>
- <p>Drupal's poll module allows users with at least content posting privileges to submit multiple-choice questions that others can vote on. Any user with sufficient privileges can vote. Please note that this is fully controlled by Drupal's access control features. For example, users might be required to login before voting (or even seeing the page where the voting occurs) or it could be open to the world.</p>
- <?php
+ $output .= "<p>Drupal's poll module allows users to vote on polls create by administrators, or even other users. Access to, voting on, and creation of polls is completely controlled by the Drupal ". l("access system","admin/user/permission") ."</p><ul><li> To create a poll a users needs the \"create polls\" permission.</li><li>To vote on a poll question a user must have the \"vote on polls\" permission.</li><li>To view the results one needs the \"access content\" permission.</li><li>To administer a vote you need the \"administer nodes\" permission.</li></ul><p>Creating a vote can be done with \"create poll\". The title of the poll should be the question, then enter the answers and the \"base\" vote counts. Finally the time span the vote will run.</p><p>". l("Poll", "poll") ." on the menu bar will take you to a page where you can see all the current polls, vote on them -- if you haven't already --, and view the results. To edit the node, and its vote counts, go to node administration.</p>";
+ return t($output);
}
function poll_insert($node) {
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index c4bdaa904..d0fa6f9ef 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -130,9 +130,8 @@ function poll_form(&$node, &$help, &$error) {
}
function poll_help() {
- ?>
- <p>Drupal's poll module allows users with at least content posting privileges to submit multiple-choice questions that others can vote on. Any user with sufficient privileges can vote. Please note that this is fully controlled by Drupal's access control features. For example, users might be required to login before voting (or even seeing the page where the voting occurs) or it could be open to the world.</p>
- <?php
+ $output .= "<p>Drupal's poll module allows users to vote on polls create by administrators, or even other users. Access to, voting on, and creation of polls is completely controlled by the Drupal ". l("access system","admin/user/permission") ."</p><ul><li> To create a poll a users needs the \"create polls\" permission.</li><li>To vote on a poll question a user must have the \"vote on polls\" permission.</li><li>To view the results one needs the \"access content\" permission.</li><li>To administer a vote you need the \"administer nodes\" permission.</li></ul><p>Creating a vote can be done with \"create poll\". The title of the poll should be the question, then enter the answers and the \"base\" vote counts. Finally the time span the vote will run.</p><p>". l("Poll", "poll") ." on the menu bar will take you to a page where you can see all the current polls, vote on them -- if you haven't already --, and view the results. To edit the node, and its vote counts, go to node administration.</p>";
+ return t($output);
}
function poll_insert($node) {
diff --git a/modules/profile.module b/modules/profile.module
index 8fb6da588..71e7f7653 100644
--- a/modules/profile.module
+++ b/modules/profile.module
@@ -37,6 +37,7 @@ function _profile_init() {
function profile_system($field){
$system["description"] = t("Support for configurable user profiles.");
+ $system["admin_help"] = t("When a user creates an account you can ask them to give you some extra information about themselves, as well as letting them use a small picture, called an avatar.<br />Notes:<ul><li>In order for a user to <i>enter</i> information you <b>MUST</b> check \"enable\".</li><li>In order for other people too see the entered information you must make it \"public\"</li><li>If an item is \"public\" but not enabled then the user can never give it a value and it will never been seen. Public does <b>not</b> imply \"enable\"</li><li>If an item is enabled, but not shown in the registration form the a user will have to ". l("edit their account", "user/edit") ." to place information in the field.</ul>");
return $system[$field];
}
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 8fb6da588..71e7f7653 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -37,6 +37,7 @@ function _profile_init() {
function profile_system($field){
$system["description"] = t("Support for configurable user profiles.");
+ $system["admin_help"] = t("When a user creates an account you can ask them to give you some extra information about themselves, as well as letting them use a small picture, called an avatar.<br />Notes:<ul><li>In order for a user to <i>enter</i> information you <b>MUST</b> check \"enable\".</li><li>In order for other people too see the entered information you must make it \"public\"</li><li>If an item is \"public\" but not enabled then the user can never give it a value and it will never been seen. Public does <b>not</b> imply \"enable\"</li><li>If an item is enabled, but not shown in the registration form the a user will have to ". l("edit their account", "user/edit") ." to place information in the field.</ul>");
return $system[$field];
}
diff --git a/modules/queue.module b/modules/queue.module
index 69c7f45a8..4cd4183e8 100644
--- a/modules/queue.module
+++ b/modules/queue.module
@@ -3,6 +3,7 @@
function queue_system($field){
$system["description"] = t("Enables content to be moderated by the community.");
+ $system["admin_help"] = t("** REWRITE **These are the settings for the moderation system. When the moderation value of a node is the same as or greater than the <b>Post threshold</b> then the node will be promoted to the front page. If the moderation value of a node falls below the <b>Dump threshold</b> then the node will be changed to an \"unpublished/private\" node. If the number of votes a node has recieved is the same as or higher than the <b>Expiration threshold</b>, and the node has not been promoted to the front page or dumped, then the node will be changed to an \"unpublished/private\" node. In all of three cases the moderation of the node will be marked as \"Approved\".<br /> If \"Show comments\" is enabled then the comments on this node will be shown in the moderation form.");
return $system[$field];
}
diff --git a/modules/search.module b/modules/search.module
index cd20bfa83..d22bd57d9 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -3,7 +3,7 @@
function search_help() {
$output = "<b>". t("Search guidelines") ."</b>";
- $output .= "<p>". t("The search page allows you to search the website's content. You can specify multiple words, and they will all be searched for. You can also use wildcards, so 'walk*' will match 'walk', 'walking', 'walker', 'walkable' and so on. Furthermore, searches are not case sensitive so searching for 'walk', 'Walk' or 'WALK' will yield exactly the same results.") ."</p>";
+ $output .= "<p>". t("The search page allows you to search the web site's content. You can specify multiple words, and they will all be searched for. You can also use wildcards, so 'walk*' will match 'walk', 'walking', 'walker', 'walkable' and so on. Furthermore, searches are not case sensitive so searching for 'walk', 'Walk' or 'WALK' will yield exactly the same results.") ."</p>";
$output .= "<b>". t("Words excluded from the search") ."</b>";
$output .= "<p>". t("Words that frequently occur, typically called 'noise words', are ignored. Example words are 'a', 'at', 'and', 'are', 'as', 'how', 'where', etc. Words shorter than %number letters are also being filtered.", array("%number" => variable_get("minimum_word_size", 2))) ."</p>";
return $output;
@@ -11,6 +11,7 @@ function search_help() {
function search_system($field){
$system["description"] = t("Enables site wide keyword searching.");
+ $system["admin_help"] = t("The search engine works by keeping an index of \"interesting\" words. To make sure we only get \"interesting\" words you need to set the following.");
return $system[$field];
}
diff --git a/modules/search/search.module b/modules/search/search.module
index cd20bfa83..d22bd57d9 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -3,7 +3,7 @@
function search_help() {
$output = "<b>". t("Search guidelines") ."</b>";
- $output .= "<p>". t("The search page allows you to search the website's content. You can specify multiple words, and they will all be searched for. You can also use wildcards, so 'walk*' will match 'walk', 'walking', 'walker', 'walkable' and so on. Furthermore, searches are not case sensitive so searching for 'walk', 'Walk' or 'WALK' will yield exactly the same results.") ."</p>";
+ $output .= "<p>". t("The search page allows you to search the web site's content. You can specify multiple words, and they will all be searched for. You can also use wildcards, so 'walk*' will match 'walk', 'walking', 'walker', 'walkable' and so on. Furthermore, searches are not case sensitive so searching for 'walk', 'Walk' or 'WALK' will yield exactly the same results.") ."</p>";
$output .= "<b>". t("Words excluded from the search") ."</b>";
$output .= "<p>". t("Words that frequently occur, typically called 'noise words', are ignored. Example words are 'a', 'at', 'and', 'are', 'as', 'how', 'where', etc. Words shorter than %number letters are also being filtered.", array("%number" => variable_get("minimum_word_size", 2))) ."</p>";
return $output;
@@ -11,6 +11,7 @@ function search_help() {
function search_system($field){
$system["description"] = t("Enables site wide keyword searching.");
+ $system["admin_help"] = t("The search engine works by keeping an index of \"interesting\" words. To make sure we only get \"interesting\" words you need to set the following.");
return $system[$field];
}
diff --git a/modules/statistics.module b/modules/statistics.module
index d3830291e..a167c734a 100644
--- a/modules/statistics.module
+++ b/modules/statistics.module
@@ -68,6 +68,7 @@ function statistics_exit() {
/* System hook, sets description of module in admin page */
function statistics_system($field) {
$system["description"] = t("Logs access statistics for your site.");
+ $system["admin_help"] = t("Settings for the statistical information that Drupal will keep about the site. See <a href=\"%statistics\">site statistics</a> for the actual information.", array("%statistics" => url("admin/statistics")));
return $system[$field];
}
@@ -111,18 +112,20 @@ function statistics_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && (user_access("administer statistics module") || (user_access("administer statistics")))) {
- $help["statistics"] = "This page gives you an at-a-glance look at your top nodes. It is useful for understanding what content on your site is the most popular.";
- $help["referrers"] = "This page shows you site-wide referrer statistics. You can see 'all referrers', 'external referrers' or 'internal referrers'. Defaults to 'external'.";
- $help["access"] = "This pages shows you who is accessing your website. You can see the hostnames, referrers. In particular, it is easy to inspect a user's navigation history/trail by clicking the username.";
- $help["top nodes page"] = "The statistics module creates a user page that can display summaries of the day's top viewed nodes, the all time top nodes and the last nodes viewed. Each of these summaries can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu.";
- $help["top nodes block"] = "The statistics module exports a block that can display the day's top viewed nodes, the all time top viewed nodes and the last nodes viewed. Each of these links can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.";
- $help["who is online block"] = "This statistics module exports a block that can display how many user's and guests are currently online. You can configure the name of the block, the name of a sub-block for displaying names of user's currently online, how recently a user must have been active to be considered online, the maximum characters to display from a user's name and the maximum number of user names to display.";
+ $help["statistics"] = t("This page gives you an at-a-glance look at your top nodes. It is useful for understanding what content on your site is the most popular.");
+ $help["referrers"] = t("This page shows you site-wide referrer statistics. You can see 'all referrers', 'external referrers' or 'internal referrers'. Defaults to 'external'. Referrers are web sites, both your site, and other peoples, that point to your web site.");
+ $help["referrers-internal"] = t("This page shows you only 'internal referrers'. Links pointing to your web site, from within your web site.");
+ $help["referrers-external"] = t("This page shows you only 'external referrers'. Links pointing to your web site from outside your web site.");
+ $help["access"] = t("This pages shows you who is accessing your web site. You can see the hostnames, referrers. In particular, it is easy to inspect a user's navigation history/trail by clicking the username.");
+ $help["top nodes page"] = t("The statistics module creates a user page that can display summaries of the day's top viewed nodes, the all time top nodes and the last nodes viewed. Each of these summaries can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu.");
+ $help["top nodes block"] = t("The statistics module exports a block that can display the top viewed nodes of the day, the all time top viewed nodes and the last nodes viewed. Each of these links can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.");
+ $help["who is online block"] = t("The statistics module exports a block that can display how many user's and guests are currently online. You can configure the name of the block, the name of a sub-block for displaying names of user's currently online, how recently a user must have been active to be considered online, the maximum characters to display from a user's name and the maximum number of user names to display.");
menu("admin/statistics", "site statistics", "statistics_admin", $help["statistics"], 6);
menu("admin/statistics/statistics", "most popular posts", "statistics_admin", $help["statistics"]);
menu("admin/statistics/referrers", "referrer log", "statistics_admin", $help["referrers"]);
- menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", $help["referrers"]);
- menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", $help["referrers"]);
+ menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", $help["referrers-internal"]);
+ menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", $help["referrers-external"]);
menu("admin/statistics/log", "access log", "statistics_admin", $help["access"]);
menu("admin/statistics/log/node", "track node", "statistics_admin", $help["access"], 0, 1);
menu("admin/statistics/log/user", "track user", "statistics_admin", $help["access"], 0, 1);
@@ -141,119 +144,48 @@ function statistics_link($type, $node = 0, $main = 0) {
/* Administrative help page */
function statistics_help() {
- ?>
- <h3>Introduction</h3>
-
- <p>This Drupal module keeps track of numerous statistics for your site. Be warned, statistical collection does cause a little overhead, thus everything is disabled by default when this module is first installed.</p>
-
- <p>The statistics module counts how many times each of your nodes is viewed, also tracking where each link to the node came from (HTTP referrer). The number of times a node has been viewed can be displayed in the node's link section (next to "# comments" etc).</p>
-
- <p>This module also adds a configurable block that can display the day's top stories, the all time top stories, and the last stories read. Each of these supports a configurable header and number of stories.</p>
-
- <p>This module also adds a configurable user page that can display the day's top stories, the all time top stories, and the last stories read. Each of these supports a configurable header and number of stories.</p>
-
- <p>This module also adds a configurable block that displays counts of how many users and guests are currently accessing your site, as well as a list of the names of the users currently accessing your site.</p>
-
- <p>If you enable the node view counters, this adds 1 database query for each node that is viewed (2 queries if it's the first time the node has ever been viewed).</p>
-
- <p>Finally, the statistics.module allows for a congestion controlling auto-throttle mechanism. If you have enabled the throttle.module, you can read more about this mechanism <?php print l("here", "admin/help#throttle"); ?>.</p>
-
- <p>If you enable the access log, this adds 1 database query for each page that Drupal displays. Logged information includes: HTTP referrer (if any), node being accessed (if any), user ID (if any), the IP address of the user, and the time the page was viewed.</p>
-
- <p>As with any new module, <i>statistics.module</i> needs to be enabled <?php print l("here", "admin/system/modules"); ?> before you can use it. Also refer to the permissions section below, as this module supports four separate permissions.</p>
-
- <h3>View statistics</h3>
-
- <p>This admin page gives you an at-a-glance look at your top nodes. It is useful for understanding what content on your Drupal site is the most popular. Also on this page are links to the referrer statistics for each listed node.</p>
-
- <h3>View referrers</h3>
-
- <p>This admin page shows you site-wide referrer statistics. You can see '<i>all</i>' statistics, '<i>external</i>' statistics or '<i>internal</i>' statistics. Default is 'external'.</p>
-
- <h3>Configuring the statistics module</h3>
-
- <p>There are a couple of configuration options added to the main <?php print l("site configuration", "admin/system"); ?> admin page.</p>
-
- <p>The first option, <i>enable access log</i>, allows you to turn the access log on and off. This log is used to store things like referrers and who's online. Enabling the log adds one database call per page displayed by Drupal.</p>
-
- <p>The second option, <i>discard access logs older than</i>, allows you to configure how long an access log entry is saved, after which time it is deleted from the database table.</p>
-
- <p>The next option, <i>enable node view counter</i>, allows you to turn on and off the node-counting functionality of this module. If it is turned on, an extra database query is added for each node displayed, as a counter is incremented with each node view.</p>
-
- <p>The next option, <i>display node view counters</i>, allows you to globally disable the displaying of node view counters. Additionally, a user group must have 'access statistics' permissions to view the counters.</p>
-
- <p>The final option is to <i>reset the day counter</i>. Every twenty four hours, all the day's totals are automatically reset to 0, and started again. Whatever time you click this link is the time each day that the day's totals will be reset. This requires cron. Note that clicking this link will reload the site configuration page <i>without</i> saving any other changes you might have made.</p>
-
- <h3>Top nodes block</h3>
-
- <p>This module creates a block that can display the day's top viewed nodes, the all time top viewed nodes and the last nodes viewed. Each of these links can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.</p>
-
- <p>The administrative "top nodes block" screen also allows you to assign a name to the block.</p>
-
- <p>Don't forget to enable the block <?php print l("here", "admin/block"); ?>.</p>
-
- <h3>Top nodes page</h3>
-
- <p>This module creates a user page that can display summaries of the day's top viewed nodes, the all time top nodes and the last nodes viewed. Each of these summaries can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu.</p>
-
- <p>The administrative "top nodes page" screen also allows you to assign a name for the automatically generated link to the user page. If no name is set, the link will not be displayed.</p>
-
- <h3>Who's online block</h3>
-
- <p>This module creates a block that can display how many user's and guests are currently online. You are able to configure the name of the block, the name of a sub-block for displaying names of user's currently online, how recently a user must have been active to be considered online, the maximum characters to display from a user's name and the maximum number of user names to display.</p>
-
- <p>Don't forget to enable the block <?php print l("here", "admin/block"); ?>.</p>
-
-<h3>Permissions</h3>
-<p>This module has four permissions that need to be configured in
-<?php print l("user permissions", "admin/user/permission"); ?>.</p>
-<ul>
- <li><i>access statistics</i> - enable for user roles that get to see individual node counts. (This does not define access to the block)</li>
- <li><i>access userlist</i> - enable for user roles that get to see the list of user's that are currently online within the "Who's online" block.</li>
- <li><i>administer statistics module</i> - enable for user roles that get to configure the statistics module.</li>
- <li><i>administer statistics</i> - enable for user roles that get to view the referrer statistics.</li>
-</ul>
-<p>If '<i>administer statistics</i>' and '<i>access statistics</i>' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).</p>
-
-<h2>Statistics module (for developers)</h2>
-
-<h3>Accessing statistics</h3>
-<p>To get a node's view statistics make a call to the function <i>statistics_get($nid)</i>. When you pass in a $nid, the function returns an array with three entires: [0]=totalcount, [1]=daycount, [2]=timestamp. For example, you could use this function call to add node view counts to your theme.</p>
-<ul>
- <li>The <i>totalcount</i> is a count of the total number of times that node has been viewed.</li>
- <li>The <i>daycount</i> is a count of the total number of times that node has been viewed "today". For the daycount to be reset, cron must be enabled.</li>
- <li>The <i>timestamp</i> is a timestamp of when that node was last viewed.</li>
-</ul>
-<p>The module automatically adds '# reads' to each node's link section (if enabled).</p>
-
-<h3>Top stories</h3>
-<p>The statistics.module provides a function '<i>statistics_title_list($type)</i>' to return an array of links to any of the following: the top viewed nodes of all time, the top viewed nodes of today, the last viewed nodes. You can pass in:</p>
-<ul>
- <li><i>totalcount</i> - This will return an array with links to the top viewed nodes of all time.<br />
- Example: <code>statistics_title_list("totalcount");</code><br /><br /></li>
- <li><i>daycount</i> - This will return an array with links to the top viewed nodes for today.<br />
- Example: <code>statistics_title_list("daycount");</code><br /><br /></li>
- <li><i>timestamp</i> - This will return a array with links to the last viewed node.<br />
- Example: <code>statistics_title_list("timestamp");</code></li>
-</ul>
-
-<h3>Throttle</h3>
-<p>The function <code>throttle_status()</code> will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.</p>
-<p>To implement the throttle, you should do something like this:
-<pre> $throttle = 0;
+ $output .= "<h3>Introduction</h3><p>The statistics.module keeps track of numerous statistics for your site but be warned, statistical collection does cause a little overhead, thus everything comes disabled by default.<p>";
+ $output .= "<p>The module counts how many times, and from where -- using HTTP referrer --, each of your nodes is viewed. Once we have that count the module can do the following with it:<ul><li> The count can be displayed in the node's link section next to \"# comments\".</li><li>A configurable block can be added which can display the day's top stories, the all time top stories, and the last stories read. Each section in the block has a title, which you can change, as well as being able to change how many node titles will be displayed</li><li>A configurable user page can be added, which can display the day's top stories, the all time top stories, and the last stories read. Each section in the page has a title, which you can change, as well as being able to change the number of stories to be displayed.</li><li>A configurable block can be added that displays the count of how many users, as well as a list of their names, and guests are currently accessing your site.</li><li>An auto-throttle, congestion controling mechanism can be used on your site if you have enabled the ". l("throttle.module", "admin/system/modules") .".</ul>";
+ $output .= "<p>Notes on using the statistics:</p><ul><li>If you enable the node view counters, this adds 1 database query for each node that is viewed (2 queries if it's the first time the node has ever been viewed).</li><li>If you enable the access log, this adds 1 database query for each page that Drupal displays. Logged information includes: HTTP referrer (if any), node being accessed (if any), user ID (if any), the IP address of the user, and the time the page was viewed.</li></ul>";
+ $output .= "<p>As with any new module, the <i>statistics.module</i> needs to be ". l("enabled", "admin/system/modules") ." before you can use it. Also refer to the ". l("permissions section", "admin/user/permission") .", as this module supports four separate permissions.</p>";
+ $output .= l("<h3>referrers log</h3>", "admin/statistics/referrers")."<p>This admin page shows you site-wide referrer statistics. You can see '<i>all</i>' statistics, '<i>external</i>' statistics or '<i>internal</i>' statistics. Default is 'external'.</p>";
+ $output .= l("<h3>access log</h3>", "admin/statistics/log") ."<p>This admin page gives you an at-a-glance look at your top nodes. It is useful for understanding what content on your Drupal site is the most popular. Also on this page are links to the referrer statistics for each listed node.</p>";
+ $output .= "<h3>Configuring the statistics module</h3><p>There are some configuration options added to the main ". l("site configuration", "admin/system/modules/statistics") ." section:</p>";
+ $output .= "<ul><li><i>enable access log</i> -- allows you to turn the access log on and off. This log is used to store things like referrers and who's online. Enabling the log adds one database call per page displayed by Drupal.</li>";
+ $output .= "<li><i>discard access logs older than</i> -- allows you to configure how long an access log entry is saved, after which time it is deleted from the database table. To use this you need to run \"cron.php\"</li>";
+ $output .= "<li><i>enable node view counter</i> -- allows you to turn on and off the node-counting functionality of this module. If it is turned on, an extra database query is added for each node displayed, which increments a counter.</li>";
+ $output .= "<li><i>display node view counters</i> -- allows you to globally disable the displaying of node view counters. Additionally, a user group must have 'access statistics' permissions to view the counters.</li></ul>";
+ $output .= "<h3>Top nodes block</h3><p>This module creates a block that can display the day's top viewed nodes, the all time top viewed nodes and the last nodes viewed. Each of these links can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.</p>";
+ $output .= "<p>The administrative \"top nodes block\" screen also allows you to assign a name to the block.</p>";
+ $output .= "<p>Don't forget to enable the block ". l("here", "admin/block") .".</p>";
+
+ $output .= "<h3>Top nodes page</h3><p>This module creates a user page that can display summaries of the day's top viewed nodes, the all time top nodes and the last nodes viewed. Each of these summaries can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu.</p>";
+ $output .= "<p>The administrative \"top nodes page\" screen also allows you to assign a name for the automatically generated link to the user page. If no name is set, the link will not be displayed.</p>";
+ $output .= "<h3>Who's online block</h3><p>This module creates a block that can display how many user's and guests are currently online. You are able to configure the name of the block, the name of a sub-block for displaying names of user's currently online, how recently a user must have been active to be considered online, the maximum characters to display from a user's name and the maximum number of user names to display.</p>";
+ $output .= "<p>Don't forget to enable the block ". l("here", "admin/block") .".</p>";
+ $output .= "<h3>Permissions</h3><p>This module has four permissions that need to be configured in ". l("user permissions", "admin/user/permission") .".</p>";
+ $output .= "<ul><li><i>access statistics</i> - enable for user roles that get to see individual node counts. (This does not define access to the block)</li><li><i>access userlist</i> - enable for user roles that get to see the list of user's that are currently online within the \"Who's online\" block.</li><li><i>administer statistics module</i> - enable for user roles that get to configure the statistics module.</li><li><i>administer statistics</i> - enable for user roles that get to view the referrer statistics.</li></ul>";
+ $output .= "<p>If '<i>administer statistics</i>' and '<i>access statistics</i>' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).</p>";
+ $output .= "<h2>Statistics module (for developers)</h2><h3>Accessing statistics</h3><p>To get a node's \"view statistics\" make a call to the function <i>statistics_get(\$nid)</i>. When you pass in a Node ID (\$nid), the function returns an array with three entires: [0]=totalcount, [1]=daycount, [2]=timestamp. For example, you could use this function call to add node view counts to your theme.</p>";
+ $output .= "<ul><li>The <i>totalcount</i> is a count of the total number of times that node has been viewed.</li><li>The <i>daycount</i> is a count of the total number of times that node has been viewed \"today\". For the daycount to be reset, cron must be enabled.</li><li>The <i>timestamp</i> is a timestamp of when that node was last viewed.</li></ul>";
+ $output .= "<p>The module automatically adds '# reads' to each node's link section (if enabled).</p>";
+ $output .= "<h3>Top stories</h3><p>The statistics.module provides a function '<i>statistics_title_list(\$dbfield, \$dbrows)</i>' to return an array of links to any of the following: the top viewed nodes of all time, the top viewed nodes of today, the last viewed nodes. You can pass in:</p>";
+ $output .= "<ul><li><i>totalcount</i> - This will return an array with links to the top viewed nodes of all time.<br />Example: <code>statistics_title_list(\"totalcount\", \"5\");</code><br /><br /></li><li><i>daycount</i> - This will return an array with links to the top viewed nodes for today.<br />Example: <code>statistics_title_list(\"daycount\",\"5\");</code><br /><br /></li><li><i>timestamp</i> - This will return a array with links to the last viewed node.<br />Example: <code>statistics_title_list(\"timestamp\",\"5\");</code></li></ul><p>\$dbrows is the number or rows you want returned in your array.</p>";
+ $output .= "<h3>Throttle</h3><p>The function <code>throttle_status()</code> will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.</p>";
+ $output .= "<p>To implement the throttle, you should do something like this:<pre> \$throttle = 0;
/* verify that the statitistics module is installed */
if (function_exists(throttle_status) {
- $throttle = throttle_status()
+ \$throttle = throttle_status()
}
- if ($throttle >= $my_throttle_value) {
+ if (\$throttle >= \$my_throttle_value) {
// throttle limit reached, disable stuff
}
else {
// throttle limit not reached, execute normally
- }</pre></p>
-<p>Note: Even though the configuration for the throttle is handled by the 'throttle.module', the throttle logic itself is part of the 'statistics.module'. The configuration has been separated in order to make things easier for the average site that will not be utilizing the throttling mechanism. More information about how the throttle works can be found on the throttle.module help page. Find the throttle help page <?php print l("here", "admin/help#throttle"); ?> if you have enabled the throttle.module).</p>
+ }</pre></p>";
+ $output .= "<p>Note: Even though the configuration for the throttle is handled by the 'throttle.module', the throttle logic itself is part of the 'statistics.module'. The configuration has been separated in order to make things easier for the average site that will not be utilizing the throttling mechanism. More information about how the throttle works can be found on the throttle.module help page. (Find the throttle help page ". l("here", "admin/help#throttle") ." if you have enabled the throttle.module).</p>";
+ return t($output);
- <?php
}
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index d3830291e..a167c734a 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -68,6 +68,7 @@ function statistics_exit() {
/* System hook, sets description of module in admin page */
function statistics_system($field) {
$system["description"] = t("Logs access statistics for your site.");
+ $system["admin_help"] = t("Settings for the statistical information that Drupal will keep about the site. See <a href=\"%statistics\">site statistics</a> for the actual information.", array("%statistics" => url("admin/statistics")));
return $system[$field];
}
@@ -111,18 +112,20 @@ function statistics_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && (user_access("administer statistics module") || (user_access("administer statistics")))) {
- $help["statistics"] = "This page gives you an at-a-glance look at your top nodes. It is useful for understanding what content on your site is the most popular.";
- $help["referrers"] = "This page shows you site-wide referrer statistics. You can see 'all referrers', 'external referrers' or 'internal referrers'. Defaults to 'external'.";
- $help["access"] = "This pages shows you who is accessing your website. You can see the hostnames, referrers. In particular, it is easy to inspect a user's navigation history/trail by clicking the username.";
- $help["top nodes page"] = "The statistics module creates a user page that can display summaries of the day's top viewed nodes, the all time top nodes and the last nodes viewed. Each of these summaries can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu.";
- $help["top nodes block"] = "The statistics module exports a block that can display the day's top viewed nodes, the all time top viewed nodes and the last nodes viewed. Each of these links can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.";
- $help["who is online block"] = "This statistics module exports a block that can display how many user's and guests are currently online. You can configure the name of the block, the name of a sub-block for displaying names of user's currently online, how recently a user must have been active to be considered online, the maximum characters to display from a user's name and the maximum number of user names to display.";
+ $help["statistics"] = t("This page gives you an at-a-glance look at your top nodes. It is useful for understanding what content on your site is the most popular.");
+ $help["referrers"] = t("This page shows you site-wide referrer statistics. You can see 'all referrers', 'external referrers' or 'internal referrers'. Defaults to 'external'. Referrers are web sites, both your site, and other peoples, that point to your web site.");
+ $help["referrers-internal"] = t("This page shows you only 'internal referrers'. Links pointing to your web site, from within your web site.");
+ $help["referrers-external"] = t("This page shows you only 'external referrers'. Links pointing to your web site from outside your web site.");
+ $help["access"] = t("This pages shows you who is accessing your web site. You can see the hostnames, referrers. In particular, it is easy to inspect a user's navigation history/trail by clicking the username.");
+ $help["top nodes page"] = t("The statistics module creates a user page that can display summaries of the day's top viewed nodes, the all time top nodes and the last nodes viewed. Each of these summaries can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu.");
+ $help["top nodes block"] = t("The statistics module exports a block that can display the top viewed nodes of the day, the all time top viewed nodes and the last nodes viewed. Each of these links can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.");
+ $help["who is online block"] = t("The statistics module exports a block that can display how many user's and guests are currently online. You can configure the name of the block, the name of a sub-block for displaying names of user's currently online, how recently a user must have been active to be considered online, the maximum characters to display from a user's name and the maximum number of user names to display.");
menu("admin/statistics", "site statistics", "statistics_admin", $help["statistics"], 6);
menu("admin/statistics/statistics", "most popular posts", "statistics_admin", $help["statistics"]);
menu("admin/statistics/referrers", "referrer log", "statistics_admin", $help["referrers"]);
- menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", $help["referrers"]);
- menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", $help["referrers"]);
+ menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", $help["referrers-internal"]);
+ menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", $help["referrers-external"]);
menu("admin/statistics/log", "access log", "statistics_admin", $help["access"]);
menu("admin/statistics/log/node", "track node", "statistics_admin", $help["access"], 0, 1);
menu("admin/statistics/log/user", "track user", "statistics_admin", $help["access"], 0, 1);
@@ -141,119 +144,48 @@ function statistics_link($type, $node = 0, $main = 0) {
/* Administrative help page */
function statistics_help() {
- ?>
- <h3>Introduction</h3>
-
- <p>This Drupal module keeps track of numerous statistics for your site. Be warned, statistical collection does cause a little overhead, thus everything is disabled by default when this module is first installed.</p>
-
- <p>The statistics module counts how many times each of your nodes is viewed, also tracking where each link to the node came from (HTTP referrer). The number of times a node has been viewed can be displayed in the node's link section (next to "# comments" etc).</p>
-
- <p>This module also adds a configurable block that can display the day's top stories, the all time top stories, and the last stories read. Each of these supports a configurable header and number of stories.</p>
-
- <p>This module also adds a configurable user page that can display the day's top stories, the all time top stories, and the last stories read. Each of these supports a configurable header and number of stories.</p>
-
- <p>This module also adds a configurable block that displays counts of how many users and guests are currently accessing your site, as well as a list of the names of the users currently accessing your site.</p>
-
- <p>If you enable the node view counters, this adds 1 database query for each node that is viewed (2 queries if it's the first time the node has ever been viewed).</p>
-
- <p>Finally, the statistics.module allows for a congestion controlling auto-throttle mechanism. If you have enabled the throttle.module, you can read more about this mechanism <?php print l("here", "admin/help#throttle"); ?>.</p>
-
- <p>If you enable the access log, this adds 1 database query for each page that Drupal displays. Logged information includes: HTTP referrer (if any), node being accessed (if any), user ID (if any), the IP address of the user, and the time the page was viewed.</p>
-
- <p>As with any new module, <i>statistics.module</i> needs to be enabled <?php print l("here", "admin/system/modules"); ?> before you can use it. Also refer to the permissions section below, as this module supports four separate permissions.</p>
-
- <h3>View statistics</h3>
-
- <p>This admin page gives you an at-a-glance look at your top nodes. It is useful for understanding what content on your Drupal site is the most popular. Also on this page are links to the referrer statistics for each listed node.</p>
-
- <h3>View referrers</h3>
-
- <p>This admin page shows you site-wide referrer statistics. You can see '<i>all</i>' statistics, '<i>external</i>' statistics or '<i>internal</i>' statistics. Default is 'external'.</p>
-
- <h3>Configuring the statistics module</h3>
-
- <p>There are a couple of configuration options added to the main <?php print l("site configuration", "admin/system"); ?> admin page.</p>
-
- <p>The first option, <i>enable access log</i>, allows you to turn the access log on and off. This log is used to store things like referrers and who's online. Enabling the log adds one database call per page displayed by Drupal.</p>
-
- <p>The second option, <i>discard access logs older than</i>, allows you to configure how long an access log entry is saved, after which time it is deleted from the database table.</p>
-
- <p>The next option, <i>enable node view counter</i>, allows you to turn on and off the node-counting functionality of this module. If it is turned on, an extra database query is added for each node displayed, as a counter is incremented with each node view.</p>
-
- <p>The next option, <i>display node view counters</i>, allows you to globally disable the displaying of node view counters. Additionally, a user group must have 'access statistics' permissions to view the counters.</p>
-
- <p>The final option is to <i>reset the day counter</i>. Every twenty four hours, all the day's totals are automatically reset to 0, and started again. Whatever time you click this link is the time each day that the day's totals will be reset. This requires cron. Note that clicking this link will reload the site configuration page <i>without</i> saving any other changes you might have made.</p>
-
- <h3>Top nodes block</h3>
-
- <p>This module creates a block that can display the day's top viewed nodes, the all time top viewed nodes and the last nodes viewed. Each of these links can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.</p>
-
- <p>The administrative "top nodes block" screen also allows you to assign a name to the block.</p>
-
- <p>Don't forget to enable the block <?php print l("here", "admin/block"); ?>.</p>
-
- <h3>Top nodes page</h3>
-
- <p>This module creates a user page that can display summaries of the day's top viewed nodes, the all time top nodes and the last nodes viewed. Each of these summaries can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu.</p>
-
- <p>The administrative "top nodes page" screen also allows you to assign a name for the automatically generated link to the user page. If no name is set, the link will not be displayed.</p>
-
- <h3>Who's online block</h3>
-
- <p>This module creates a block that can display how many user's and guests are currently online. You are able to configure the name of the block, the name of a sub-block for displaying names of user's currently online, how recently a user must have been active to be considered online, the maximum characters to display from a user's name and the maximum number of user names to display.</p>
-
- <p>Don't forget to enable the block <?php print l("here", "admin/block"); ?>.</p>
-
-<h3>Permissions</h3>
-<p>This module has four permissions that need to be configured in
-<?php print l("user permissions", "admin/user/permission"); ?>.</p>
-<ul>
- <li><i>access statistics</i> - enable for user roles that get to see individual node counts. (This does not define access to the block)</li>
- <li><i>access userlist</i> - enable for user roles that get to see the list of user's that are currently online within the "Who's online" block.</li>
- <li><i>administer statistics module</i> - enable for user roles that get to configure the statistics module.</li>
- <li><i>administer statistics</i> - enable for user roles that get to view the referrer statistics.</li>
-</ul>
-<p>If '<i>administer statistics</i>' and '<i>access statistics</i>' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).</p>
-
-<h2>Statistics module (for developers)</h2>
-
-<h3>Accessing statistics</h3>
-<p>To get a node's view statistics make a call to the function <i>statistics_get($nid)</i>. When you pass in a $nid, the function returns an array with three entires: [0]=totalcount, [1]=daycount, [2]=timestamp. For example, you could use this function call to add node view counts to your theme.</p>
-<ul>
- <li>The <i>totalcount</i> is a count of the total number of times that node has been viewed.</li>
- <li>The <i>daycount</i> is a count of the total number of times that node has been viewed "today". For the daycount to be reset, cron must be enabled.</li>
- <li>The <i>timestamp</i> is a timestamp of when that node was last viewed.</li>
-</ul>
-<p>The module automatically adds '# reads' to each node's link section (if enabled).</p>
-
-<h3>Top stories</h3>
-<p>The statistics.module provides a function '<i>statistics_title_list($type)</i>' to return an array of links to any of the following: the top viewed nodes of all time, the top viewed nodes of today, the last viewed nodes. You can pass in:</p>
-<ul>
- <li><i>totalcount</i> - This will return an array with links to the top viewed nodes of all time.<br />
- Example: <code>statistics_title_list("totalcount");</code><br /><br /></li>
- <li><i>daycount</i> - This will return an array with links to the top viewed nodes for today.<br />
- Example: <code>statistics_title_list("daycount");</code><br /><br /></li>
- <li><i>timestamp</i> - This will return a array with links to the last viewed node.<br />
- Example: <code>statistics_title_list("timestamp");</code></li>
-</ul>
-
-<h3>Throttle</h3>
-<p>The function <code>throttle_status()</code> will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.</p>
-<p>To implement the throttle, you should do something like this:
-<pre> $throttle = 0;
+ $output .= "<h3>Introduction</h3><p>The statistics.module keeps track of numerous statistics for your site but be warned, statistical collection does cause a little overhead, thus everything comes disabled by default.<p>";
+ $output .= "<p>The module counts how many times, and from where -- using HTTP referrer --, each of your nodes is viewed. Once we have that count the module can do the following with it:<ul><li> The count can be displayed in the node's link section next to \"# comments\".</li><li>A configurable block can be added which can display the day's top stories, the all time top stories, and the last stories read. Each section in the block has a title, which you can change, as well as being able to change how many node titles will be displayed</li><li>A configurable user page can be added, which can display the day's top stories, the all time top stories, and the last stories read. Each section in the page has a title, which you can change, as well as being able to change the number of stories to be displayed.</li><li>A configurable block can be added that displays the count of how many users, as well as a list of their names, and guests are currently accessing your site.</li><li>An auto-throttle, congestion controling mechanism can be used on your site if you have enabled the ". l("throttle.module", "admin/system/modules") .".</ul>";
+ $output .= "<p>Notes on using the statistics:</p><ul><li>If you enable the node view counters, this adds 1 database query for each node that is viewed (2 queries if it's the first time the node has ever been viewed).</li><li>If you enable the access log, this adds 1 database query for each page that Drupal displays. Logged information includes: HTTP referrer (if any), node being accessed (if any), user ID (if any), the IP address of the user, and the time the page was viewed.</li></ul>";
+ $output .= "<p>As with any new module, the <i>statistics.module</i> needs to be ". l("enabled", "admin/system/modules") ." before you can use it. Also refer to the ". l("permissions section", "admin/user/permission") .", as this module supports four separate permissions.</p>";
+ $output .= l("<h3>referrers log</h3>", "admin/statistics/referrers")."<p>This admin page shows you site-wide referrer statistics. You can see '<i>all</i>' statistics, '<i>external</i>' statistics or '<i>internal</i>' statistics. Default is 'external'.</p>";
+ $output .= l("<h3>access log</h3>", "admin/statistics/log") ."<p>This admin page gives you an at-a-glance look at your top nodes. It is useful for understanding what content on your Drupal site is the most popular. Also on this page are links to the referrer statistics for each listed node.</p>";
+ $output .= "<h3>Configuring the statistics module</h3><p>There are some configuration options added to the main ". l("site configuration", "admin/system/modules/statistics") ." section:</p>";
+ $output .= "<ul><li><i>enable access log</i> -- allows you to turn the access log on and off. This log is used to store things like referrers and who's online. Enabling the log adds one database call per page displayed by Drupal.</li>";
+ $output .= "<li><i>discard access logs older than</i> -- allows you to configure how long an access log entry is saved, after which time it is deleted from the database table. To use this you need to run \"cron.php\"</li>";
+ $output .= "<li><i>enable node view counter</i> -- allows you to turn on and off the node-counting functionality of this module. If it is turned on, an extra database query is added for each node displayed, which increments a counter.</li>";
+ $output .= "<li><i>display node view counters</i> -- allows you to globally disable the displaying of node view counters. Additionally, a user group must have 'access statistics' permissions to view the counters.</li></ul>";
+ $output .= "<h3>Top nodes block</h3><p>This module creates a block that can display the day's top viewed nodes, the all time top viewed nodes and the last nodes viewed. Each of these links can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.</p>";
+ $output .= "<p>The administrative \"top nodes block\" screen also allows you to assign a name to the block.</p>";
+ $output .= "<p>Don't forget to enable the block ". l("here", "admin/block") .".</p>";
+
+ $output .= "<h3>Top nodes page</h3><p>This module creates a user page that can display summaries of the day's top viewed nodes, the all time top nodes and the last nodes viewed. Each of these summaries can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu.</p>";
+ $output .= "<p>The administrative \"top nodes page\" screen also allows you to assign a name for the automatically generated link to the user page. If no name is set, the link will not be displayed.</p>";
+ $output .= "<h3>Who's online block</h3><p>This module creates a block that can display how many user's and guests are currently online. You are able to configure the name of the block, the name of a sub-block for displaying names of user's currently online, how recently a user must have been active to be considered online, the maximum characters to display from a user's name and the maximum number of user names to display.</p>";
+ $output .= "<p>Don't forget to enable the block ". l("here", "admin/block") .".</p>";
+ $output .= "<h3>Permissions</h3><p>This module has four permissions that need to be configured in ". l("user permissions", "admin/user/permission") .".</p>";
+ $output .= "<ul><li><i>access statistics</i> - enable for user roles that get to see individual node counts. (This does not define access to the block)</li><li><i>access userlist</i> - enable for user roles that get to see the list of user's that are currently online within the \"Who's online\" block.</li><li><i>administer statistics module</i> - enable for user roles that get to configure the statistics module.</li><li><i>administer statistics</i> - enable for user roles that get to view the referrer statistics.</li></ul>";
+ $output .= "<p>If '<i>administer statistics</i>' and '<i>access statistics</i>' are both enabled, the user will see a link from each node to that node's referrer statistics (if enabled).</p>";
+ $output .= "<h2>Statistics module (for developers)</h2><h3>Accessing statistics</h3><p>To get a node's \"view statistics\" make a call to the function <i>statistics_get(\$nid)</i>. When you pass in a Node ID (\$nid), the function returns an array with three entires: [0]=totalcount, [1]=daycount, [2]=timestamp. For example, you could use this function call to add node view counts to your theme.</p>";
+ $output .= "<ul><li>The <i>totalcount</i> is a count of the total number of times that node has been viewed.</li><li>The <i>daycount</i> is a count of the total number of times that node has been viewed \"today\". For the daycount to be reset, cron must be enabled.</li><li>The <i>timestamp</i> is a timestamp of when that node was last viewed.</li></ul>";
+ $output .= "<p>The module automatically adds '# reads' to each node's link section (if enabled).</p>";
+ $output .= "<h3>Top stories</h3><p>The statistics.module provides a function '<i>statistics_title_list(\$dbfield, \$dbrows)</i>' to return an array of links to any of the following: the top viewed nodes of all time, the top viewed nodes of today, the last viewed nodes. You can pass in:</p>";
+ $output .= "<ul><li><i>totalcount</i> - This will return an array with links to the top viewed nodes of all time.<br />Example: <code>statistics_title_list(\"totalcount\", \"5\");</code><br /><br /></li><li><i>daycount</i> - This will return an array with links to the top viewed nodes for today.<br />Example: <code>statistics_title_list(\"daycount\",\"5\");</code><br /><br /></li><li><i>timestamp</i> - This will return a array with links to the last viewed node.<br />Example: <code>statistics_title_list(\"timestamp\",\"5\");</code></li></ul><p>\$dbrows is the number or rows you want returned in your array.</p>";
+ $output .= "<h3>Throttle</h3><p>The function <code>throttle_status()</code> will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.</p>";
+ $output .= "<p>To implement the throttle, you should do something like this:<pre> \$throttle = 0;
/* verify that the statitistics module is installed */
if (function_exists(throttle_status) {
- $throttle = throttle_status()
+ \$throttle = throttle_status()
}
- if ($throttle >= $my_throttle_value) {
+ if (\$throttle >= \$my_throttle_value) {
// throttle limit reached, disable stuff
}
else {
// throttle limit not reached, execute normally
- }</pre></p>
-<p>Note: Even though the configuration for the throttle is handled by the 'throttle.module', the throttle logic itself is part of the 'statistics.module'. The configuration has been separated in order to make things easier for the average site that will not be utilizing the throttling mechanism. More information about how the throttle works can be found on the throttle.module help page. Find the throttle help page <?php print l("here", "admin/help#throttle"); ?> if you have enabled the throttle.module).</p>
+ }</pre></p>";
+ $output .= "<p>Note: Even though the configuration for the throttle is handled by the 'throttle.module', the throttle logic itself is part of the 'statistics.module'. The configuration has been separated in order to make things easier for the average site that will not be utilizing the throttling mechanism. More information about how the throttle works can be found on the throttle.module help page. (Find the throttle help page ". l("here", "admin/help#throttle") ." if you have enabled the throttle.module).</p>";
+ return t($output);
- <?php
}
diff --git a/modules/story.module b/modules/story.module
index 85934285f..5bd180829 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -3,12 +3,13 @@
function story_help() {
$output .= "<p>The story module enables to users to submit thoughful, cohesive posts for consideration by the rest of the community. Stories usually follow a specific content flow: <i>submit -&gt; moderate -&gt; post to home page -&gt; comment</i>. Administrators are able to shortcut this flow as desired.</p>";
- $output .= "<p>Administrators may \"pin\" an important story or announcement to the front page using the <i>static on front page</i> setting while creating or editing a story (this is true for other nodes as well). In addition, administrators may provide helpful introductory text for story authors in the <i>settings</i> page. There, administrators might also choose to set a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trvially short stories.</p>";
+ $output .= "In ". l("site configuration &gt;&gt; modules &gt;&gt; story", "admin/system/modules/story") ." you can setup an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trvially short stories.";
return $output;
}
function story_system($field){
$system["description"] = t("Enables users to submit stories, articles or similar content.");
+ $system["admin_help"] = t("**REWRITE** Stories are nodes with a complete thought. Think of newspaper stories. Stories follow the flow \"submit -&gt; moderate -&gt; post to the main page -&gt; comment on story\". Below enter the minimum word count for a story, and the small block which will be displayed to users wanting to enter a story.");
return $system[$field];
}
diff --git a/modules/story/story.module b/modules/story/story.module
index 85934285f..5bd180829 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -3,12 +3,13 @@
function story_help() {
$output .= "<p>The story module enables to users to submit thoughful, cohesive posts for consideration by the rest of the community. Stories usually follow a specific content flow: <i>submit -&gt; moderate -&gt; post to home page -&gt; comment</i>. Administrators are able to shortcut this flow as desired.</p>";
- $output .= "<p>Administrators may \"pin\" an important story or announcement to the front page using the <i>static on front page</i> setting while creating or editing a story (this is true for other nodes as well). In addition, administrators may provide helpful introductory text for story authors in the <i>settings</i> page. There, administrators might also choose to set a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trvially short stories.</p>";
+ $output .= "In ". l("site configuration &gt;&gt; modules &gt;&gt; story", "admin/system/modules/story") ." you can setup an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trvially short stories.";
return $output;
}
function story_system($field){
$system["description"] = t("Enables users to submit stories, articles or similar content.");
+ $system["admin_help"] = t("**REWRITE** Stories are nodes with a complete thought. Think of newspaper stories. Stories follow the flow \"submit -&gt; moderate -&gt; post to the main page -&gt; comment on story\". Below enter the minimum word count for a story, and the small block which will be displayed to users wanting to enter a story.");
return $system[$field];
}
diff --git a/modules/system.module b/modules/system.module
index 3158c24d7..235c25768 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -2,10 +2,10 @@
// $Id$
function system_help() {
- $output .= "<p>Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviors including visual and operational settings.</p>";
+ $output .= "<p>Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviours including visual and operational settings.</p>";
$output .= "<h3><a name=\"cron\">Cron</a></h3>". system_help_cron();
$output .= "<h3><a name=\"cache\">Cache</a></h3>". system_help_cache();
- return $output;
+ return t("$output");
}
function system_system($field) {
@@ -14,18 +14,19 @@ function system_system($field) {
}
function system_help_cache() {
- $output .= "<p>Drupal has a caching mechanism that stores dynamically generated pages in a database. By caching a page, Drupal does not have to generate the page each time it is requested. Only pages requested by anonymous users are being cached. When a cached page is accessed, Drupal will retrieve that page with minimal overhead using one SQL query only, thus reducing both the server load and the response time.</p>";
+ $output .= "<p>Drupal has a caching mechanism which stores dynamically generated web pages in a database. By caching a web page, Drupal does not have to create the page each time someone wants to view it, instead it takes only one SQL query to display it, reducing response time and the server's load. Only pages requested by \"anonymous\" users are cached.</p>";
return $output;
}
function system_help_cron() {
global $base_url;
- $output .= "<p>Some settings require a <i>cron</i> or <i>crontab</i>. Cron, which stands for chronograph, is a periodic command scheduler: it executes commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period of <i>n</i> seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.</p>";
- $output .= "<p>Whenever <a href=\"$base_url/cron.php\">$base_url/cron.php</a> is accessed, cron will run: it checks for the jobs cron controls, and their periods in seconds. If a certain task wasn't executed in the last n seconds, where n is the period of that job, it will be executed. When all the executed commands terminate, cron is done.</p>";
- $output .= "<p>The recommended way to setup your cron system is to setup a Unix/Linux crontab that frequently visits <a href=\"$base_url/cron.php\">$base_url/cron.php</a>. Note that cron does not guarantee the commands will be executed at the specified interval. However, Drupal will try his best and run the crons as close to the specified intervals as possible. The more you visit cron.php, the more accurate cron will be.</p>";
- $output .= "<p>If your hosting company does not allow you to setup crontabs, you can always ask someone else to setup a crontab for you. After all, virtually any Unix/Linux machine with access to the internet can setup a crontab to frequently visit <a href=\"$base_url/cron.php\">$base_url/cron.php</a>.</p>";
- $output .= "<p>For the Unix/Linux crontab itself, use a browser like <i>lynx</i> or <i>wget</i> but make sure the process terminates: either use <code>/usr/bin/lynx -source $base_url/cron.php</code> or <code>/usr/bin/wget -O /dev/null $base_url/cron.php</code>. Take a look at the example scripts in the <code>scripts</code>-directory and make sure to adjust them to your needs. A good crontab-line to run the cron-script once every hour would be: <pre> 00 * * * * /home/www/drupal/scripts/cron-lynx.sh</pre>Note that it is essential to access <code>cron.php</code> using a browser; don't run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code>, or some features won't work as expected. For all the environment variables to be correct; use a browser to access <code>cron.php</code> on a publicly accessible domain.</p>";
+ $output .= "<p>Some modules require regularly scheduled actions, such as cleaning up logfiles. Cron, which stands for chronograph, is a periodic command scheduler executing commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period measured in seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.</p>";
+ $output .= "<p>Whenever <a href=\"$base_url/cron.php\">$base_url/cron.php</a> is accessed, cron will run: it calls the _cron hook in each module allowing the module to run tasks if they have not been executed in the last <i>n</i> seconds, where n is the period of that task. When all the tasks are finished, cron is done.</p>";
+ $output .= "<p>The recommended way to set up your cron system is to set up a Unix/Linux crontab entry (see \"man crontab\") that frequently visits <a href=\"$base_url/cron.php\">$base_url/cron.php</a>. Note that cron does not guarantee the commands will be executed at the specified interval. However, Drupal will try its best to run the tasks as close to the specified intervals as possible. The more you visit cron.php, the more accurate cron will be.</p>";
+ $output .= "<p>If your hosting company does not allow you to set up crontab entries, you can always ask someone else to set up an entry for you. After all, virtually any Unix/Linux machine with access to the internet can set up a crontab entry to frequently visit <a href=\"$base_url/cron.php\">$base_url/cron.php</a>.</p>";
+ $output .= "<p>For the Unix/Linux crontab itself, use a browser like <i>lynx</i> or <i>wget</i> but make sure the process terminates: either use <code>/usr/bin/lynx -source $base_url/cron.php</code> or <code>/usr/bin/wget -o /dev/null -O /dev/null $base_url/cron.php</code>. Take a look at the example scripts in the <code>scripts</code>-directory. Make sure to adjust them to fit your needs. A good crontab line to run the cron script once every hour would be: <pre> 00 * * * * /home/www/drupal/scripts/cron-lynx.sh</pre>Note that it is essential to access <code>cron.php</code> using a browser on the web site's domain; do not run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code> or some of the environment varibles will not be set correctly and features may not work as expected.</p>";
+
return $output;
}
@@ -37,7 +38,7 @@ function system_link($type) {
if ($type == "admin" && user_access("administer site configuration")) {
$help["general"] = t("General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.");
$help["themes"] = t("Select which themes are available to your users and specify the default theme.");
- $help["modules"] = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled.");
+ $help["modules"] = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations.");
$help["filters"] = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
menu("admin/system", "site configuration", "system_admin", $help["general"], 3);
@@ -56,7 +57,7 @@ function system_link($type) {
foreach (module_list(1) as $name) {
// NOTE: refresh the list because some modules might have been enabled/disabled.
if (module_hook($name, "settings")) {
- menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "description"));
+ menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "admin_help"));
}
}
menu("admin/system/filters", "filters", "system_admin", $help["filters"], 4);
@@ -69,7 +70,7 @@ function system_view_general() {
// general settings:
$output .= "<h3>". t("General settings") ."</h3>\n";
- $output .= form_textfield(t("Name"), "site_name", variable_get("site_name", "drupal"), 70, 70, t("The name of this website."));
+ $output .= form_textfield(t("Name"), "site_name", variable_get("site_name", "drupal"), 70, 70, t("The name of this web site."));
$output .= form_textfield(t("E-mail address"), "site_mail", variable_get("site_mail", ini_get("sendmail_from")), 70, 128, t("A valid e-mail address for this website, used by the auto-mailer during registration, new password requests, notifications, etc."));
$output .= form_textfield(t("Slogan"), "site_slogan", variable_get("site_slogan", ""), 70, 128, t("The slogan of this website. Some themes display a slogan when available."));
$output .= form_textarea(t("Mission"), "site_mission", variable_get("site_mission", ""), 70, 5, t("Your site's mission statement or focus."));
@@ -82,7 +83,7 @@ function system_view_general() {
// cron:
$output .= "<h3>". t("Cron settings") ."</h3>\n";
- $output .= form_select(t("Cron support"), "cron", variable_get("cron", 1), array(t("Disabled"), t("Enabled")), t("Enable or disable cron support. Enable this setting if you have setup a cron job. Check the ". l("cron documentation", "admin/system/help#cron") ." for information on setting up a cron job."));
+ $output .= form_select(t("Cron support"), "cron", variable_get("cron", 1), array(t("Disabled"), t("Enabled")), t("Enable or disable cron support. Enable this setting if you have set up a cron job. Check the ". l("cron documentation", "admin/system/help#cron") ." for information on setting up a cron job."));
$output .= "<hr />\n";
// caching:
diff --git a/modules/system/system.module b/modules/system/system.module
index 3158c24d7..235c25768 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -2,10 +2,10 @@
// $Id$
function system_help() {
- $output .= "<p>Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviors including visual and operational settings.</p>";
+ $output .= "<p>Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviours including visual and operational settings.</p>";
$output .= "<h3><a name=\"cron\">Cron</a></h3>". system_help_cron();
$output .= "<h3><a name=\"cache\">Cache</a></h3>". system_help_cache();
- return $output;
+ return t("$output");
}
function system_system($field) {
@@ -14,18 +14,19 @@ function system_system($field) {
}
function system_help_cache() {
- $output .= "<p>Drupal has a caching mechanism that stores dynamically generated pages in a database. By caching a page, Drupal does not have to generate the page each time it is requested. Only pages requested by anonymous users are being cached. When a cached page is accessed, Drupal will retrieve that page with minimal overhead using one SQL query only, thus reducing both the server load and the response time.</p>";
+ $output .= "<p>Drupal has a caching mechanism which stores dynamically generated web pages in a database. By caching a web page, Drupal does not have to create the page each time someone wants to view it, instead it takes only one SQL query to display it, reducing response time and the server's load. Only pages requested by \"anonymous\" users are cached.</p>";
return $output;
}
function system_help_cron() {
global $base_url;
- $output .= "<p>Some settings require a <i>cron</i> or <i>crontab</i>. Cron, which stands for chronograph, is a periodic command scheduler: it executes commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period of <i>n</i> seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.</p>";
- $output .= "<p>Whenever <a href=\"$base_url/cron.php\">$base_url/cron.php</a> is accessed, cron will run: it checks for the jobs cron controls, and their periods in seconds. If a certain task wasn't executed in the last n seconds, where n is the period of that job, it will be executed. When all the executed commands terminate, cron is done.</p>";
- $output .= "<p>The recommended way to setup your cron system is to setup a Unix/Linux crontab that frequently visits <a href=\"$base_url/cron.php\">$base_url/cron.php</a>. Note that cron does not guarantee the commands will be executed at the specified interval. However, Drupal will try his best and run the crons as close to the specified intervals as possible. The more you visit cron.php, the more accurate cron will be.</p>";
- $output .= "<p>If your hosting company does not allow you to setup crontabs, you can always ask someone else to setup a crontab for you. After all, virtually any Unix/Linux machine with access to the internet can setup a crontab to frequently visit <a href=\"$base_url/cron.php\">$base_url/cron.php</a>.</p>";
- $output .= "<p>For the Unix/Linux crontab itself, use a browser like <i>lynx</i> or <i>wget</i> but make sure the process terminates: either use <code>/usr/bin/lynx -source $base_url/cron.php</code> or <code>/usr/bin/wget -O /dev/null $base_url/cron.php</code>. Take a look at the example scripts in the <code>scripts</code>-directory and make sure to adjust them to your needs. A good crontab-line to run the cron-script once every hour would be: <pre> 00 * * * * /home/www/drupal/scripts/cron-lynx.sh</pre>Note that it is essential to access <code>cron.php</code> using a browser; don't run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code>, or some features won't work as expected. For all the environment variables to be correct; use a browser to access <code>cron.php</code> on a publicly accessible domain.</p>";
+ $output .= "<p>Some modules require regularly scheduled actions, such as cleaning up logfiles. Cron, which stands for chronograph, is a periodic command scheduler executing commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period measured in seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.</p>";
+ $output .= "<p>Whenever <a href=\"$base_url/cron.php\">$base_url/cron.php</a> is accessed, cron will run: it calls the _cron hook in each module allowing the module to run tasks if they have not been executed in the last <i>n</i> seconds, where n is the period of that task. When all the tasks are finished, cron is done.</p>";
+ $output .= "<p>The recommended way to set up your cron system is to set up a Unix/Linux crontab entry (see \"man crontab\") that frequently visits <a href=\"$base_url/cron.php\">$base_url/cron.php</a>. Note that cron does not guarantee the commands will be executed at the specified interval. However, Drupal will try its best to run the tasks as close to the specified intervals as possible. The more you visit cron.php, the more accurate cron will be.</p>";
+ $output .= "<p>If your hosting company does not allow you to set up crontab entries, you can always ask someone else to set up an entry for you. After all, virtually any Unix/Linux machine with access to the internet can set up a crontab entry to frequently visit <a href=\"$base_url/cron.php\">$base_url/cron.php</a>.</p>";
+ $output .= "<p>For the Unix/Linux crontab itself, use a browser like <i>lynx</i> or <i>wget</i> but make sure the process terminates: either use <code>/usr/bin/lynx -source $base_url/cron.php</code> or <code>/usr/bin/wget -o /dev/null -O /dev/null $base_url/cron.php</code>. Take a look at the example scripts in the <code>scripts</code>-directory. Make sure to adjust them to fit your needs. A good crontab line to run the cron script once every hour would be: <pre> 00 * * * * /home/www/drupal/scripts/cron-lynx.sh</pre>Note that it is essential to access <code>cron.php</code> using a browser on the web site's domain; do not run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code> or some of the environment varibles will not be set correctly and features may not work as expected.</p>";
+
return $output;
}
@@ -37,7 +38,7 @@ function system_link($type) {
if ($type == "admin" && user_access("administer site configuration")) {
$help["general"] = t("General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.");
$help["themes"] = t("Select which themes are available to your users and specify the default theme.");
- $help["modules"] = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled.");
+ $help["modules"] = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations.");
$help["filters"] = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
menu("admin/system", "site configuration", "system_admin", $help["general"], 3);
@@ -56,7 +57,7 @@ function system_link($type) {
foreach (module_list(1) as $name) {
// NOTE: refresh the list because some modules might have been enabled/disabled.
if (module_hook($name, "settings")) {
- menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "description"));
+ menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "admin_help"));
}
}
menu("admin/system/filters", "filters", "system_admin", $help["filters"], 4);
@@ -69,7 +70,7 @@ function system_view_general() {
// general settings:
$output .= "<h3>". t("General settings") ."</h3>\n";
- $output .= form_textfield(t("Name"), "site_name", variable_get("site_name", "drupal"), 70, 70, t("The name of this website."));
+ $output .= form_textfield(t("Name"), "site_name", variable_get("site_name", "drupal"), 70, 70, t("The name of this web site."));
$output .= form_textfield(t("E-mail address"), "site_mail", variable_get("site_mail", ini_get("sendmail_from")), 70, 128, t("A valid e-mail address for this website, used by the auto-mailer during registration, new password requests, notifications, etc."));
$output .= form_textfield(t("Slogan"), "site_slogan", variable_get("site_slogan", ""), 70, 128, t("The slogan of this website. Some themes display a slogan when available."));
$output .= form_textarea(t("Mission"), "site_mission", variable_get("site_mission", ""), 70, 5, t("Your site's mission statement or focus."));
@@ -82,7 +83,7 @@ function system_view_general() {
// cron:
$output .= "<h3>". t("Cron settings") ."</h3>\n";
- $output .= form_select(t("Cron support"), "cron", variable_get("cron", 1), array(t("Disabled"), t("Enabled")), t("Enable or disable cron support. Enable this setting if you have setup a cron job. Check the ". l("cron documentation", "admin/system/help#cron") ." for information on setting up a cron job."));
+ $output .= form_select(t("Cron support"), "cron", variable_get("cron", 1), array(t("Disabled"), t("Enabled")), t("Enable or disable cron support. Enable this setting if you have set up a cron job. Check the ". l("cron documentation", "admin/system/help#cron") ." for information on setting up a cron job."));
$output .= "<hr />\n";
// caching:
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index 70da7475c..3396ab624 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -28,8 +28,8 @@ function taxonomy_perm() {
function taxonomy_link($type, $node = NULL) {
if ($type == "admin" && user_access("administer taxonomy")) {
- $help["taxonomy"] = "The taxonomy module allows you to classify posts into categories and subcategories; it allows multiple lists of categories for classification (controlled vocabularies) and offers the possibility of creating thesauri (controlled vocabularies that indicate the relationship of terms) and taxonomies (controlled vocabularies where relationships are indicated hierarchically).";
- $help["vocabulary"] = "When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot.org's or Kuro5hin.org's sections. For more complex implementations, you might create a hierarchical list of categories.";
+ $help["taxonomy"] = t("The taxonomy module allows you to classify content into categories and subcategories; it allows multiple lists of categories for classification (controlled vocabularies) and offers the possibility of creating thesauri (controlled vocabularies that indicate the relationship of terms) and taxonomies (controlled vocabularies where relationships are indicated hierarchically). To delete a term choose \"edit term\". To delete a vocabulary, and all its terms, choose \"edit vocabulary\".");
+ $help["vocabulary"] = t("When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node type (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot.org's or Kuro5hin.org's sections. For more complex implementations, you might create a hierarchical list of categories.");
menu("admin/taxonomy", "taxonomy", "taxonomy_admin", $help["taxonomy"], 3);
menu("admin/taxonomy/add/vocabulary", "create new vocabulary", "taxonomy_admin", $help["vocabulary"]);
@@ -797,62 +797,17 @@ function taxonomy_admin() {
}
function taxonomy_help() {
-?>
- <h3>Background</h3>
- <p>Classifying nodes allows for the organization of content into categories and subcategories of description. These categories can be used to organize and retrieve similarly described content. Drupal's <i>taxonomy.module</i> is an extremely flexible classification system that allows for multiple lists of categories for classification (controlled vocabularies) and offers the possibility of creating thesauri (controlled vocabularies that indicate the relationship of terms) and taxonomies (controlled vocabularies where relationships are indicated hierarchically). For details about <a href="http://www.eleganthack.com/archives/002165.html#002165">classification types</a> and insight into the development of <i>taxonomy.module</i>, see this <a href="http://www.drupal.org/node/view/55">drupal.org discussion</a>.</p>
-
- <h3>An example taxonomy: food</h3>
- <p>Dairy<br />
- --Milk<br />
- Drink<br />
- --Alchohol<br />
- --Pop<br />
- --Milk<br />
- Meat<br />
- --Beef<br />
- --Chicken<br />
- --Lamb<br />
- Spices<br />
- --Sugar</p>
- <p><b>Notes</b></p>
- <ul>
- <li>The term <i>Milk</i> appears within both <i>Dairy</i> and <i>Drink</i>. This is an example of <i>nmultiple parents</i> for a term.</li>
- <li>The order of siblings (e.g. <i>Beef</i>, <i>Chicken</i>, <i>Lamb</i>) in the taxonomy may be controlled with the <i>weight</i> parameter. </li>
- </ul>
-
- <h3>Vocabularies</h3>
- <p>When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to <a href="http://www.slashdot.com/">Slashdot's</a> sections. For more complex implementations, you might create a hierarchical list of categories such as the example <i>Food</i> taxonomy above.</p>
-
- <h4>Setting up a vocabulary</h4>
- <p>When you set up a controlled vocabulary, you will be asked to enter some descriptive data and define the attributes of this vocabulary. For example, if you select the <i>hierarchy</i> option, you will be defining a taxonomy or a thesaurus. If you select <i>related terms</i> option, you are allowing the definition of related terms as in a thesaurus. Selecting <i>multiple select</i> will allow you to describe a node using more than one term. That node will then appear in each term's page, thus increasing the chance that a user will find it.</p>
-
- <p><i>Vocabulary name</i><br />Required. The name for this vocabulary. Example: <i>Dairy</i>.<br />
- <br />
- <i>Description</i><br />Optional. Description of the vocabulary, can be used by modules and feeds.<br />
- <br />
- <i>Types</i><br />Required. The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.<br />
- <br />
- <i><a name="relatedterms"></a>Related terms</i><br />Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.<br />
- <br />
- <i><a name="hierarchy"></a>Hierarchy</i><br />Allows a tree-like taxonomy, as in our <i>Foods</i> example above<br />
- <br />
- <i>Multiple select</i><br />Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</p>
-
- <h4>Adding terms to a vocabulary</h4>
-<p>The options you see when adding a term to a vocabulary will depend on what you selected for <i>related terms</i>, <i>hierarchy </i>and <i>multiple select</i> when you created the corrosponding vocabulary.</p>
-
- <p><i>Term name</i><br />Required. The name for this term. Example: <i>Milk</i><br />
- <br />
- <i>Description</i><br />Optional. Description of the term that may be used by modules and RSS feeds. This is synonymous with a 'scope note'.<br />
- <br />
- <i><a name="parent"></a>Parent</i><br />Required. Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the "Broader term" indicator used in thesauri.<br />
- <br />
- <i><a name="synonyms"></a>Synonyms</i><br />Optional. Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <i>unauthorized terms</i>).</p>
- <h3>Displaying nodes organized by term(s)</h3>
- <p>In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed URL. For example, see <a href="<?php print url("taxonomy/page/or/1,2"); ?>"><?php print url("taxonomy/page/or/1,2"); ?></a>. Taxonomy URLs always contain a term ID or list of term IDs at the end of the URL (aka <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the <?php echo l("taxonomy overview", "admin/taxonomy") ?> page in the Admin and noting the number after the querystring parameter called <i>tid</i>. If you wish to see nodes from a collection of term IDs, separate each term ID with a comma. Also, the name of the querystring parameter may be <i>or</i> or <i>and</i>: <i>or</i> shows nodes which appear in <b>any</b> of the term IDs while <i>and</i> shows nodes in <b>all</b> the specified term IDs. Thus, <i>or</i> is less specific than <i>and</i>.</p>
-
- <h3>RSS feeds</h3>
- <p>Every term, or collection of terms, provides an <a href="http://backend.userland.com/stories/rss091">RSS</a> feed to which interested users may subscribe. The URL format for an sample RSS feed is <a href="<?php print url("node/feed/or/1,2"); ?>"><?php print url("node/feed/or/1,2"); ?></a>.</p>
- <?php
+
+ $output .= "<h3>Background</h3><p>Taxonomy is the science of classification, acording to a predetermined system, where the results are used for analysis, discussion, or information retreival. In Drupal the taxonomy.module allows you to define a taxonomy which is then used to classify the Drupal nodes. The module can create classification that can include multiple lists of categories (controlled vocabularies), as well as thesauri (controlled vocabularies that indicated the relationships of terms) and taxonomies (controlled vocabularies where relationships arehierarchical). For more details about <a href=\"www.eleganthack.com/archives/002165.html#002165\">classification types</a> and insight into the development of the <i>taxonomy.module</i>, see this <a href=\"http://www.drupal.org/node/view/55\">drupal.org discussion</a>.</p>";
+ $output .= "<h3>An example taxonomy: food</h3><p>Dairy<br />--Milk<br />Drink<br />--Alchohol<br />--Pop<br />--Milk<br />Meat<br />--Beef<br />--Chicken<br />--Lamb<br />Spices<br />--Sugar</p>";
+ $output .= "<p><b>Notes</b></p><ul><li>The term <i>Milk</i> appears within both <i>Dairy</i> and <i>Drink</i>. This is an example of <i>multiple parents</i> for a term.</li><li>In Drupal the order of siblings (e.g. <i>Beef</i>, <i>Chicken</i>, <i>Lamb</i>) in a taxonomy may be controlled with the <i>weight</i> parameter.</li></ul>";
+ $output .= "<h3>Vocabularies</h3><p>When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to <a href=\"http://www.slashdot.com/\">Slashdot's</a> sections. For more complex implementations, you might create a hierarchical list of categories such as <i>Food</i> taxonomy shown above.</p>";
+ $output .= "<h4>Setting up a vocabulary</h4><p>When setting up a controlled vocabulary, if you select the <i>hierarchy</i> option, you will be defining a taxonomy or a thesaurus. If you select the <i>related terms</i> option, you are allowing the definition of related terms, think <i>see also</i>, as in a thesaurus. Selecting <i>multiple select</i> will allow you to describe a node using more than one term. That node will then appear in each term's page, thus increasing the chance that a user will find it.</p>";
+ $output .= "<p>When setting up a controlled vocabulary you are asked for: <ul><li><b>Vocabulary name</b> (Required) -- The name for this vocabulary. Example: <i>Dairy</i>.</li><li><b>Description</b> (Optional) -- Description of the vocabulary, this can be used by modules and feeds.</li><li><b>Types</b> (Required) -- The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.</li><li><a name=\"relatedterms\"></a><b>Related terms</b> -- Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.</li><li><a name=\"hierarchy\"></a><b>Hierarchy</b> -- Allows a tree-like taxonomy, as in our <i>Foods</i> example above</li><li><b>Multiple select</b> -- Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</li><li><b>Required</b> -- Each node has to have a term in this vacabulary associated with it.</li><li><b>Weight</b> -- The over all weight for this vocaulary in listings with multiple vacabularies.</ul></p>";
+ $output .= "<h4>Adding terms to a vocabulary</h4><p>Once done defining the vocabulary, you have to add terms to it to make it useful. The options you see when adding a term to a vocabulary will depend on what you selected for <i>related terms</i>, <i>hierarchy </i>and <i>multiple select</i>. These options are:</p>";
+ $output .= "<p><ul><li><b>Term name</b> (Required) -- The name for this term. Example: <i>Milk</i></li><li><b>Description</b> (Optional) -- Description of the term that may be used by modules and feeds. This is synonymous with a 'scope note'.</li><li><b><a name=\"parent\"></a>Parent</b> (Required) -- Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the \"Broader term\" indicator used in thesauri.</li><li><b><a name=\"synonyms\"></a>Synonyms</b> (Optional) -- Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <i>unauthorized terms</i>)</li><li><b>Weight</b> (Optional) -- The weight is used to sort the terms of this vocabulary.</li></ul></p>";
+ $output .= "<h3><a name=\"taxonomyURL\"></a>Displaying nodes organized by term(s)</h3><p>In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed Taxonomy URL. For example, ". l("taxonomy/page/or/1,2","taxonomy/pages/or/1,2") .". Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the ". l("taxonomy overview", "admin/taxonomy") ." page and noting the number at the end or the URL. To build a Taxonomy URL start with \"taxonomy/page\". Now add the querystring parameter, either <i>or</i>, which chooses nodes tagged with <b>any</b> of the given term IDs, or <i>and</i>, which chooses nodes tagged with <b>all</b> of the given Term IDs. Thus <i>or</i> is less specific than <i>and</i>. Finally add a comma seperated list of term IDs.</p>";
+ $output .= "<h3>RSS feeds</h3><p>Every term, or collection of terms, provides an <a href=\"http://backend.userland.com/stories/rss\">RSS</a> feed to which interested users may subscribe. The URL format for an sample RSS feed is ". l("node/feed/or/1,2","node/feed/or/1,2") .". Built like a Taxonomy URL, ". l("see above", "admin/taxonomy/help#taxonomyURL") ." it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.</p>";
+ return t($output);
}
?>
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 70da7475c..3396ab624 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -28,8 +28,8 @@ function taxonomy_perm() {
function taxonomy_link($type, $node = NULL) {
if ($type == "admin" && user_access("administer taxonomy")) {
- $help["taxonomy"] = "The taxonomy module allows you to classify posts into categories and subcategories; it allows multiple lists of categories for classification (controlled vocabularies) and offers the possibility of creating thesauri (controlled vocabularies that indicate the relationship of terms) and taxonomies (controlled vocabularies where relationships are indicated hierarchically).";
- $help["vocabulary"] = "When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot.org's or Kuro5hin.org's sections. For more complex implementations, you might create a hierarchical list of categories.";
+ $help["taxonomy"] = t("The taxonomy module allows you to classify content into categories and subcategories; it allows multiple lists of categories for classification (controlled vocabularies) and offers the possibility of creating thesauri (controlled vocabularies that indicate the relationship of terms) and taxonomies (controlled vocabularies where relationships are indicated hierarchically). To delete a term choose \"edit term\". To delete a vocabulary, and all its terms, choose \"edit vocabulary\".");
+ $help["vocabulary"] = t("When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node type (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot.org's or Kuro5hin.org's sections. For more complex implementations, you might create a hierarchical list of categories.");
menu("admin/taxonomy", "taxonomy", "taxonomy_admin", $help["taxonomy"], 3);
menu("admin/taxonomy/add/vocabulary", "create new vocabulary", "taxonomy_admin", $help["vocabulary"]);
@@ -797,62 +797,17 @@ function taxonomy_admin() {
}
function taxonomy_help() {
-?>
- <h3>Background</h3>
- <p>Classifying nodes allows for the organization of content into categories and subcategories of description. These categories can be used to organize and retrieve similarly described content. Drupal's <i>taxonomy.module</i> is an extremely flexible classification system that allows for multiple lists of categories for classification (controlled vocabularies) and offers the possibility of creating thesauri (controlled vocabularies that indicate the relationship of terms) and taxonomies (controlled vocabularies where relationships are indicated hierarchically). For details about <a href="http://www.eleganthack.com/archives/002165.html#002165">classification types</a> and insight into the development of <i>taxonomy.module</i>, see this <a href="http://www.drupal.org/node/view/55">drupal.org discussion</a>.</p>
-
- <h3>An example taxonomy: food</h3>
- <p>Dairy<br />
- --Milk<br />
- Drink<br />
- --Alchohol<br />
- --Pop<br />
- --Milk<br />
- Meat<br />
- --Beef<br />
- --Chicken<br />
- --Lamb<br />
- Spices<br />
- --Sugar</p>
- <p><b>Notes</b></p>
- <ul>
- <li>The term <i>Milk</i> appears within both <i>Dairy</i> and <i>Drink</i>. This is an example of <i>nmultiple parents</i> for a term.</li>
- <li>The order of siblings (e.g. <i>Beef</i>, <i>Chicken</i>, <i>Lamb</i>) in the taxonomy may be controlled with the <i>weight</i> parameter. </li>
- </ul>
-
- <h3>Vocabularies</h3>
- <p>When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to <a href="http://www.slashdot.com/">Slashdot's</a> sections. For more complex implementations, you might create a hierarchical list of categories such as the example <i>Food</i> taxonomy above.</p>
-
- <h4>Setting up a vocabulary</h4>
- <p>When you set up a controlled vocabulary, you will be asked to enter some descriptive data and define the attributes of this vocabulary. For example, if you select the <i>hierarchy</i> option, you will be defining a taxonomy or a thesaurus. If you select <i>related terms</i> option, you are allowing the definition of related terms as in a thesaurus. Selecting <i>multiple select</i> will allow you to describe a node using more than one term. That node will then appear in each term's page, thus increasing the chance that a user will find it.</p>
-
- <p><i>Vocabulary name</i><br />Required. The name for this vocabulary. Example: <i>Dairy</i>.<br />
- <br />
- <i>Description</i><br />Optional. Description of the vocabulary, can be used by modules and feeds.<br />
- <br />
- <i>Types</i><br />Required. The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.<br />
- <br />
- <i><a name="relatedterms"></a>Related terms</i><br />Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.<br />
- <br />
- <i><a name="hierarchy"></a>Hierarchy</i><br />Allows a tree-like taxonomy, as in our <i>Foods</i> example above<br />
- <br />
- <i>Multiple select</i><br />Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</p>
-
- <h4>Adding terms to a vocabulary</h4>
-<p>The options you see when adding a term to a vocabulary will depend on what you selected for <i>related terms</i>, <i>hierarchy </i>and <i>multiple select</i> when you created the corrosponding vocabulary.</p>
-
- <p><i>Term name</i><br />Required. The name for this term. Example: <i>Milk</i><br />
- <br />
- <i>Description</i><br />Optional. Description of the term that may be used by modules and RSS feeds. This is synonymous with a 'scope note'.<br />
- <br />
- <i><a name="parent"></a>Parent</i><br />Required. Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the "Broader term" indicator used in thesauri.<br />
- <br />
- <i><a name="synonyms"></a>Synonyms</i><br />Optional. Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <i>unauthorized terms</i>).</p>
- <h3>Displaying nodes organized by term(s)</h3>
- <p>In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed URL. For example, see <a href="<?php print url("taxonomy/page/or/1,2"); ?>"><?php print url("taxonomy/page/or/1,2"); ?></a>. Taxonomy URLs always contain a term ID or list of term IDs at the end of the URL (aka <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the <?php echo l("taxonomy overview", "admin/taxonomy") ?> page in the Admin and noting the number after the querystring parameter called <i>tid</i>. If you wish to see nodes from a collection of term IDs, separate each term ID with a comma. Also, the name of the querystring parameter may be <i>or</i> or <i>and</i>: <i>or</i> shows nodes which appear in <b>any</b> of the term IDs while <i>and</i> shows nodes in <b>all</b> the specified term IDs. Thus, <i>or</i> is less specific than <i>and</i>.</p>
-
- <h3>RSS feeds</h3>
- <p>Every term, or collection of terms, provides an <a href="http://backend.userland.com/stories/rss091">RSS</a> feed to which interested users may subscribe. The URL format for an sample RSS feed is <a href="<?php print url("node/feed/or/1,2"); ?>"><?php print url("node/feed/or/1,2"); ?></a>.</p>
- <?php
+
+ $output .= "<h3>Background</h3><p>Taxonomy is the science of classification, acording to a predetermined system, where the results are used for analysis, discussion, or information retreival. In Drupal the taxonomy.module allows you to define a taxonomy which is then used to classify the Drupal nodes. The module can create classification that can include multiple lists of categories (controlled vocabularies), as well as thesauri (controlled vocabularies that indicated the relationships of terms) and taxonomies (controlled vocabularies where relationships arehierarchical). For more details about <a href=\"www.eleganthack.com/archives/002165.html#002165\">classification types</a> and insight into the development of the <i>taxonomy.module</i>, see this <a href=\"http://www.drupal.org/node/view/55\">drupal.org discussion</a>.</p>";
+ $output .= "<h3>An example taxonomy: food</h3><p>Dairy<br />--Milk<br />Drink<br />--Alchohol<br />--Pop<br />--Milk<br />Meat<br />--Beef<br />--Chicken<br />--Lamb<br />Spices<br />--Sugar</p>";
+ $output .= "<p><b>Notes</b></p><ul><li>The term <i>Milk</i> appears within both <i>Dairy</i> and <i>Drink</i>. This is an example of <i>multiple parents</i> for a term.</li><li>In Drupal the order of siblings (e.g. <i>Beef</i>, <i>Chicken</i>, <i>Lamb</i>) in a taxonomy may be controlled with the <i>weight</i> parameter.</li></ul>";
+ $output .= "<h3>Vocabularies</h3><p>When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to <a href=\"http://www.slashdot.com/\">Slashdot's</a> sections. For more complex implementations, you might create a hierarchical list of categories such as <i>Food</i> taxonomy shown above.</p>";
+ $output .= "<h4>Setting up a vocabulary</h4><p>When setting up a controlled vocabulary, if you select the <i>hierarchy</i> option, you will be defining a taxonomy or a thesaurus. If you select the <i>related terms</i> option, you are allowing the definition of related terms, think <i>see also</i>, as in a thesaurus. Selecting <i>multiple select</i> will allow you to describe a node using more than one term. That node will then appear in each term's page, thus increasing the chance that a user will find it.</p>";
+ $output .= "<p>When setting up a controlled vocabulary you are asked for: <ul><li><b>Vocabulary name</b> (Required) -- The name for this vocabulary. Example: <i>Dairy</i>.</li><li><b>Description</b> (Optional) -- Description of the vocabulary, this can be used by modules and feeds.</li><li><b>Types</b> (Required) -- The list of node types you want to associate this vocabulary with. Some available types are: blog, book, forum, page, story.</li><li><a name=\"relatedterms\"></a><b>Related terms</b> -- Allows relationships between terms within this vocabulary. Think of these as <i>see also</i>-references.</li><li><a name=\"hierarchy\"></a><b>Hierarchy</b> -- Allows a tree-like taxonomy, as in our <i>Foods</i> example above</li><li><b>Multiple select</b> -- Allows nodes to be described using more than one term. Nodes may then appear on multiple taxonomy pages.</li><li><b>Required</b> -- Each node has to have a term in this vacabulary associated with it.</li><li><b>Weight</b> -- The over all weight for this vocaulary in listings with multiple vacabularies.</ul></p>";
+ $output .= "<h4>Adding terms to a vocabulary</h4><p>Once done defining the vocabulary, you have to add terms to it to make it useful. The options you see when adding a term to a vocabulary will depend on what you selected for <i>related terms</i>, <i>hierarchy </i>and <i>multiple select</i>. These options are:</p>";
+ $output .= "<p><ul><li><b>Term name</b> (Required) -- The name for this term. Example: <i>Milk</i></li><li><b>Description</b> (Optional) -- Description of the term that may be used by modules and feeds. This is synonymous with a 'scope note'.</li><li><b><a name=\"parent\"></a>Parent</b> (Required) -- Select the term under which this term is a subset -- the branch of the hierarchy that this term belongs under. This is also known as the \"Broader term\" indicator used in thesauri.</li><li><b><a name=\"synonyms\"></a>Synonyms</b> (Optional) -- Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus (i.e. <i>unauthorized terms</i>)</li><li><b>Weight</b> (Optional) -- The weight is used to sort the terms of this vocabulary.</li></ul></p>";
+ $output .= "<h3><a name=\"taxonomyURL\"></a>Displaying nodes organized by term(s)</h3><p>In order to view the nodes associated with a term or a collection of terms, you should browse to a properly formed Taxonomy URL. For example, ". l("taxonomy/page/or/1,2","taxonomy/pages/or/1,2") .". Taxonomy URLs always contain one or more term IDs (tid) at the end of the URL (a.k.a the <i>querystring</i>). You may learn the term ID for a given term by hovering over that term in the ". l("taxonomy overview", "admin/taxonomy") ." page and noting the number at the end or the URL. To build a Taxonomy URL start with \"taxonomy/page\". Now add the querystring parameter, either <i>or</i>, which chooses nodes tagged with <b>any</b> of the given term IDs, or <i>and</i>, which chooses nodes tagged with <b>all</b> of the given Term IDs. Thus <i>or</i> is less specific than <i>and</i>. Finally add a comma seperated list of term IDs.</p>";
+ $output .= "<h3>RSS feeds</h3><p>Every term, or collection of terms, provides an <a href=\"http://backend.userland.com/stories/rss\">RSS</a> feed to which interested users may subscribe. The URL format for an sample RSS feed is ". l("node/feed/or/1,2","node/feed/or/1,2") .". Built like a Taxonomy URL, ". l("see above", "admin/taxonomy/help#taxonomyURL") ." it starts with \"node/feed\", then has the querystring parameter, and finally the Term IDs.</p>";
+ return t($output);
}
?>
diff --git a/modules/throttle.module b/modules/throttle.module
index f84184ae8..fa1e20298 100644
--- a/modules/throttle.module
+++ b/modules/throttle.module
@@ -3,6 +3,7 @@
/* System hook, sets description of module in admin page */
function throttle_system($field) {
$system["description"] = t("Allows configuration of congestion control auto-throttle mechanism.");
+ $system["admin_help"] = t("If your site gets popular, or comes under a \"Denial of Service\" (DOS) attack, your hardware might become overwhelmed. These settings allow you to \"slow down\" the access to your site. To use throttle you need to have the <a href=\"%access\">access log</a> enabled. For Drupal to preform throttling it needs to do an extra database query. This extra query happens on page displays. <b>Auto-throttle probability limiter</b> tells Drupal to do this extra DB query once every \"x\" page displays, where \"x\" is the percentage. So if it is set to 10%, the default, then for every 100 web pages it displays, it will preform the extra query ten time. ", array("%access" => url("admin/system/modules/statistics")));
return $system[$field];
}
@@ -19,70 +20,38 @@ function throttle_perm() {
/* Administrative help page */
function throttle_help() {
- ?>
- <h3>Introduction</h3>
+ $output .= "<h3>Introduction</h3><p>This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the ". l("statistics.module","admin/statistics") .". The auto-throttle mechanism allows your site to automatically adapt to different server levels.</p>";
+ $output .= "<p>This module also adds a block that displays the current status of the throttle. You must have ". l("\"access throttle block\"","admin/user/permission") ." privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.</p>";
+ $output .= "<p>The auto-throttle mechanism performs an extra database query in order to determine what the current throttle level should be. Fortunately the throttle can be tuned so these database queries only occur on a fraction of all pages geenrated by your site, reducing the overhead to an insignificant amount. Additionally, when the top-most throttle level is reached, all throttle queries are suspended for a configurable period of time. More detail follows.</p>";
+ $output .= "<p>As with any module, the <i>throttle.module</i> needs to be ". l("enabled","admin/system/modules") ." before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.</p>";
+ $output .= "<h3>Configuring the throttle module</h3><p>The ". l("configuration section", "admin/system/modules/throttle") ." for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.</p>";
+ $output .= "<h4>enable auto-throttle:</h4><blockquote>This first option on the throttle module configuration screen allows you to enable or disable the auto-throttling mechanism. Note that the access-log must also be enabled via the ". l("statistics.module", "admin/system/modules/statistics") ." for the auto-throttling mechanism to have any affect.</blockquote>";
+ $output .= "<h4>auto-throttle multiplier:</h4><blockquote><p>This second option allows you to tune the auto-throttle mechanism. The auto-throttle mechanism supports six throttle levels, from 0 (off) to 5 (maximum). The current throttle level is based upon how many pages have been accessed on your site in the past 60 seconds - the more pages being displayed, the higher the throttle level. This multiplier defines how many hits are required to switch from one throttle level to the next.</p>";
+ $output .= "<p>For example, with a throttle multiplier of 20: Once 20 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 1. Once 40 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 2. And so on, until 100 pages are accessed on your site within a period of 60 seconds, at which time the throttle level will be set to a maximum level of 5.</p>";
+ $output .= "<p>Upon reaching a throttle level of 5, access logs and the auto-throttle checking mechanism is automatically disabled. It is only renabled by cron after a period of time defined by \"auto-throttle cron test\", explained below.</p></blockquote>";
+ $output .= "<h4>auto-throttle probability limiter:</h4><blockquote><p>This option allows you to minimize the performance impact of the auto-throttle. If we refer to the probability limiter as P, then P\% of all pages generated by your site will perform an extra database query to verify that the current throttle level is appropriate to the current server load.</p>";
+ $output .= "<p>As a rule of thumb, the higher your multiplier, the lower your probability limiter should be. For example, if you have a multiplier of 100, then you logically don't need to check the throttle level more than once out of every 100 page views, so the probability limiter should be set to 1\%. As database queries are \"expensive\", it's recommended that you keep the probability limiter to the smallest percentage possible, while still high enough to react quickly to a change in server load.</p></blockquote>";
+ $output .= "<h4>auto-throttle cron test:</h4><blockquote><p>The auto-throttle dynamically adjusts its level upward, but not downward. That is to say, if you have a multiplier of 20 and you get 45 hits in one minute, your throttle level will be adjusted to a level of 2. If a few minutes later you only get 35 hits in one minute, the throttle level will <b>NOT</b> be adjusted down to a level of 1. This prevents the throttle from bouncing back and forth between two levels.</p>";
+ $output .= "<p>In order for the throttle level to be dropped, \"cron.php\" must be called regularly. This option then defines how often the level will be dropped by one to test the server load. If the server load is no longer as high as it was, the level will stay where it is, until the cron test period passes again and cron drops the throttle level again. This process repeats until the throttle is returned to a throttle level of 0.</p></blockquote>";
+ $output .= "<h3>Throttle block</h3><p>This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the ". l("\"access throttle block\"","admin/user/permission") ." permission bit required to view this block. It does not display information that would interest a normal site end-user.</p>";
+ $output .= "<p>Don't forget to enable the block ". l("here", "admin/block") .".</p>";
+ $output .= "<h3>Permissions</h3><p>This module has one permission that needs to be configured in ". l("user permissions", "admin/user/permission") .".</p>";
+ $output .= "<ul><li><i>access throttle block</i> - enable for user roles that get to view the throttle block.</li></ul>";
+ $output .= "<h3>For programmers: throttle_status()</h3><p>The function <code>throttle_status()</code> will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.</p>";
+ $output .= "<p>To implement the throttle, you should do something like this:";
+ $output .= "<pre> \$throttle = 0;
+ /* verify that the statitistics module is installed */
+ if (function_exists(throttle_status) {
+ \$throttle = throttle_status()
+ }
+ if (\$throttle >= \$my_throttle_value) {
+ // throttle limit reached, disable stuff
+ }
+ else {
+ // throttle limit not reached, execute normally
+ }</pre></p>";
+ return t($output);
- <p>This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the statistics.module. The auto-throttle mechanism allows your site to automatically adapt to different server levels.</p>
-
- <p>This module also adds a block that displays the current status of the throttle. You must have "access throttle block" privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.</p>
-
- <p>The auto-throttle mechanism performs an extra database query in order to determine what the current throttle level should be. Fortunately the throttle can be tuned so these database queries only occur on a fraction of all pages geenrated by your site, reducing the overhead to an insignificant amount. Additionally, when the top-most throttle level is reached, all throttle queries are suspended for a configurable period of time. More detail follows.</p>
-
- <p>As with any new module, <i>throttle.module</i> needs to be enabled <?php print l("here", "admin/system/modules"); ?> before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.</p>
-
- <h3>Configuring the throttle module</h3>
-
- <p>The configuration section for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.</p>
-
- <h4>enable auto-throttle:</h4>
- <blockquote>This first option on the throttle module configuration screen allows you to enable or disable the auto-throttling mechanism. Note that the access-log must also be enabled via the statistics.module for the auto-throttling mechanism to have any affect.</blockquote>
-
- <h4>auto-throttle multiplier:</h4>
- <blockquote><p>This second option allows you to tune the auto-throttle mechanism. The auto-throttle mechanism supports six throttle levels, from 0 (off) to 5 (maximum). The current throttle level is based upon how many pages have been accessed on your site in the past 60 seconds - the more pages being displayed, the higher the throttle level. This multiplier defines how many hits are required to switch from one throttle level to the next.</p>
-
- <p>For example, with a throttle multiplier of 20: Once 20 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 1. Once 40 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 2. And so on, until 100 pages are accessed on your site within a period of 60 seconds, at which time the throttle level will be set to a maximum level of 5.</p>
-
- <p>Upon reaching a throttle level of 5, access logs and the auto-throttle checking mechanism is automatically disabled. It is only renabled by cron after a period of time defined by "auto-throttle cron test", explained below.</p></blockquote>
-
- <h4>auto-throttle probability limiter:</h4>
- <blockquote><p>This option allows you to minimize the performance impact of the auto-throttle. If we refer to the probability limiter as P, then P% of all pages generated by your site will perform an extra database query to verify that the current throttle level is appropriate to the current server load.</p>
-
- <p>As a rule of thumb, the higher your multiplier, the lower your probability limiter should be. For example, if you have a multiplier of 100, then you logically don't need to check the throttle level more than once out of every 100 page views, so the probability limiter should be set to 1%. As database queries are "expensive", it's recommended that you keep the probability limiter to the smallest percentage possible, while still high enough to react quickly to a change in server load.</p></blockquote>
-
- <h4>auto-throttle cron test:</h4>
- <blockquote><p>The auto-throttle dynamically adjusts its level upward, but not downward. That is to say, if you have a multiplier of 20 and you get 45 hits in one minute, your throttle level will be adjusted to a level of 2. If a few minutes later you only get 35 hits in one minute, the throttle level will NOT be adjusted down to a level of 1. This prevents the throttle from bouncing back and forth between two levels.</p>
-
- <p>In order for the throttle level to be dropped, cron must be enabled. This option then defines how often the level will be dropped by one to test the server load. If the server load is no longer as high as it was, the level will stay where it is, until the cron test period passes again and cron drops the throttle level again. This process repeats until the throttle is returned to a throttle level of 0.</p></blockquote>
-
- <h3>Throttle block</h3>
-
- <p>This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the "access throttle block" permission bit required to view this block. It does not display information that would interest a normal site end-user.</p>
-
- <p>Don't forget to enable the block <?php print l("here", "admin/block"); ?>.</p>
-
-<h3>Permissions</h3>
-<p>This module has one permission that needs to be configured in
-<?php print l("user permissions", "admin/user/permission"); ?>.</p>
-<ul>
- <li><i>access throttle block</i> - enable for user roles that get to view the throttle block.</li>
-</ul>
-
-<h3>For programmers: throttle_status()</h3>
-<p>The function <code>throttle_status()</code> will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.</p>
-<p>To implement the throttle, you should do something like this:
-<pre> $throttle = 0;
- /* verify that the statitistics module is installed */
- if (function_exists(throttle_status) {
- $throttle = throttle_status()
- }
- if ($throttle >= $my_throttle_value) {
- // throttle limit reached, disable stuff
- }
- else {
- // throttle limit not reached, execute normally
- }</pre></p>
-
- <?php
}
diff --git a/modules/throttle/throttle.module b/modules/throttle/throttle.module
index f84184ae8..fa1e20298 100644
--- a/modules/throttle/throttle.module
+++ b/modules/throttle/throttle.module
@@ -3,6 +3,7 @@
/* System hook, sets description of module in admin page */
function throttle_system($field) {
$system["description"] = t("Allows configuration of congestion control auto-throttle mechanism.");
+ $system["admin_help"] = t("If your site gets popular, or comes under a \"Denial of Service\" (DOS) attack, your hardware might become overwhelmed. These settings allow you to \"slow down\" the access to your site. To use throttle you need to have the <a href=\"%access\">access log</a> enabled. For Drupal to preform throttling it needs to do an extra database query. This extra query happens on page displays. <b>Auto-throttle probability limiter</b> tells Drupal to do this extra DB query once every \"x\" page displays, where \"x\" is the percentage. So if it is set to 10%, the default, then for every 100 web pages it displays, it will preform the extra query ten time. ", array("%access" => url("admin/system/modules/statistics")));
return $system[$field];
}
@@ -19,70 +20,38 @@ function throttle_perm() {
/* Administrative help page */
function throttle_help() {
- ?>
- <h3>Introduction</h3>
+ $output .= "<h3>Introduction</h3><p>This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the ". l("statistics.module","admin/statistics") .". The auto-throttle mechanism allows your site to automatically adapt to different server levels.</p>";
+ $output .= "<p>This module also adds a block that displays the current status of the throttle. You must have ". l("\"access throttle block\"","admin/user/permission") ." privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.</p>";
+ $output .= "<p>The auto-throttle mechanism performs an extra database query in order to determine what the current throttle level should be. Fortunately the throttle can be tuned so these database queries only occur on a fraction of all pages geenrated by your site, reducing the overhead to an insignificant amount. Additionally, when the top-most throttle level is reached, all throttle queries are suspended for a configurable period of time. More detail follows.</p>";
+ $output .= "<p>As with any module, the <i>throttle.module</i> needs to be ". l("enabled","admin/system/modules") ." before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.</p>";
+ $output .= "<h3>Configuring the throttle module</h3><p>The ". l("configuration section", "admin/system/modules/throttle") ." for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.</p>";
+ $output .= "<h4>enable auto-throttle:</h4><blockquote>This first option on the throttle module configuration screen allows you to enable or disable the auto-throttling mechanism. Note that the access-log must also be enabled via the ". l("statistics.module", "admin/system/modules/statistics") ." for the auto-throttling mechanism to have any affect.</blockquote>";
+ $output .= "<h4>auto-throttle multiplier:</h4><blockquote><p>This second option allows you to tune the auto-throttle mechanism. The auto-throttle mechanism supports six throttle levels, from 0 (off) to 5 (maximum). The current throttle level is based upon how many pages have been accessed on your site in the past 60 seconds - the more pages being displayed, the higher the throttle level. This multiplier defines how many hits are required to switch from one throttle level to the next.</p>";
+ $output .= "<p>For example, with a throttle multiplier of 20: Once 20 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 1. Once 40 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 2. And so on, until 100 pages are accessed on your site within a period of 60 seconds, at which time the throttle level will be set to a maximum level of 5.</p>";
+ $output .= "<p>Upon reaching a throttle level of 5, access logs and the auto-throttle checking mechanism is automatically disabled. It is only renabled by cron after a period of time defined by \"auto-throttle cron test\", explained below.</p></blockquote>";
+ $output .= "<h4>auto-throttle probability limiter:</h4><blockquote><p>This option allows you to minimize the performance impact of the auto-throttle. If we refer to the probability limiter as P, then P\% of all pages generated by your site will perform an extra database query to verify that the current throttle level is appropriate to the current server load.</p>";
+ $output .= "<p>As a rule of thumb, the higher your multiplier, the lower your probability limiter should be. For example, if you have a multiplier of 100, then you logically don't need to check the throttle level more than once out of every 100 page views, so the probability limiter should be set to 1\%. As database queries are \"expensive\", it's recommended that you keep the probability limiter to the smallest percentage possible, while still high enough to react quickly to a change in server load.</p></blockquote>";
+ $output .= "<h4>auto-throttle cron test:</h4><blockquote><p>The auto-throttle dynamically adjusts its level upward, but not downward. That is to say, if you have a multiplier of 20 and you get 45 hits in one minute, your throttle level will be adjusted to a level of 2. If a few minutes later you only get 35 hits in one minute, the throttle level will <b>NOT</b> be adjusted down to a level of 1. This prevents the throttle from bouncing back and forth between two levels.</p>";
+ $output .= "<p>In order for the throttle level to be dropped, \"cron.php\" must be called regularly. This option then defines how often the level will be dropped by one to test the server load. If the server load is no longer as high as it was, the level will stay where it is, until the cron test period passes again and cron drops the throttle level again. This process repeats until the throttle is returned to a throttle level of 0.</p></blockquote>";
+ $output .= "<h3>Throttle block</h3><p>This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the ". l("\"access throttle block\"","admin/user/permission") ." permission bit required to view this block. It does not display information that would interest a normal site end-user.</p>";
+ $output .= "<p>Don't forget to enable the block ". l("here", "admin/block") .".</p>";
+ $output .= "<h3>Permissions</h3><p>This module has one permission that needs to be configured in ". l("user permissions", "admin/user/permission") .".</p>";
+ $output .= "<ul><li><i>access throttle block</i> - enable for user roles that get to view the throttle block.</li></ul>";
+ $output .= "<h3>For programmers: throttle_status()</h3><p>The function <code>throttle_status()</code> will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.</p>";
+ $output .= "<p>To implement the throttle, you should do something like this:";
+ $output .= "<pre> \$throttle = 0;
+ /* verify that the statitistics module is installed */
+ if (function_exists(throttle_status) {
+ \$throttle = throttle_status()
+ }
+ if (\$throttle >= \$my_throttle_value) {
+ // throttle limit reached, disable stuff
+ }
+ else {
+ // throttle limit not reached, execute normally
+ }</pre></p>";
+ return t($output);
- <p>This Drupal module allows you to enable and configure the auto-throttle congestion control mechanism offered by the statistics.module. The auto-throttle mechanism allows your site to automatically adapt to different server levels.</p>
-
- <p>This module also adds a block that displays the current status of the throttle. You must have "access throttle block" privileges to view the block. As a general rule of thumb, only site administrators should be granted access to this block.</p>
-
- <p>The auto-throttle mechanism performs an extra database query in order to determine what the current throttle level should be. Fortunately the throttle can be tuned so these database queries only occur on a fraction of all pages geenrated by your site, reducing the overhead to an insignificant amount. Additionally, when the top-most throttle level is reached, all throttle queries are suspended for a configurable period of time. More detail follows.</p>
-
- <p>As with any new module, <i>throttle.module</i> needs to be enabled <?php print l("here", "admin/system/modules"); ?> before you can use it. Also refer to the permissions section below if you wish to access the throttle statistics block.</p>
-
- <h3>Configuring the throttle module</h3>
-
- <p>The configuration section for the throttle allows you to turn it on and off, as well as to fine-tune how sensitive it is.</p>
-
- <h4>enable auto-throttle:</h4>
- <blockquote>This first option on the throttle module configuration screen allows you to enable or disable the auto-throttling mechanism. Note that the access-log must also be enabled via the statistics.module for the auto-throttling mechanism to have any affect.</blockquote>
-
- <h4>auto-throttle multiplier:</h4>
- <blockquote><p>This second option allows you to tune the auto-throttle mechanism. The auto-throttle mechanism supports six throttle levels, from 0 (off) to 5 (maximum). The current throttle level is based upon how many pages have been accessed on your site in the past 60 seconds - the more pages being displayed, the higher the throttle level. This multiplier defines how many hits are required to switch from one throttle level to the next.</p>
-
- <p>For example, with a throttle multiplier of 20: Once 20 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 1. Once 40 pages have been accessed on your site within a period of 60 seconds, the throttle level will be incremented to a level of 2. And so on, until 100 pages are accessed on your site within a period of 60 seconds, at which time the throttle level will be set to a maximum level of 5.</p>
-
- <p>Upon reaching a throttle level of 5, access logs and the auto-throttle checking mechanism is automatically disabled. It is only renabled by cron after a period of time defined by "auto-throttle cron test", explained below.</p></blockquote>
-
- <h4>auto-throttle probability limiter:</h4>
- <blockquote><p>This option allows you to minimize the performance impact of the auto-throttle. If we refer to the probability limiter as P, then P% of all pages generated by your site will perform an extra database query to verify that the current throttle level is appropriate to the current server load.</p>
-
- <p>As a rule of thumb, the higher your multiplier, the lower your probability limiter should be. For example, if you have a multiplier of 100, then you logically don't need to check the throttle level more than once out of every 100 page views, so the probability limiter should be set to 1%. As database queries are "expensive", it's recommended that you keep the probability limiter to the smallest percentage possible, while still high enough to react quickly to a change in server load.</p></blockquote>
-
- <h4>auto-throttle cron test:</h4>
- <blockquote><p>The auto-throttle dynamically adjusts its level upward, but not downward. That is to say, if you have a multiplier of 20 and you get 45 hits in one minute, your throttle level will be adjusted to a level of 2. If a few minutes later you only get 35 hits in one minute, the throttle level will NOT be adjusted down to a level of 1. This prevents the throttle from bouncing back and forth between two levels.</p>
-
- <p>In order for the throttle level to be dropped, cron must be enabled. This option then defines how often the level will be dropped by one to test the server load. If the server load is no longer as high as it was, the level will stay where it is, until the cron test period passes again and cron drops the throttle level again. This process repeats until the throttle is returned to a throttle level of 0.</p></blockquote>
-
- <h3>Throttle block</h3>
-
- <p>This block displays some statistics regarding the current throttle and its configuration. It is recommended that only site administrators receive the "access throttle block" permission bit required to view this block. It does not display information that would interest a normal site end-user.</p>
-
- <p>Don't forget to enable the block <?php print l("here", "admin/block"); ?>.</p>
-
-<h3>Permissions</h3>
-<p>This module has one permission that needs to be configured in
-<?php print l("user permissions", "admin/user/permission"); ?>.</p>
-<ul>
- <li><i>access throttle block</i> - enable for user roles that get to view the throttle block.</li>
-</ul>
-
-<h3>For programmers: throttle_status()</h3>
-<p>The function <code>throttle_status()</code> will return a number from 0 to 5. 0 means that there is no throttle enabled at this time. Each number above that is a progressively more throttled system... To disable a feature when a site first begins to get busy, disable it at a throttle of 2 or 3. To hold on to the bitter end, wait until 4 or 5.</p>
-<p>To implement the throttle, you should do something like this:
-<pre> $throttle = 0;
- /* verify that the statitistics module is installed */
- if (function_exists(throttle_status) {
- $throttle = throttle_status()
- }
- if ($throttle >= $my_throttle_value) {
- // throttle limit reached, disable stuff
- }
- else {
- // throttle limit not reached, execute normally
- }</pre></p>
-
- <?php
}
diff --git a/modules/user.module b/modules/user.module
index ac6666a20..acb08673b 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -6,6 +6,7 @@ session_start();
function user_system($field){
$system["description"] = t("Enables the user registration and login system.");
+- $system["admin_help"] = t("In order to use the full power of Drupal a vistor must sign up for an account. This page lets you setup how a user signs up, logs out, what password \"words\" the system uses, the guidelines from the system about user subscriptions, and the E-Mails the system will send to the user.");
return $system[$field];
}
@@ -408,33 +409,39 @@ function user_link($type) {
}
if ($type == "admin" && user_access("administer users")) {
- $help["user"] = "Drupal allows users to register, login, logout, maintain user profiles, etc. No participant can use his own name to post content until he signs up for a user account. There are several configuration pages that help administrators manage user accounts.";
- $help["create"] = "If your site is completely private, and doesn't allow public registration, then you can add new users manually. This web page allows administrator to register a new users.";
- $help["view"] = "This page allows you to review and edit any user's profile.";
- $help["access"] = "Access rules enable administrators to filter out usernames and e-mail addresses which are not allowed in Drupal. An administrator creates a 'mask' against which each new registration is checked. Disallowed names and e-mail addresses are denied access to the site.";
- $help["permission"] = "Each user role has certain things that its users are allowed to do, and some that are disallowed. For example, authenticated users may usually post a story but anonymous users may not. Each permission describes a fine-grained logical operation such as access administration pages or add and modify user accounts. You could say a permission represents access granted to a user to perform a set of operations.";
- $help["role"] = "Roles allow you to fine tune the security and administration of drupal. A role defines a group of users which have certain privileges. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. By default, Drupal comes with two user roles: <ul><li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li><li>Registered user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li></ul>";
- $help["search"] = "On this page you can query any username. For example, one may search for 'br' and Drupal might return 'brian', 'brad', and 'brenda'.";
- $help["setting"] = "Administrators may choose to restrict registration to their site. That restriction may be accomplished on this page. Also, the list of words which may be included in a system generated password is also listed on this page. Drupal generates passwords by joining small words from the password list until the new password is greater than 6 characters.";
+- $help["user"] = t("Drupal allows users to register, login, logout, maintain user profiles, etc. No participant can use his own name to post content until he signs up for a user account.<br />Click on either the \"username\" or \"edit account\" to edit a user's information.");
+- $help["create"] = t("This web page allows the administrators to register a new users by hand.<br />Note:<ul><li>You cannot have a user where either the E-Mail address or the username match another user in the system</li></ul>");
+- $help["view"] = t("This page allows you to review and edit any user's profile. To edit a profile click on either the \"username\" or \"edit account\".");
+- $help["view-active"] = t("This page allows you to review and edit an active user's profile. To edit a profile click on either the \"username\" or \"edit account\".");
+- $help["view-new"] = t("This page allows you to review and edit a new user's profile. To edit a profile click on either the \"username\" or \"edit account\".");
+- $help["view-block"] = t("This page allows you to review and edit a blocked user's profile. To edit a profile click on either the \"username\" or \"edit account\".");
+- $help["view-role"] = "This page allows you to review and edit a user with role '%role's profile. To edit a profile click on either the \"username\" or \"edit account\".";
+- $help["access-overview"] = t("Access rules allow Drupal administrators to choose usernames and E-Mail address that are prevented from using drupal. To enter the mask for E-Mail addresses click on <a href=\"%e-mail\">e-mail rules</a>, for the username mask click on <a href=\"%username\">username rules</a>", array("%e-mail" => url("admin/user/access/mail"), "%username" => url("admin/user/access/user")));
+- $help["access-email"] = t("Setup and test the E-Mail access rules. The access function checks if you match a deny and <b>not</b> an allow. If you match <b>only</b> a deny then it is denied. Any other case, such as both a deny and an allow pattern matching, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>");
+- $help["access-name"] = t("Setup and test the Username access rules. The access function checks if you match a deny and <b>not</b> an allow. If you do then it is denied. Any other case, such as a deny pattern and an allow pattern, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>");
+- $help["permission"] = t("In this area you will define the <b>permissions</b> for each user role (Role names are defined in <a href=\"%role\">user roles</a>). Each permission describes a fine-grained logical operation, such as being able to access the administration pages, or adding/modifing a user account. You could say a permission represents access granted to a user to perform a set of operations.", array("%role" => url("admin/user/role")));
+- $help["role"] = t("Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in <a href=\"%permission\">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <b>names</b> of the various roles. To delete a role choose \"edit role\"<br />By default, Drupal comes with two user roles: <ul><li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li><li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li></ul>", array("%permission" => url("admin/user/permission")));
+- $help["search"] = t("Enter a simple pattern ( '*' may be user as a wildcard match) to search for a username. For example, one may search for 'br' and Drupal might return 'brian', 'brad', and 'brenda'.");
menu("admin/user", "user management", "user_admin", $help["user"], 2);
menu("admin/user/create", "create new account", "user_admin", $help["create"], 1);
menu("admin/user/account", "view user accounts", "user_admin", $help["view"], 2);
- menu("admin/user/access", "access rules", NULL, $help["access"], 3);
- menu("admin/user/access/mail", "e-mail rules", "user_admin", $help["access"]);
- menu("admin/user/access/user", "username rules", "user_admin", $help["access"]);
+ menu("admin/user/access", "access rules", NULL, $help["access-overview"], 3);
+ menu("admin/user/access/mail", "e-mail rules", "user_admin", $help["access-email"]);
+ menu("admin/user/access/user", "username rules", "user_admin", $help["access-name"]);
menu("admin/user/role", "user roles", "user_admin", $help["role"], 4);
menu("admin/user/permission", "user permissions", "user_admin", $help["permission"], 5);
menu("admin/user/search", "search accounts", "user_admin", $help["search"], 8);
menu("admin/user/help", "help", "user_help", NULL, 9);
menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
- menu("admin/user/account/0", "active users", "user_admin", $help["view"], 1);
- menu("admin/user/account/1", "new users", "user_admin", $help["view"], 2);
- menu("admin/user/account/2", "blocked users", "user_admin", $help["view"], 3);
+ menu("admin/user/account/0", "active users", "user_admin", $help["view-active"], 1);
+ menu("admin/user/account/1", "new users", "user_admin", $help["view-new"], 2);
+ menu("admin/user/account/2", "blocked users", "user_admin", $help["view-block"], 3);
$i = 3;
foreach (user_roles(1) as $key => $value) {
- menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", $help["view"], 4);
+ $help_msg = t($help["view-role"], array("%role" => $value));
+ menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", $help_msg, 4);
}
}
@@ -710,7 +717,7 @@ function user_pass($edit = array()) {
$variables = array("%username" => $account->name, "%site" => variable_get("site_name", "drupal"), "%password" => $pass, "%uri" => $base_url, "%uri_brief" => substr($base_url, strlen("http://")), "%mailto" => $account->mail, "%date" => format_date(time()));
$subject = strtr(variable_get("user_mail_pass_subject", t("Replacement login information for %username at %site")), $variables);
- $body = strtr(variable_get("user_mail_pass_body", t("%username,\n\nHere is your new password for %site. You may now login to ". url("user/login") ." using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at ". url("user/edit") .".\n\nYour new %site membership also enables you to login to other Drupal powered websites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team")), $variables);
+ $body = strtr(variable_get("user_mail_pass_body", t("%username,\n\nHere is your new password for %site. You may now login to ". url("user/login") ." using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at ". url("user/edit") .".\n\nYour new %site membership also enables you to login to other Drupal powered web sites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team")), $variables);
$headers = "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from";
user_mail($account->mail, $subject, $body, $headers);
@@ -1616,304 +1623,155 @@ function user_help_users_da() {
// the following functions comprise help for admins and developers
function user_help() {
- user_help_admin();
- user_help_admin_da();
- user_help_devel_da();
- user_help_devel_userhook();
+ $output .= user_help_admin();
+ $output .= user_help_admin_da();
+ $output .= user_help_devel_da();
+ $output .= user_help_devel_userhook();
+ return t($output);
}
function user_help_admin() {
- ?>
-<h3>Introduction</h3>
-<p>Drupal offers a powerful and open user system. This system allows users to
- register, login, logout, maintain user profiles, etc. No participant can use
- his own name to post comments until he signs up and submits his e-mail address.
- Those who do not register may participate as anonymous users, but they will
- suffer numerous disadvantages, for example their posts beginning at a lower
- score. </p>
-<p>In contrast, those with a user account can use their own name or handle and
- are granted various privileges: the most important are probably the ability
- to moderate new submissions, to rate comments, and to fine-tune the site to
- their personal liking. Drupal themes make fine tuning quite a pleasure.</p>
-<p>Registered users need to authenticate by supplying a username and password.
- Users may authenticate locally or via an external authentication source like
- <a href="http://www.jabber.org/">Jabber</a>, <a href="http://www.delphiforums.com/">Delphi</a>,
- and other <a href="http://www.drupal.org/">Drupal</a> websites. See <a href="#da">distributed
- authentication</a> for more information on this innovative feature. The username
- and password are kept in your database, where the password is hashed so that
- no one can read nor use it. When a username and password needs to be checked
- the system goes down the list of registered users until it finds a matching
- username, and then hashes the password that was supplied and compares it to
- the listed value. If the hashes match, the username and password are correct.
- Once a user authenticated session is started, and until that session is over,
- the user won't have to re-authenticate. To keep track of the individual sessions,
- Drupal relies on <a href="http://www.php.net/manual/en/ref.session.php">PHP's
- session support</a>. A visitor accessing your website is assigned an unique
- ID, the so-called session ID, which is stored in a cookie. For security's sake,
- the cookie does not contain personal information but acts as a key to retrieve
- the information stored on your server's side. When a visitor accesses your site,
- Drupal will check whether a specific session ID has been sent with the request.
- If this is the case, the prior saved environment is recreated.</p>
-<p>Authenticated users can select entirely different appearances for the site,
- utilizing their own preferences for how the pages are structured, how navigation
- lists and other page components are presented and much more. <br />
-</p>
-<h3>User preferences and profiles</h3>
-<p>Drupal comes with a set of user preferences and profile which a user may edit by
- clicking on the user account link. Of course, a user must be logged into reach those pages.
- There, users will find a page for changing their preferred time zone, language, username, e-mail address, password, theme, signature, homepage, and <a href="#da">distributed authentication</a> names.
- Changes made here take effect immediately. Also, administrators may make profile and preferences changes in the Admin Center on behalf of their users.</p>
- <p>Module developers are provided several hooks for adding custom fields to the user view/edit pages. These hooks are described in the Developer section of the <a href="http://www.drupal.org">Drupal Handbook</a>. For an example, see the <code>jabber_user()</code> function in <i>/modules/jabber.module</i>.
-</p>
- <?php
+ $output .= "<h3>Introduction</h3><p>Drupal offers a powerful access system that allows users to register, login, logout, maintain user profiles, etc. By using \"". l ("roles", "admin/user/role") ."\" you can setup fine grained ". l("permissions", "admin/user/permission") ." allowing each role to do only what you want them to. Each user is assigned to a role. By default there are two roles \"anonymous\" - a user who has not logged in, and \"authorized\" a user who has signed up and who has been authorized. As anonymous users, participants suffer numerous disadvantages, for example they cannot sign their names to nodes, and their moderated posts beginning at a lower score.</p>";
+ $output .= "<p>In contrast, those with a user account can use their own name or handle and are granted various privileges: the most important is probably the ability to moderate new submissions, to rate comments, and to fine-tune the site to their personal liking, with saved personal settings. Drupal themes make fine tuning quite a pleasure.</p>";
+ $output .= "<p>Registered users need to authenticate by supplying either a local username and password, or a remote username and password such as a ". l("jabber", "www.jabber.org") .", ". l("Delphi", "www.delphiforums.com") .", or one from another ". l("Drupal", "www.drupal.org") ." website. See ". l("distributed authentication", "#da") ." for more information on this innovative feature.";
+ $output .= "The local username and password, hashed with Message Digest 5 (MD5), are stored in your database. When you enter a password it is also hashed with MD5 and compaired with what is in the database. If the hashes match, the username and password are correct. Once a user authenticated session is started, and until that session is over, the user won't have to re-authenticate. To keep track of the individual sessions, Drupal relies on ". l("PHP's session support", "www.php.net/manual/en/ref.session.php") .". A visitor accessing your website is assigned an unique ID, the so-called session ID, which is stored in a cookie. For security's sake, the cookie does not contain personal information but acts as a key to retrieve the information stored on your server's side. When a visitor accesses your site, Drupal will check whether a specific session ID has been sent with the request. If this is the case, the prior saved environment is recreated.</p>";
+ $output .= "<h3>User preferences and profiles</h3><p>Each Drupal user has a profile, and a set of preferences which may be edited by clicking on the ". l("user account", "user") ." link. Of course, a user must be logged into reach those pages. There, users will find a page for changing their preferred time zone, language, username, e-mail address, password, theme, signature, homepage, and ". l("distributed authentication", "#da") ." names. Changes made here take effect immediately. Also, administrators may make profile and preferences changes in the ". l("Admin Center", "admin/user") ." on behalf of their users.</p>";
+ $output .= "<p>Module developers are provided several hooks for adding custom fields to the user view/edit pages. These hooks are described in the Developer section of the ". l("Drupal Handbook", "drupal.org/node/view/316") .". For an example, see the <code>jabber_user()</code> function in <i>/modules/jabber.module</i>.</p>";
+ return $output;
}
function user_help_admin_da() {
-?>
-<h3>Distributed authentication<a name="da"> </a></h3>
-<p>One of the more tedious moments in visiting a new website is filling out the
- registration form. The reg form provides helpful information to the website
- owner, but not much value for the user. The value for the end user is usually
- a the ability to post a messages or receive personalized news, etc. Distributed
- authentication (DA) gives the user what he wants without having to fill out
- the reg form. Removing this obstacle yields more registered and active users
- for the website.</p>
-<p>DA enables a new user to input a username and password into the login box and
- immediately be recognized, even if that user never registered on your site.
- This works because Drupal knows how to communicate with external registration
- databases. For example, lets say that your new user 'Joe' is already a registered
- member of Delphi Forums. If your Drupal has delphi.module installed, then Drupal
- will inform Joe on the registration and login screens that he may login with
- his Delphi ID instead of registering with your Drupal instance. Joe likes that
- idea, and logs in with a username of joe@remote.delphiforums.com and his usual
- Delphi password. Drupal then communicates with remote.delphiforums.com (usually using <a href="http://www.xmlrpc.com/">XML-RPC</a>,
- <a href="http://www.w3.org/Protocols/">HTTP POST</a>, or <a href="http://www.soapware.org/">SOAP</a>) behind
- the scenes and asks &quot;is this password for username=joe? If Delphi replies
- yes, then Drupal will create a new local account for joe and log joe into it.
- Joe may keep on logging into your Drupal instance in the same manner, and he
- will be logged into the same joe@remote.delphiforums.com account.</p>
-<p>One key element of DA is the 'authmap' table, which maps a user's authname
- (e.g. joe@remote.delphiforums.com) to his local UID (i.e. universal identification
- number). This map is checked whenever a user successfully logs into an external
- authentication source. Once Drupal knows that the current user is definately
- joe@remote.delphiforums.com (because Delphi says so), he looks up Joe's UID
- and logs Joe into that account.</p>
-<p>To disable distributed authentication, simply disable or remove all DA modules. For a virgin
-install, that means removing/disabling <i>jabber.module</i> and <i>drupal.module</i>
-</p>
-<p>Drupal is setup so that it is very easy to add support for any external authentication
- source. You currently have the following authentication modules installed ...</p>
- <?php
+ $output .= "<h3>Distributed authentication<a name=\"da\"> </a></h3><p>One of the more tedious moments in visiting a new website is filling out the registration form. The reg form provides helpful information to the website owner, but not much value for the user. The value for the end user is usually the ability to post a messages or receive personalized news, etc. Distributed authentication (DA) gives the user what they want without having to fill out the reg form. Removing this obstacle yields more registered and active users for the website.</p>";
+ $output .= "<p>DA enables a new user to input a username and password into the login box and immediately be recognized, even if that user never registered on your site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that your new user 'Joe' is already a registered member of Delphi Forums. If your Drupal has delphi.module installed, then Drupal will inform Joe on the registration and login screens that he may login with his Delphi ID instead of registering with your Drupal instance. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then communicates with remote.delphiforums.com (usually using ". l("XML-RPC","www.xmlrpc.com") ." ". l("HTTP POST", "www.w3.org/Protocols/") .", or ". l("SOAP", "www.soapware.org") .") behind the scenes and asks &quot;is this password for username=joe?&quot; If Delphi replies yes, then Drupal will create a new local account for joe and log joe into it. Joe may keep on logging into your Drupal instance in the same manner, and he will be logged into the same joe@remote.delphiforums.com account.</p>";
+ $output .= "<p>One key element of DA is the 'authmap' table, which maps a user's authname (e.g. joe@remote.delphiforums.com) to his local UID (i.e. universal identification number). This map is checked whenever a user successfully logs into an external authentication source. Once Drupal knows that the current user is definately joe@remote.delphiforums.com (because Delphi says so), he looks up Joe's UID and logs Joe into that account.</p>";
+ $output .= "<p>To disable distributed authentication, simply ". l("disable", "admin/system/modules") ." or remove all DA modules. For a virgin install, that means removing/disabling <i>jabber.module</i> and <i>drupal.module</i></p>";
+ $output .= "<p>Drupal is setup so that it is very easy to add support for any external authentication source. You currently have the following authentication modules installed ...</p>";
+
foreach (module_list() as $module) {
if (module_hook($module, "auth")) {
- print "<h4>" . module_invoke($module, "info", "name") . "</h4>";
- print module_invoke($module, "auth_help");
+ $output .= "<h4>" . module_invoke($module, "info", "name") . "</h4>";
+ $output .= module_invoke($module, "auth_help");
}
}
+ return $output;
}
function user_help_devel_da() {
- ?>
- <h3>Writing distributed authentication modules</h3>
-<p>Drupal is specifically architected to enable easy authoring of new authentication
- modules. I'll deconstruct the <a href="http://www.blogger.com">Blogger</a> authentication
- module here, and hopefully provide all the details you'll need to write a new
- auth module. If you want to download the full text of this module, visit the
- <a href="http://cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication/Blogger/?cvsroot=contrib">Drupal contributions CVS repository</a>.</p>
-<h4>Code review</h4>
-<pre>&lt;?php</pre>
-<p>The first line of every authentication module is the same. It is the standard
- processing instruction for any PHP file. Authentication modules are always written
- in PHP, although they typically interact with systems written in many different
- programming languages and operating systems languages.</p>
-<pre>function blogger_info($field = NULL) {
- $info["name"] = "Blogger";
- $info["protocol"] = "XML-RPC";
- $info["link"] = l("Blogger", "user/help#blogger");
- $info["maintainer"] = "Moshe Weitzman";
- $info["maintaineremail"] = "weitzman at tejasa.com";
-
- if ($field) {
- return $info[$field];
- }
- else {
- return $info;
- }
-}</pre>
-<p>The <i>_info</i> function is always the first function defined in your module.
- This function populates an array called <i>$info</i> with various pieces of
- data. Some of this data is used by Drupal (&quot;name&quot;, &quot;link&quot;),
- and some of it just informs the users of your module. Your goal is to simply
- copy the b<i>logger_info</i> function in your module - but wherever it says
- <i>blogger</i> here, substitute your own module name.</p>
-<pre>function blogger_auth($name, $pass, $server) {
- if ($server !== &quot;blogger.com&quot;) {
- return 0; // user did not present a Blogger ID so don't bother trying.
- }
-
- $appkey = &quot;6D4A2D6811A6E1F75148DC1155D33C0C958107BC&quot;; //provided to Drupal by Ev@Blogger
- $message = new xmlrpcmsg(&quot;blogger.getUsersBlogs&quot;, array(new xmlrpcval($appkey, &quot;string&quot;), new xmlrpcval($name, &quot;string&quot;), new xmlrpcval($pass, &quot;string&quot;)));
- $client = new xmlrpc_client(&quot;/api/RPC2&quot;, &quot;plant.blogger.com&quot;);
- $result = $client-&gt;send($message, 5);
-
+ $output .= "<h3>Writing distributed authentication modules</h3><p>Drupal is specifically architected to enable easy authoring of new authentication modules. I'll deconstruct the ". l("Blogger", "www.blogger.com") ." authentication module, and hopefully provide all the details you'll need to write your own auth module. If you want to download the full text of this module, visit the ". l("Blogger source", "cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication/Blogger/?cvsroot=contrib") ." in the ". l("Drupal contributions CVS repository", "cvs.drupal.org/viewcvs/contributions/?cvsroot=contrib") .".</p>";
+ $output .= "<h4>Code review</h4><pre>&lt;?php</pre><p>The first line of every Drupal module, including the authentication modules, is the same. It is the standard processing instruction for any PHP file. Authentication modules are always written in PHP, although they typically interact with systems written in many different programming languages and operating systems languages.</p>";
+ $output .= "<pre>function blogger_info(\$field = NULL) {
+ \$info[\"name\"] = \"Blogger\";
+ \$info[\"protocol\"] = \"XML-RPC\";
+ \$info[\"link\"] = \"<a href=\\\"module.php?mod=user&op=sa_help#blogger\\\">Blogger</a>\";
+ \$info[\"maintainer\"] = \"Moshe Weitzman\";
+ \$info[\"maintaineremail\"] = \"weitzman at tejasa.com\";
+ if (\$field) return \$info[\$field];
+ else return \$info;
+}</pre>";
+ $output .= "<p>The <i>_info</i> function is always the first function defined in your module. This function populates an array called <i>\$info</i> with various pieces of data. Some of this data is used by Drupal (&quot;name&quot;, &quot;link&quot;), and some of it just informs the users of your module. Simply copy the <i>blogger_info</i> function in your module - but wherever it says <i>blogger</i> here, substitute your own module name.</p>";
+ $output .= "<pre>function blogger_auth(\$name, \$pass, \$server) {
+ if (\$server !== &quot;blogger.com&quot;) return 0; // user did not present a Blogger ID so don't bother trying.
+
+ \$appkey = &quot;6D4A2D6811A6E1F75148DC1155D33C0C958107BC&quot;; //provided to Drupal by Ev@Blogger
+ \$message = new xmlrpcmsg(&quot;blogger.getUsersBlogs&quot;, array(new xmlrpcval(\$appkey, &quot;string&quot;), new xmlrpcval(\$name, &quot;string&quot;), new xmlrpcval(\$pass, &quot;string&quot;)));
+ \$client = new xmlrpc_client(&quot;/api/RPC2&quot;, &quot;plant.blogger.com&quot;);
+ // \$client->setDebug(1);
+ \$result = \$client-&gt;send(\$message, 5);
// Since Blogger doesn't return a properly formed FaultCode, we just search for the string 'fault'.
- if ($result &amp;&amp; !stristr($result-&gt;serialize(), &quot;fault&quot;)) {
- $result-&gt;serialize());
+ if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
+ // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
return 1;
}
- else if ($result) {
+ else if (\$result) {
+ // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
return 0;
}
else {
+ // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
return 0;
}
-}</pre>
-<p>The <i>_auth</i> function is the heart of any authentication module. This function
- is called whenever a user is attempting to login using your authentication module.
- For successful authentications, this function returns TRUE. Otherwise, it returns
- FALSE. This function always accepts 3 parameters, as shown above. These parameters
- are passed by the user system (user.module). The user system parses the username
- as typed by the user into 2 substrings - $name and $server. The parsing rules
- are:</p>
-<table width="80%" border="0" cellspacing="4" cellpadding="4" align="center">
- <tr>
- <th colspan="2" align="left">
- _auth function parameters
- </th>
- </tr>
- <tr>
- <th>$name</th>
- <td>The substring before the final <i>'@'</i> character in the username field</td>
- </tr>
- <tr>
- <th>$pass</th>
- <td>The whole string submitted by the user in the password field</td>
- </tr>
- <tr>
- <th>$server</th>
- <td>The substring after the final <i>'@'</i> symbol in the username field</td>
- </tr>
-</table>
-<p>So now lets use that $name, $pass, and $server which has been passed to our
- <i>_auth</i> function. Blogger authenticates users via <a href="http://www.xmlrpc.com">XML-RPC</a>.
- Your module may authenticate using a different technique. Drupal doesn't reallly
- care how your module communicates with its registration source. It just <b>trusts</b>
- the module. </p>
-<p>The lines above illustrate a typical <a href="http://www.xmlrpc.com/">XML-RPC</a>
- method call. Here we build up a message and send it to Blogger, storing the
- response in a variable called <i>$response</i>. The message we pass conforms
- to the published <a href="http://plant.blogger.com/API">Blogger XML-RPC API</a>.
- Your module will no doubt implement a different API. One peculiarity of this
- module is that we don't actually use the $server parameter. Blogger only accepts
- authentication at <i>plant.blogger.com</i>, so we hard-code that value into
- the <i>xmlrpc_client()</i> function. A more typical example might be the jabber
- module, which uses the <i>$server</i> parameter to determine where to send the
- authentication request. Also of note is the '5' parameter in the <i>$client-&gt;send()</i>
- call. This is a timeout value in seconds. All authentication modules should
- implement a timeout on their external calls. This makes sure to return control
- to the user.module if your registration database has become inoperable or unreachable.</p>
-<pre>
- if ($result &amp;&amp; !stristr($result-&gt;serialize(), &quot;fault&quot;)) {
+}</pre>";
+ $output .= "<p>The <i>_auth</i> function is the heart of any authentication module. This function is called whenever a user is attempting to login using your authentication module. For successful authentications, this function returns TRUE. Otherwise, it returns FALSE. This function always accepts 3 parameters, as shown above. These parameters are passed by the user system (user.module). The user system parses the username as typed by the user into 2 substrings - \$name and \$server. The parsing rules are:</p>";
+ $output .= "<table width=\"80%\" border=\"0\" cellspacing=\"4\" cellpadding=\"4\" align=\"center\"><tr><th colspan=\"2\" align=\"left\">_auth function parameters</th></tr><tr><th>\$name</th><td>The substring before the final <i>'@'</i> character in the username field</td></tr><tr><th>\$pass</th><td>The whole string submitted by the user in the password field</td></tr><tr><th>\$server</th><td>The substring after the final <i>'@'</i> symbol in the username field</td></tr></table>";
+ $output .= "<p>So now lets use that \$name, \$pass, and \$server which was passed to our <i>_auth</i> function. Blogger authenticates users via ". l("XML-RPC", "www.xmlrpc.org") .". Your module may authenticate using a different technique. Drupal doesn't reallly care how your module communicates with its registration source. It just <b>trusts</b> the module.</p>";
+ $output .= "<p>The lines above illustrate a typical ". l("XML-RPC", "www.xmlrpc.org") ." method call. Here we build up a message and send it to Blogger, storing the response in a variable called <i>\$response</i>. The message we pass conforms to the published ". l("Blogger XML-RPC Application Programmers Interface (API)", "plant.blogger.com/API") .". Your module will no doubt implement a different API. One peculiarity of this module is that we don't actually use the $server parameter. Blogger only accepts authentication at <i>plant.blogger.com</i>, so we hard-code that value into the <i>xmlrpc_client()</i> function. A more typical example might be the jabber module, which uses the <i>\$server</i> parameter to determine where to send the authentication request. Also of note is the '5' parameter in the <i>\$client-&gt;send\(\)</i> call. This is a timeout value in seconds. All authentication modules should implement a timeout on their external calls. This makes sure to return control to the user.module if your registration database has become inoperable or unreachable.</p>";
+ $output .= "<pre>
+ if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
+ // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
return 1;
}
- else if ($result) {
+ else if (\$result) {
+ // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
return 0;
}
else {
+ // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
return 0;
}
-</pre>
-<p>This second half of the <i>_auth</i> function examines the <i>$response</i>
- from plant.blogger.com and returns a TRUE or FALSE as appropriate. This is a
- critical decision, so do be sure you have good logic here, and perform sufficient
- testing for all cases. In the case of Blogger, we search for the string 'fault'
- in the response. If that string is present, or there is no repsonse, our function
- returns FALSE. Otherwise, Blogger has returned valid data to our method request
- and we return TRUE.
-</p>
-<pre>function blogger_page() {
+</pre>";
+ $output .= "<p>This second half of the <i>_auth</i> function examines the <i>\$response</i> from plant.blogger.com and returns a TRUE (1) or FALSE (0) as appropriate. This is a critical decision, so be sure that you have good logic here, and perform sufficient testing for all cases. In the case of Blogger, we search for the string 'fault' in the response. If that string is present, or there is no repsonse, our function returns FALSE. Otherwise, Blogger has returned valid data to our method request and we return TRUE. Note: Everything starting with \"//\" is a comment and is not executed.</p>";
+ $output .= "<pre>function blogger_page() {
theme(&quot;header&quot;);
theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_auth_help());
theme(&quot;footer&quot;);
-}</pre>
-<p>The _page function is not currently used, but it might be in the future. For
- now, just copy what you see here, substituting your module name for <i>blogger</i>.</p>
-<pre>function blogger_auth_help() {
- $site = variable_get(&quot;site_name&quot;, &quot;this web site&quot;);
- $output = &quot;
- &lt;p&gt;You may login to &lt;i&gt;%s&lt;/i&gt; using a &lt;b&gt;Blogger ID&lt;/b&gt;
- and password. A Blogger ID consists of your Blogger username followed by &lt;i&gt;@blogger.com&lt;/i&gt;.
- So a valid blogger ID is mwlily@blogger.com. If you are a Blogger member, go
- ahead and login now.&lt;/p&gt;<br />
- &lt;p&gt;Blogger offers you instant communication power by letting you post
- your thoughts to the web whenever the urge strikes.
- Blogger will publish to your current web site or help you create one. &lt;a
- href=\&quot;http://www.blogger.com/about.pyra\&quot;&gt;Learn more about it&lt;/a&gt;.&quot;;
-
- return sprintf(t($output), $site);
+}</pre>";
+ $output .= "<p>The _page function is not currently used, but it might be in the future. For now, just copy what you see here, substituting your module name for <i>blogger</i>.</p>";
+ $output .= "<pre>function blogger_auth_help() {
+ \$site = variable_get(&quot;site_name&quot;, &quot;this web site&quot;);
+ \$html_output = &quot;
+ &lt;p&gt;You may login to &lt;i&gt;%s&lt;/i&gt; using a &lt;b&gt;Blogger ID&lt;/b&gt; and password. A Blogger ID consists of your Blogger username followed by &lt;i&gt;@blogger.com&lt;/i&gt;. So a valid blogger ID is mwlily@blogger.com. If you are a Blogger member, go ahead and login now.&lt;/p&gt;
+ &lt;p&gt;Blogger offers you instant communication power by letting you post your thoughts to the web whenever the urge strikes.
+ Blogger will publish to your current web site or help you create one. &lt;a href=\&quot;http://www.blogger.com/about.pyra\&quot;&gt;Learn more about it&lt;/a&gt;.&quot;;
+ return sprintf(t(\$html_output), \$site);
}
-</pre>
-<p>The <i>_auth_help</i> function is prominently linked within Drupal, so you'll
- want to write the best possible user help here. You'll want to tell users what
- a proper username looks like for your authentication module. Also, you may advertise
- a bit about your service at the end. Note that your help text is passed through
- a t() function in the last line. This is Drupal's localization function. Translators
- may localize your help text just like any other text in Drupal.</p>
-<h4>Publishing your module</h4>
-<p>Once you've written and tested your authentication module, you'll have to usually
- want to share it with the world. The best way to do this is to add the module
- to the <a href="http://cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication/Blogger/?cvsroot=contrib">Drupal
- contributions CVS repository</a>. You'll need to request priveleges in this repository - see <a href="http://cvs.drupal.org/viewcvs.cgi/contributions/README?rev=HEAD&amp;cvsroot=contrib&amp;content-type=text/vnd.viewcvs-markup">README</a>
- for the details. Then you'll want to announce your contribution on the <a href="http://list.drupal.org/>drupal-devel and drupal-support mailing lists</a>. You might also want to post a story on
- <a href="http://www.drupal.org/">Drupal.org</a>.<br>
-</p>
- <?php
+</pre>";
+ $output .= "<p>The <i>_auth_help</i> function is prominently linked within Drupal, so you'll want to write the best possible user help here. You'll want to tell users what a proper username looks like and you may also want to advertise a bit about your service at the end. Note that your help text is passed through a t() function in the last line. This is Drupal's localization function. Translators may localize your help text just like any other text in Drupal.</p>";
+ $output .= "<h4>Publishing your module</h4><p>Once you've written and tested your authentication module, you'll usually want to share it with the world. The best way to do this is to add the module to the ". l("Drupal contributions CVS repository", "cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication?cvsroot=contrib") .". You'll need to request priveleges to this repository - see ". l("the README file", "cvs.drupal.org/viewcvs.cgi/contributions/README?rev=HEAD&amp;cvsroot=contrib&amp;content-type=text/vnd.viewcvs-markup") ." for the details. Then you should announce your contribution on the ". l("drupal-devel and drupal-support mailing lists", "drupal.org/node/view/322") .". You might also want to post a story on ". l("Drupal.org", "www.drupal.org") .".</p>";
+ return $output;
}
function user_help_devel_userhook() {
- ?>
- <h3><a name="userhook">module_user()</a></h3>
- <p>The <b>_user()</b> hook provides to module authors a mechanism for inserting text and form fields into the registration page, the user account view/edit pages, and the administer users page. This is useful if you want to add a custom field for your particular community. This is best illustrated by an example called <a href="http://cvs.drupal.org/viewcvs.cgi/contributions/modules/profile/?cvsroot=contrib">profile.module</a> in the contributions CVS repository. Profile.module is meant to be customized for your needs. Please download it and hack away until it does what you need.</p>
-
-<p>Consider this simpler example from a fictional recipe community web site called Julia's Kitchen. Julia customizes her Drupal powered site by creating a new file called <i>julia.module</i>. That file does the following:<ul>
-<li>new members must agree to Julia's Privacy Policy on the reg page.</li>
-<li>members may list their favorite ingredients on their public user profile page</li></ul></p>
-
-<p>Julia achieves this with the following code. The comments below should help you understand what is going on.</p>
-
-<pre>
-function julia_user($type, $edit, &$user) {
- switch ($type) {
- case "register_form":
- $output .= form_item("Privacy Policy", "Julia would never sell your user information. She is just nice old French chef who lives near me in Cambridge, Massachussetts USA.");
- $output .= form_checkbox("Accept <i>Julia's Kitchen</i> privacy policy.", julia_accept, 1, $edit["julia_accept"]);
- return $output;
- case "register_validate":
- if ($edit["julia_accept"] == "1") {
+
+ $output .= "<h3><a name=\"userhook\">module_user()</a></h3><p>The <b>_user()</b> hook provides a mechanism for inserting text and form fields into the ". l("registration","user/register") .", ". l("user account view/edit", "user") .", and ". l("administer users", "admin/user") ." pages. This is useful if you want to add a custom field for your particular community. This is best illustrated by the ". l("profile.module", "cvs.drupal.org/viewcvs/drupal/modules/profile.module") .". The profile.module is meant to be customized for your needs. Please download it and hack away until it does what you need.</p>";
+
+ $output .= "<p>Consider this simpler example from a fictional recipe community web site called Julia's Kitchen. Julia customizes her Drupal powered site by creating a new file called <i>julia.module</i>. That file does the following:<ul><li>new members must agree to Julia's Privacy Policy on the reg page.</li><li>members may list their favorite ingredients on their public user profile page</li></ul></p>";
+
+ $output .= "<p>Julia achieves this with the following code. The comments below should help you understand what is going on.</p>";
+
+ $output .= "<pre>
+function julia_user(\$type, \$edit, &\$user) {
+
+ switch (\$type) { // What type of registration action are we taking.
+ case t(\"register_form\"): // Add the two items below to the resigtration form.
+ \$output .= form_item(\"Privacy Policy\", \"Julia would never sell your user information. She is just nice old French chef who lives near me in Cambridge, Massachussetts USA.\");
+ \$output .= form_checkbox(\"Accept <i>Julia's Kitchen</i> privacy policy.\", julia_accept, 1, \$edit[\"julia_accept\"]);
+ return \$output;
+ case t(\"register_validate\"): // Okay, the user has filled out the form, did they agree.
+ if (\$edit[\"julia_accept\"] == \"1\") {
// on success return the values you want to store
- return array("julia_accept" => 1);
+ return array(\"julia_accept\" => 1);
}
else {
// on error return an error message
- return "You must accept the Julia's Kitchen privacy policy to register.";
+ return \"You must accept the Julia's Kitchen privacy policy to register.\";
}
- case "view_public":
+ case t(\"view_public\"):
// when others look at user data
- return form_item("Favorite Ingredient", $user->julia_favingredient);
- case "view_private":
+ return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
+ case t(\"view_private\"):
// when user tries to view his own user page.
- return form_item("Favorite Ingredient", $user->julia_favingredient);
- case "edit_form":
+ return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
+ case t(\"edit_form\"):
// when user tries to edit his own user page.
- return form_textfield("Favorite Ingredient", "julia_favingredient", $user->julia_favingredient, 50, 65, "Tell everyone your secret spice");
- case "edit_validate":
- return user_save($user, array("julia_favingredient" => $edit["julia_favingredient"]));
+ return form_textfield(\"Favorite Ingredient\", \"julia_favingredient\", \$user->julia_favingredient, 50, 65, \"Tell everyone your secret spice\");
+ case t(\"edit_validate\"): // Make sure the data they edited is \"valid\".
+ return user_save(\$user, array(\"julia_favingredient\" => \$edit[\"julia_favingredient\"]));
}
}
-</pre>
- <?php
+</pre>";
+ return $output;
}
?>
diff --git a/modules/user/user.module b/modules/user/user.module
index ac6666a20..acb08673b 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -6,6 +6,7 @@ session_start();
function user_system($field){
$system["description"] = t("Enables the user registration and login system.");
+- $system["admin_help"] = t("In order to use the full power of Drupal a vistor must sign up for an account. This page lets you setup how a user signs up, logs out, what password \"words\" the system uses, the guidelines from the system about user subscriptions, and the E-Mails the system will send to the user.");
return $system[$field];
}
@@ -408,33 +409,39 @@ function user_link($type) {
}
if ($type == "admin" && user_access("administer users")) {
- $help["user"] = "Drupal allows users to register, login, logout, maintain user profiles, etc. No participant can use his own name to post content until he signs up for a user account. There are several configuration pages that help administrators manage user accounts.";
- $help["create"] = "If your site is completely private, and doesn't allow public registration, then you can add new users manually. This web page allows administrator to register a new users.";
- $help["view"] = "This page allows you to review and edit any user's profile.";
- $help["access"] = "Access rules enable administrators to filter out usernames and e-mail addresses which are not allowed in Drupal. An administrator creates a 'mask' against which each new registration is checked. Disallowed names and e-mail addresses are denied access to the site.";
- $help["permission"] = "Each user role has certain things that its users are allowed to do, and some that are disallowed. For example, authenticated users may usually post a story but anonymous users may not. Each permission describes a fine-grained logical operation such as access administration pages or add and modify user accounts. You could say a permission represents access granted to a user to perform a set of operations.";
- $help["role"] = "Roles allow you to fine tune the security and administration of drupal. A role defines a group of users which have certain privileges. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. By default, Drupal comes with two user roles: <ul><li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li><li>Registered user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li></ul>";
- $help["search"] = "On this page you can query any username. For example, one may search for 'br' and Drupal might return 'brian', 'brad', and 'brenda'.";
- $help["setting"] = "Administrators may choose to restrict registration to their site. That restriction may be accomplished on this page. Also, the list of words which may be included in a system generated password is also listed on this page. Drupal generates passwords by joining small words from the password list until the new password is greater than 6 characters.";
+- $help["user"] = t("Drupal allows users to register, login, logout, maintain user profiles, etc. No participant can use his own name to post content until he signs up for a user account.<br />Click on either the \"username\" or \"edit account\" to edit a user's information.");
+- $help["create"] = t("This web page allows the administrators to register a new users by hand.<br />Note:<ul><li>You cannot have a user where either the E-Mail address or the username match another user in the system</li></ul>");
+- $help["view"] = t("This page allows you to review and edit any user's profile. To edit a profile click on either the \"username\" or \"edit account\".");
+- $help["view-active"] = t("This page allows you to review and edit an active user's profile. To edit a profile click on either the \"username\" or \"edit account\".");
+- $help["view-new"] = t("This page allows you to review and edit a new user's profile. To edit a profile click on either the \"username\" or \"edit account\".");
+- $help["view-block"] = t("This page allows you to review and edit a blocked user's profile. To edit a profile click on either the \"username\" or \"edit account\".");
+- $help["view-role"] = "This page allows you to review and edit a user with role '%role's profile. To edit a profile click on either the \"username\" or \"edit account\".";
+- $help["access-overview"] = t("Access rules allow Drupal administrators to choose usernames and E-Mail address that are prevented from using drupal. To enter the mask for E-Mail addresses click on <a href=\"%e-mail\">e-mail rules</a>, for the username mask click on <a href=\"%username\">username rules</a>", array("%e-mail" => url("admin/user/access/mail"), "%username" => url("admin/user/access/user")));
+- $help["access-email"] = t("Setup and test the E-Mail access rules. The access function checks if you match a deny and <b>not</b> an allow. If you match <b>only</b> a deny then it is denied. Any other case, such as both a deny and an allow pattern matching, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>");
+- $help["access-name"] = t("Setup and test the Username access rules. The access function checks if you match a deny and <b>not</b> an allow. If you do then it is denied. Any other case, such as a deny pattern and an allow pattern, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>");
+- $help["permission"] = t("In this area you will define the <b>permissions</b> for each user role (Role names are defined in <a href=\"%role\">user roles</a>). Each permission describes a fine-grained logical operation, such as being able to access the administration pages, or adding/modifing a user account. You could say a permission represents access granted to a user to perform a set of operations.", array("%role" => url("admin/user/role")));
+- $help["role"] = t("Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in <a href=\"%permission\">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <b>names</b> of the various roles. To delete a role choose \"edit role\"<br />By default, Drupal comes with two user roles: <ul><li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li><li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li></ul>", array("%permission" => url("admin/user/permission")));
+- $help["search"] = t("Enter a simple pattern ( '*' may be user as a wildcard match) to search for a username. For example, one may search for 'br' and Drupal might return 'brian', 'brad', and 'brenda'.");
menu("admin/user", "user management", "user_admin", $help["user"], 2);
menu("admin/user/create", "create new account", "user_admin", $help["create"], 1);
menu("admin/user/account", "view user accounts", "user_admin", $help["view"], 2);
- menu("admin/user/access", "access rules", NULL, $help["access"], 3);
- menu("admin/user/access/mail", "e-mail rules", "user_admin", $help["access"]);
- menu("admin/user/access/user", "username rules", "user_admin", $help["access"]);
+ menu("admin/user/access", "access rules", NULL, $help["access-overview"], 3);
+ menu("admin/user/access/mail", "e-mail rules", "user_admin", $help["access-email"]);
+ menu("admin/user/access/user", "username rules", "user_admin", $help["access-name"]);
menu("admin/user/role", "user roles", "user_admin", $help["role"], 4);
menu("admin/user/permission", "user permissions", "user_admin", $help["permission"], 5);
menu("admin/user/search", "search accounts", "user_admin", $help["search"], 8);
menu("admin/user/help", "help", "user_help", NULL, 9);
menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
- menu("admin/user/account/0", "active users", "user_admin", $help["view"], 1);
- menu("admin/user/account/1", "new users", "user_admin", $help["view"], 2);
- menu("admin/user/account/2", "blocked users", "user_admin", $help["view"], 3);
+ menu("admin/user/account/0", "active users", "user_admin", $help["view-active"], 1);
+ menu("admin/user/account/1", "new users", "user_admin", $help["view-new"], 2);
+ menu("admin/user/account/2", "blocked users", "user_admin", $help["view-block"], 3);
$i = 3;
foreach (user_roles(1) as $key => $value) {
- menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", $help["view"], 4);
+ $help_msg = t($help["view-role"], array("%role" => $value));
+ menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", $help_msg, 4);
}
}
@@ -710,7 +717,7 @@ function user_pass($edit = array()) {
$variables = array("%username" => $account->name, "%site" => variable_get("site_name", "drupal"), "%password" => $pass, "%uri" => $base_url, "%uri_brief" => substr($base_url, strlen("http://")), "%mailto" => $account->mail, "%date" => format_date(time()));
$subject = strtr(variable_get("user_mail_pass_subject", t("Replacement login information for %username at %site")), $variables);
- $body = strtr(variable_get("user_mail_pass_body", t("%username,\n\nHere is your new password for %site. You may now login to ". url("user/login") ." using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at ". url("user/edit") .".\n\nYour new %site membership also enables you to login to other Drupal powered websites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team")), $variables);
+ $body = strtr(variable_get("user_mail_pass_body", t("%username,\n\nHere is your new password for %site. You may now login to ". url("user/login") ." using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at ". url("user/edit") .".\n\nYour new %site membership also enables you to login to other Drupal powered web sites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team")), $variables);
$headers = "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from";
user_mail($account->mail, $subject, $body, $headers);
@@ -1616,304 +1623,155 @@ function user_help_users_da() {
// the following functions comprise help for admins and developers
function user_help() {
- user_help_admin();
- user_help_admin_da();
- user_help_devel_da();
- user_help_devel_userhook();
+ $output .= user_help_admin();
+ $output .= user_help_admin_da();
+ $output .= user_help_devel_da();
+ $output .= user_help_devel_userhook();
+ return t($output);
}
function user_help_admin() {
- ?>
-<h3>Introduction</h3>
-<p>Drupal offers a powerful and open user system. This system allows users to
- register, login, logout, maintain user profiles, etc. No participant can use
- his own name to post comments until he signs up and submits his e-mail address.
- Those who do not register may participate as anonymous users, but they will
- suffer numerous disadvantages, for example their posts beginning at a lower
- score. </p>
-<p>In contrast, those with a user account can use their own name or handle and
- are granted various privileges: the most important are probably the ability
- to moderate new submissions, to rate comments, and to fine-tune the site to
- their personal liking. Drupal themes make fine tuning quite a pleasure.</p>
-<p>Registered users need to authenticate by supplying a username and password.
- Users may authenticate locally or via an external authentication source like
- <a href="http://www.jabber.org/">Jabber</a>, <a href="http://www.delphiforums.com/">Delphi</a>,
- and other <a href="http://www.drupal.org/">Drupal</a> websites. See <a href="#da">distributed
- authentication</a> for more information on this innovative feature. The username
- and password are kept in your database, where the password is hashed so that
- no one can read nor use it. When a username and password needs to be checked
- the system goes down the list of registered users until it finds a matching
- username, and then hashes the password that was supplied and compares it to
- the listed value. If the hashes match, the username and password are correct.
- Once a user authenticated session is started, and until that session is over,
- the user won't have to re-authenticate. To keep track of the individual sessions,
- Drupal relies on <a href="http://www.php.net/manual/en/ref.session.php">PHP's
- session support</a>. A visitor accessing your website is assigned an unique
- ID, the so-called session ID, which is stored in a cookie. For security's sake,
- the cookie does not contain personal information but acts as a key to retrieve
- the information stored on your server's side. When a visitor accesses your site,
- Drupal will check whether a specific session ID has been sent with the request.
- If this is the case, the prior saved environment is recreated.</p>
-<p>Authenticated users can select entirely different appearances for the site,
- utilizing their own preferences for how the pages are structured, how navigation
- lists and other page components are presented and much more. <br />
-</p>
-<h3>User preferences and profiles</h3>
-<p>Drupal comes with a set of user preferences and profile which a user may edit by
- clicking on the user account link. Of course, a user must be logged into reach those pages.
- There, users will find a page for changing their preferred time zone, language, username, e-mail address, password, theme, signature, homepage, and <a href="#da">distributed authentication</a> names.
- Changes made here take effect immediately. Also, administrators may make profile and preferences changes in the Admin Center on behalf of their users.</p>
- <p>Module developers are provided several hooks for adding custom fields to the user view/edit pages. These hooks are described in the Developer section of the <a href="http://www.drupal.org">Drupal Handbook</a>. For an example, see the <code>jabber_user()</code> function in <i>/modules/jabber.module</i>.
-</p>
- <?php
+ $output .= "<h3>Introduction</h3><p>Drupal offers a powerful access system that allows users to register, login, logout, maintain user profiles, etc. By using \"". l ("roles", "admin/user/role") ."\" you can setup fine grained ". l("permissions", "admin/user/permission") ." allowing each role to do only what you want them to. Each user is assigned to a role. By default there are two roles \"anonymous\" - a user who has not logged in, and \"authorized\" a user who has signed up and who has been authorized. As anonymous users, participants suffer numerous disadvantages, for example they cannot sign their names to nodes, and their moderated posts beginning at a lower score.</p>";
+ $output .= "<p>In contrast, those with a user account can use their own name or handle and are granted various privileges: the most important is probably the ability to moderate new submissions, to rate comments, and to fine-tune the site to their personal liking, with saved personal settings. Drupal themes make fine tuning quite a pleasure.</p>";
+ $output .= "<p>Registered users need to authenticate by supplying either a local username and password, or a remote username and password such as a ". l("jabber", "www.jabber.org") .", ". l("Delphi", "www.delphiforums.com") .", or one from another ". l("Drupal", "www.drupal.org") ." website. See ". l("distributed authentication", "#da") ." for more information on this innovative feature.";
+ $output .= "The local username and password, hashed with Message Digest 5 (MD5), are stored in your database. When you enter a password it is also hashed with MD5 and compaired with what is in the database. If the hashes match, the username and password are correct. Once a user authenticated session is started, and until that session is over, the user won't have to re-authenticate. To keep track of the individual sessions, Drupal relies on ". l("PHP's session support", "www.php.net/manual/en/ref.session.php") .". A visitor accessing your website is assigned an unique ID, the so-called session ID, which is stored in a cookie. For security's sake, the cookie does not contain personal information but acts as a key to retrieve the information stored on your server's side. When a visitor accesses your site, Drupal will check whether a specific session ID has been sent with the request. If this is the case, the prior saved environment is recreated.</p>";
+ $output .= "<h3>User preferences and profiles</h3><p>Each Drupal user has a profile, and a set of preferences which may be edited by clicking on the ". l("user account", "user") ." link. Of course, a user must be logged into reach those pages. There, users will find a page for changing their preferred time zone, language, username, e-mail address, password, theme, signature, homepage, and ". l("distributed authentication", "#da") ." names. Changes made here take effect immediately. Also, administrators may make profile and preferences changes in the ". l("Admin Center", "admin/user") ." on behalf of their users.</p>";
+ $output .= "<p>Module developers are provided several hooks for adding custom fields to the user view/edit pages. These hooks are described in the Developer section of the ". l("Drupal Handbook", "drupal.org/node/view/316") .". For an example, see the <code>jabber_user()</code> function in <i>/modules/jabber.module</i>.</p>";
+ return $output;
}
function user_help_admin_da() {
-?>
-<h3>Distributed authentication<a name="da"> </a></h3>
-<p>One of the more tedious moments in visiting a new website is filling out the
- registration form. The reg form provides helpful information to the website
- owner, but not much value for the user. The value for the end user is usually
- a the ability to post a messages or receive personalized news, etc. Distributed
- authentication (DA) gives the user what he wants without having to fill out
- the reg form. Removing this obstacle yields more registered and active users
- for the website.</p>
-<p>DA enables a new user to input a username and password into the login box and
- immediately be recognized, even if that user never registered on your site.
- This works because Drupal knows how to communicate with external registration
- databases. For example, lets say that your new user 'Joe' is already a registered
- member of Delphi Forums. If your Drupal has delphi.module installed, then Drupal
- will inform Joe on the registration and login screens that he may login with
- his Delphi ID instead of registering with your Drupal instance. Joe likes that
- idea, and logs in with a username of joe@remote.delphiforums.com and his usual
- Delphi password. Drupal then communicates with remote.delphiforums.com (usually using <a href="http://www.xmlrpc.com/">XML-RPC</a>,
- <a href="http://www.w3.org/Protocols/">HTTP POST</a>, or <a href="http://www.soapware.org/">SOAP</a>) behind
- the scenes and asks &quot;is this password for username=joe? If Delphi replies
- yes, then Drupal will create a new local account for joe and log joe into it.
- Joe may keep on logging into your Drupal instance in the same manner, and he
- will be logged into the same joe@remote.delphiforums.com account.</p>
-<p>One key element of DA is the 'authmap' table, which maps a user's authname
- (e.g. joe@remote.delphiforums.com) to his local UID (i.e. universal identification
- number). This map is checked whenever a user successfully logs into an external
- authentication source. Once Drupal knows that the current user is definately
- joe@remote.delphiforums.com (because Delphi says so), he looks up Joe's UID
- and logs Joe into that account.</p>
-<p>To disable distributed authentication, simply disable or remove all DA modules. For a virgin
-install, that means removing/disabling <i>jabber.module</i> and <i>drupal.module</i>
-</p>
-<p>Drupal is setup so that it is very easy to add support for any external authentication
- source. You currently have the following authentication modules installed ...</p>
- <?php
+ $output .= "<h3>Distributed authentication<a name=\"da\"> </a></h3><p>One of the more tedious moments in visiting a new website is filling out the registration form. The reg form provides helpful information to the website owner, but not much value for the user. The value for the end user is usually the ability to post a messages or receive personalized news, etc. Distributed authentication (DA) gives the user what they want without having to fill out the reg form. Removing this obstacle yields more registered and active users for the website.</p>";
+ $output .= "<p>DA enables a new user to input a username and password into the login box and immediately be recognized, even if that user never registered on your site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that your new user 'Joe' is already a registered member of Delphi Forums. If your Drupal has delphi.module installed, then Drupal will inform Joe on the registration and login screens that he may login with his Delphi ID instead of registering with your Drupal instance. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then communicates with remote.delphiforums.com (usually using ". l("XML-RPC","www.xmlrpc.com") ." ". l("HTTP POST", "www.w3.org/Protocols/") .", or ". l("SOAP", "www.soapware.org") .") behind the scenes and asks &quot;is this password for username=joe?&quot; If Delphi replies yes, then Drupal will create a new local account for joe and log joe into it. Joe may keep on logging into your Drupal instance in the same manner, and he will be logged into the same joe@remote.delphiforums.com account.</p>";
+ $output .= "<p>One key element of DA is the 'authmap' table, which maps a user's authname (e.g. joe@remote.delphiforums.com) to his local UID (i.e. universal identification number). This map is checked whenever a user successfully logs into an external authentication source. Once Drupal knows that the current user is definately joe@remote.delphiforums.com (because Delphi says so), he looks up Joe's UID and logs Joe into that account.</p>";
+ $output .= "<p>To disable distributed authentication, simply ". l("disable", "admin/system/modules") ." or remove all DA modules. For a virgin install, that means removing/disabling <i>jabber.module</i> and <i>drupal.module</i></p>";
+ $output .= "<p>Drupal is setup so that it is very easy to add support for any external authentication source. You currently have the following authentication modules installed ...</p>";
+
foreach (module_list() as $module) {
if (module_hook($module, "auth")) {
- print "<h4>" . module_invoke($module, "info", "name") . "</h4>";
- print module_invoke($module, "auth_help");
+ $output .= "<h4>" . module_invoke($module, "info", "name") . "</h4>";
+ $output .= module_invoke($module, "auth_help");
}
}
+ return $output;
}
function user_help_devel_da() {
- ?>
- <h3>Writing distributed authentication modules</h3>
-<p>Drupal is specifically architected to enable easy authoring of new authentication
- modules. I'll deconstruct the <a href="http://www.blogger.com">Blogger</a> authentication
- module here, and hopefully provide all the details you'll need to write a new
- auth module. If you want to download the full text of this module, visit the
- <a href="http://cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication/Blogger/?cvsroot=contrib">Drupal contributions CVS repository</a>.</p>
-<h4>Code review</h4>
-<pre>&lt;?php</pre>
-<p>The first line of every authentication module is the same. It is the standard
- processing instruction for any PHP file. Authentication modules are always written
- in PHP, although they typically interact with systems written in many different
- programming languages and operating systems languages.</p>
-<pre>function blogger_info($field = NULL) {
- $info["name"] = "Blogger";
- $info["protocol"] = "XML-RPC";
- $info["link"] = l("Blogger", "user/help#blogger");
- $info["maintainer"] = "Moshe Weitzman";
- $info["maintaineremail"] = "weitzman at tejasa.com";
-
- if ($field) {
- return $info[$field];
- }
- else {
- return $info;
- }
-}</pre>
-<p>The <i>_info</i> function is always the first function defined in your module.
- This function populates an array called <i>$info</i> with various pieces of
- data. Some of this data is used by Drupal (&quot;name&quot;, &quot;link&quot;),
- and some of it just informs the users of your module. Your goal is to simply
- copy the b<i>logger_info</i> function in your module - but wherever it says
- <i>blogger</i> here, substitute your own module name.</p>
-<pre>function blogger_auth($name, $pass, $server) {
- if ($server !== &quot;blogger.com&quot;) {
- return 0; // user did not present a Blogger ID so don't bother trying.
- }
-
- $appkey = &quot;6D4A2D6811A6E1F75148DC1155D33C0C958107BC&quot;; //provided to Drupal by Ev@Blogger
- $message = new xmlrpcmsg(&quot;blogger.getUsersBlogs&quot;, array(new xmlrpcval($appkey, &quot;string&quot;), new xmlrpcval($name, &quot;string&quot;), new xmlrpcval($pass, &quot;string&quot;)));
- $client = new xmlrpc_client(&quot;/api/RPC2&quot;, &quot;plant.blogger.com&quot;);
- $result = $client-&gt;send($message, 5);
-
+ $output .= "<h3>Writing distributed authentication modules</h3><p>Drupal is specifically architected to enable easy authoring of new authentication modules. I'll deconstruct the ". l("Blogger", "www.blogger.com") ." authentication module, and hopefully provide all the details you'll need to write your own auth module. If you want to download the full text of this module, visit the ". l("Blogger source", "cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication/Blogger/?cvsroot=contrib") ." in the ". l("Drupal contributions CVS repository", "cvs.drupal.org/viewcvs/contributions/?cvsroot=contrib") .".</p>";
+ $output .= "<h4>Code review</h4><pre>&lt;?php</pre><p>The first line of every Drupal module, including the authentication modules, is the same. It is the standard processing instruction for any PHP file. Authentication modules are always written in PHP, although they typically interact with systems written in many different programming languages and operating systems languages.</p>";
+ $output .= "<pre>function blogger_info(\$field = NULL) {
+ \$info[\"name\"] = \"Blogger\";
+ \$info[\"protocol\"] = \"XML-RPC\";
+ \$info[\"link\"] = \"<a href=\\\"module.php?mod=user&op=sa_help#blogger\\\">Blogger</a>\";
+ \$info[\"maintainer\"] = \"Moshe Weitzman\";
+ \$info[\"maintaineremail\"] = \"weitzman at tejasa.com\";
+ if (\$field) return \$info[\$field];
+ else return \$info;
+}</pre>";
+ $output .= "<p>The <i>_info</i> function is always the first function defined in your module. This function populates an array called <i>\$info</i> with various pieces of data. Some of this data is used by Drupal (&quot;name&quot;, &quot;link&quot;), and some of it just informs the users of your module. Simply copy the <i>blogger_info</i> function in your module - but wherever it says <i>blogger</i> here, substitute your own module name.</p>";
+ $output .= "<pre>function blogger_auth(\$name, \$pass, \$server) {
+ if (\$server !== &quot;blogger.com&quot;) return 0; // user did not present a Blogger ID so don't bother trying.
+
+ \$appkey = &quot;6D4A2D6811A6E1F75148DC1155D33C0C958107BC&quot;; //provided to Drupal by Ev@Blogger
+ \$message = new xmlrpcmsg(&quot;blogger.getUsersBlogs&quot;, array(new xmlrpcval(\$appkey, &quot;string&quot;), new xmlrpcval(\$name, &quot;string&quot;), new xmlrpcval(\$pass, &quot;string&quot;)));
+ \$client = new xmlrpc_client(&quot;/api/RPC2&quot;, &quot;plant.blogger.com&quot;);
+ // \$client->setDebug(1);
+ \$result = \$client-&gt;send(\$message, 5);
// Since Blogger doesn't return a properly formed FaultCode, we just search for the string 'fault'.
- if ($result &amp;&amp; !stristr($result-&gt;serialize(), &quot;fault&quot;)) {
- $result-&gt;serialize());
+ if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
+ // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
return 1;
}
- else if ($result) {
+ else if (\$result) {
+ // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
return 0;
}
else {
+ // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
return 0;
}
-}</pre>
-<p>The <i>_auth</i> function is the heart of any authentication module. This function
- is called whenever a user is attempting to login using your authentication module.
- For successful authentications, this function returns TRUE. Otherwise, it returns
- FALSE. This function always accepts 3 parameters, as shown above. These parameters
- are passed by the user system (user.module). The user system parses the username
- as typed by the user into 2 substrings - $name and $server. The parsing rules
- are:</p>
-<table width="80%" border="0" cellspacing="4" cellpadding="4" align="center">
- <tr>
- <th colspan="2" align="left">
- _auth function parameters
- </th>
- </tr>
- <tr>
- <th>$name</th>
- <td>The substring before the final <i>'@'</i> character in the username field</td>
- </tr>
- <tr>
- <th>$pass</th>
- <td>The whole string submitted by the user in the password field</td>
- </tr>
- <tr>
- <th>$server</th>
- <td>The substring after the final <i>'@'</i> symbol in the username field</td>
- </tr>
-</table>
-<p>So now lets use that $name, $pass, and $server which has been passed to our
- <i>_auth</i> function. Blogger authenticates users via <a href="http://www.xmlrpc.com">XML-RPC</a>.
- Your module may authenticate using a different technique. Drupal doesn't reallly
- care how your module communicates with its registration source. It just <b>trusts</b>
- the module. </p>
-<p>The lines above illustrate a typical <a href="http://www.xmlrpc.com/">XML-RPC</a>
- method call. Here we build up a message and send it to Blogger, storing the
- response in a variable called <i>$response</i>. The message we pass conforms
- to the published <a href="http://plant.blogger.com/API">Blogger XML-RPC API</a>.
- Your module will no doubt implement a different API. One peculiarity of this
- module is that we don't actually use the $server parameter. Blogger only accepts
- authentication at <i>plant.blogger.com</i>, so we hard-code that value into
- the <i>xmlrpc_client()</i> function. A more typical example might be the jabber
- module, which uses the <i>$server</i> parameter to determine where to send the
- authentication request. Also of note is the '5' parameter in the <i>$client-&gt;send()</i>
- call. This is a timeout value in seconds. All authentication modules should
- implement a timeout on their external calls. This makes sure to return control
- to the user.module if your registration database has become inoperable or unreachable.</p>
-<pre>
- if ($result &amp;&amp; !stristr($result-&gt;serialize(), &quot;fault&quot;)) {
+}</pre>";
+ $output .= "<p>The <i>_auth</i> function is the heart of any authentication module. This function is called whenever a user is attempting to login using your authentication module. For successful authentications, this function returns TRUE. Otherwise, it returns FALSE. This function always accepts 3 parameters, as shown above. These parameters are passed by the user system (user.module). The user system parses the username as typed by the user into 2 substrings - \$name and \$server. The parsing rules are:</p>";
+ $output .= "<table width=\"80%\" border=\"0\" cellspacing=\"4\" cellpadding=\"4\" align=\"center\"><tr><th colspan=\"2\" align=\"left\">_auth function parameters</th></tr><tr><th>\$name</th><td>The substring before the final <i>'@'</i> character in the username field</td></tr><tr><th>\$pass</th><td>The whole string submitted by the user in the password field</td></tr><tr><th>\$server</th><td>The substring after the final <i>'@'</i> symbol in the username field</td></tr></table>";
+ $output .= "<p>So now lets use that \$name, \$pass, and \$server which was passed to our <i>_auth</i> function. Blogger authenticates users via ". l("XML-RPC", "www.xmlrpc.org") .". Your module may authenticate using a different technique. Drupal doesn't reallly care how your module communicates with its registration source. It just <b>trusts</b> the module.</p>";
+ $output .= "<p>The lines above illustrate a typical ". l("XML-RPC", "www.xmlrpc.org") ." method call. Here we build up a message and send it to Blogger, storing the response in a variable called <i>\$response</i>. The message we pass conforms to the published ". l("Blogger XML-RPC Application Programmers Interface (API)", "plant.blogger.com/API") .". Your module will no doubt implement a different API. One peculiarity of this module is that we don't actually use the $server parameter. Blogger only accepts authentication at <i>plant.blogger.com</i>, so we hard-code that value into the <i>xmlrpc_client()</i> function. A more typical example might be the jabber module, which uses the <i>\$server</i> parameter to determine where to send the authentication request. Also of note is the '5' parameter in the <i>\$client-&gt;send\(\)</i> call. This is a timeout value in seconds. All authentication modules should implement a timeout on their external calls. This makes sure to return control to the user.module if your registration database has become inoperable or unreachable.</p>";
+ $output .= "<pre>
+ if (\$result &amp;&amp; !stristr(\$result-&gt;serialize(), &quot;fault&quot;)) {
+ // watchdog(\"user\", \"Success Blogger Auth. Response: \" . \$result->serialize());
return 1;
}
- else if ($result) {
+ else if (\$result) {
+ // watchdog(\"user\", \"Blogger Auth failure. Response was \" . \$result->serialize());
return 0;
}
else {
+ // watchdog(\"user\", \"Blogger Auth failure. Could not connect.\");
return 0;
}
-</pre>
-<p>This second half of the <i>_auth</i> function examines the <i>$response</i>
- from plant.blogger.com and returns a TRUE or FALSE as appropriate. This is a
- critical decision, so do be sure you have good logic here, and perform sufficient
- testing for all cases. In the case of Blogger, we search for the string 'fault'
- in the response. If that string is present, or there is no repsonse, our function
- returns FALSE. Otherwise, Blogger has returned valid data to our method request
- and we return TRUE.
-</p>
-<pre>function blogger_page() {
+</pre>";
+ $output .= "<p>This second half of the <i>_auth</i> function examines the <i>\$response</i> from plant.blogger.com and returns a TRUE (1) or FALSE (0) as appropriate. This is a critical decision, so be sure that you have good logic here, and perform sufficient testing for all cases. In the case of Blogger, we search for the string 'fault' in the response. If that string is present, or there is no repsonse, our function returns FALSE. Otherwise, Blogger has returned valid data to our method request and we return TRUE. Note: Everything starting with \"//\" is a comment and is not executed.</p>";
+ $output .= "<pre>function blogger_page() {
theme(&quot;header&quot;);
theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_auth_help());
theme(&quot;footer&quot;);
-}</pre>
-<p>The _page function is not currently used, but it might be in the future. For
- now, just copy what you see here, substituting your module name for <i>blogger</i>.</p>
-<pre>function blogger_auth_help() {
- $site = variable_get(&quot;site_name&quot;, &quot;this web site&quot;);
- $output = &quot;
- &lt;p&gt;You may login to &lt;i&gt;%s&lt;/i&gt; using a &lt;b&gt;Blogger ID&lt;/b&gt;
- and password. A Blogger ID consists of your Blogger username followed by &lt;i&gt;@blogger.com&lt;/i&gt;.
- So a valid blogger ID is mwlily@blogger.com. If you are a Blogger member, go
- ahead and login now.&lt;/p&gt;<br />
- &lt;p&gt;Blogger offers you instant communication power by letting you post
- your thoughts to the web whenever the urge strikes.
- Blogger will publish to your current web site or help you create one. &lt;a
- href=\&quot;http://www.blogger.com/about.pyra\&quot;&gt;Learn more about it&lt;/a&gt;.&quot;;
-
- return sprintf(t($output), $site);
+}</pre>";
+ $output .= "<p>The _page function is not currently used, but it might be in the future. For now, just copy what you see here, substituting your module name for <i>blogger</i>.</p>";
+ $output .= "<pre>function blogger_auth_help() {
+ \$site = variable_get(&quot;site_name&quot;, &quot;this web site&quot;);
+ \$html_output = &quot;
+ &lt;p&gt;You may login to &lt;i&gt;%s&lt;/i&gt; using a &lt;b&gt;Blogger ID&lt;/b&gt; and password. A Blogger ID consists of your Blogger username followed by &lt;i&gt;@blogger.com&lt;/i&gt;. So a valid blogger ID is mwlily@blogger.com. If you are a Blogger member, go ahead and login now.&lt;/p&gt;
+ &lt;p&gt;Blogger offers you instant communication power by letting you post your thoughts to the web whenever the urge strikes.
+ Blogger will publish to your current web site or help you create one. &lt;a href=\&quot;http://www.blogger.com/about.pyra\&quot;&gt;Learn more about it&lt;/a&gt;.&quot;;
+ return sprintf(t(\$html_output), \$site);
}
-</pre>
-<p>The <i>_auth_help</i> function is prominently linked within Drupal, so you'll
- want to write the best possible user help here. You'll want to tell users what
- a proper username looks like for your authentication module. Also, you may advertise
- a bit about your service at the end. Note that your help text is passed through
- a t() function in the last line. This is Drupal's localization function. Translators
- may localize your help text just like any other text in Drupal.</p>
-<h4>Publishing your module</h4>
-<p>Once you've written and tested your authentication module, you'll have to usually
- want to share it with the world. The best way to do this is to add the module
- to the <a href="http://cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication/Blogger/?cvsroot=contrib">Drupal
- contributions CVS repository</a>. You'll need to request priveleges in this repository - see <a href="http://cvs.drupal.org/viewcvs.cgi/contributions/README?rev=HEAD&amp;cvsroot=contrib&amp;content-type=text/vnd.viewcvs-markup">README</a>
- for the details. Then you'll want to announce your contribution on the <a href="http://list.drupal.org/>drupal-devel and drupal-support mailing lists</a>. You might also want to post a story on
- <a href="http://www.drupal.org/">Drupal.org</a>.<br>
-</p>
- <?php
+</pre>";
+ $output .= "<p>The <i>_auth_help</i> function is prominently linked within Drupal, so you'll want to write the best possible user help here. You'll want to tell users what a proper username looks like and you may also want to advertise a bit about your service at the end. Note that your help text is passed through a t() function in the last line. This is Drupal's localization function. Translators may localize your help text just like any other text in Drupal.</p>";
+ $output .= "<h4>Publishing your module</h4><p>Once you've written and tested your authentication module, you'll usually want to share it with the world. The best way to do this is to add the module to the ". l("Drupal contributions CVS repository", "cvs.drupal.org/viewcvs.cgi/contributions/modules/authentication?cvsroot=contrib") .". You'll need to request priveleges to this repository - see ". l("the README file", "cvs.drupal.org/viewcvs.cgi/contributions/README?rev=HEAD&amp;cvsroot=contrib&amp;content-type=text/vnd.viewcvs-markup") ." for the details. Then you should announce your contribution on the ". l("drupal-devel and drupal-support mailing lists", "drupal.org/node/view/322") .". You might also want to post a story on ". l("Drupal.org", "www.drupal.org") .".</p>";
+ return $output;
}
function user_help_devel_userhook() {
- ?>
- <h3><a name="userhook">module_user()</a></h3>
- <p>The <b>_user()</b> hook provides to module authors a mechanism for inserting text and form fields into the registration page, the user account view/edit pages, and the administer users page. This is useful if you want to add a custom field for your particular community. This is best illustrated by an example called <a href="http://cvs.drupal.org/viewcvs.cgi/contributions/modules/profile/?cvsroot=contrib">profile.module</a> in the contributions CVS repository. Profile.module is meant to be customized for your needs. Please download it and hack away until it does what you need.</p>
-
-<p>Consider this simpler example from a fictional recipe community web site called Julia's Kitchen. Julia customizes her Drupal powered site by creating a new file called <i>julia.module</i>. That file does the following:<ul>
-<li>new members must agree to Julia's Privacy Policy on the reg page.</li>
-<li>members may list their favorite ingredients on their public user profile page</li></ul></p>
-
-<p>Julia achieves this with the following code. The comments below should help you understand what is going on.</p>
-
-<pre>
-function julia_user($type, $edit, &$user) {
- switch ($type) {
- case "register_form":
- $output .= form_item("Privacy Policy", "Julia would never sell your user information. She is just nice old French chef who lives near me in Cambridge, Massachussetts USA.");
- $output .= form_checkbox("Accept <i>Julia's Kitchen</i> privacy policy.", julia_accept, 1, $edit["julia_accept"]);
- return $output;
- case "register_validate":
- if ($edit["julia_accept"] == "1") {
+
+ $output .= "<h3><a name=\"userhook\">module_user()</a></h3><p>The <b>_user()</b> hook provides a mechanism for inserting text and form fields into the ". l("registration","user/register") .", ". l("user account view/edit", "user") .", and ". l("administer users", "admin/user") ." pages. This is useful if you want to add a custom field for your particular community. This is best illustrated by the ". l("profile.module", "cvs.drupal.org/viewcvs/drupal/modules/profile.module") .". The profile.module is meant to be customized for your needs. Please download it and hack away until it does what you need.</p>";
+
+ $output .= "<p>Consider this simpler example from a fictional recipe community web site called Julia's Kitchen. Julia customizes her Drupal powered site by creating a new file called <i>julia.module</i>. That file does the following:<ul><li>new members must agree to Julia's Privacy Policy on the reg page.</li><li>members may list their favorite ingredients on their public user profile page</li></ul></p>";
+
+ $output .= "<p>Julia achieves this with the following code. The comments below should help you understand what is going on.</p>";
+
+ $output .= "<pre>
+function julia_user(\$type, \$edit, &\$user) {
+
+ switch (\$type) { // What type of registration action are we taking.
+ case t(\"register_form\"): // Add the two items below to the resigtration form.
+ \$output .= form_item(\"Privacy Policy\", \"Julia would never sell your user information. She is just nice old French chef who lives near me in Cambridge, Massachussetts USA.\");
+ \$output .= form_checkbox(\"Accept <i>Julia's Kitchen</i> privacy policy.\", julia_accept, 1, \$edit[\"julia_accept\"]);
+ return \$output;
+ case t(\"register_validate\"): // Okay, the user has filled out the form, did they agree.
+ if (\$edit[\"julia_accept\"] == \"1\") {
// on success return the values you want to store
- return array("julia_accept" => 1);
+ return array(\"julia_accept\" => 1);
}
else {
// on error return an error message
- return "You must accept the Julia's Kitchen privacy policy to register.";
+ return \"You must accept the Julia's Kitchen privacy policy to register.\";
}
- case "view_public":
+ case t(\"view_public\"):
// when others look at user data
- return form_item("Favorite Ingredient", $user->julia_favingredient);
- case "view_private":
+ return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
+ case t(\"view_private\"):
// when user tries to view his own user page.
- return form_item("Favorite Ingredient", $user->julia_favingredient);
- case "edit_form":
+ return form_item(\"Favorite Ingredient\", \$user->julia_favingredient);
+ case t(\"edit_form\"):
// when user tries to edit his own user page.
- return form_textfield("Favorite Ingredient", "julia_favingredient", $user->julia_favingredient, 50, 65, "Tell everyone your secret spice");
- case "edit_validate":
- return user_save($user, array("julia_favingredient" => $edit["julia_favingredient"]));
+ return form_textfield(\"Favorite Ingredient\", \"julia_favingredient\", \$user->julia_favingredient, 50, 65, \"Tell everyone your secret spice\");
+ case t(\"edit_validate\"): // Make sure the data they edited is \"valid\".
+ return user_save(\$user, array(\"julia_favingredient\" => \$edit[\"julia_favingredient\"]));
}
}
-</pre>
- <?php
+</pre>";
+ return $output;
}
?>
diff --git a/modules/watchdog.module b/modules/watchdog.module
index 9337d4bbf..601363e0e 100644
--- a/modules/watchdog.module
+++ b/modules/watchdog.module
@@ -2,14 +2,15 @@
// $Id$
function watchdog_help() {
- ?>
- <p>The watchdog module monitors your website, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.</p>
- <p>To ease administration, the watchdog will automatically discard old log entries.</p>
- <?php
+
+ $output .= "<p>Watchdog module monitors your web site, capturing system events in a log to be reviewed by an authorized individual at a later time. The Watchdog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to ". l("check the Watchdog report", "admin/watchdog") ." on a regular basis as it is often the only way to tell what is going on.</p>";
+ $output .= "<p>To ease administration, the watchdog will automatically discard old log entries, ". l("as configured", "admin/system/modules/watchdog") .". Needs \"cron.php\" to discard the entries.</p>";
+ return t($output);
}
function watchdog_system($field){
$system["description"] = t("Logs and records system events.");
+ $system["admin_help"] = t("Watchdog logs your system events. Too see these logs go to <a href=\"%watchdog\">Site monitoring</a>. Since these logs can grow out of control if kept around forever, below set how long an item should be kept in the log.<br />Note:<ul><li>To discard entries as set below you must run \"cron.php\" regularly.</li></ul>", array("%watchdog" => url("admin/watchdog")));
return $system[$field];
}
@@ -19,16 +20,22 @@ function watchdog_perm() {
function watchdog_link($type) {
if ($type == "admin" && user_access("administer watchdog")) {
- $help = "The watchdog module monitors your website, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.";
-
- menu("admin/watchdog", "site monitoring", "watchdog_admin", $help, 6);
- menu("admin/watchdog/user", "user messages", "watchdog_admin", $help);
- menu("admin/watchdog/regular", "regular messages", "watchdog_admin", $help);
- menu("admin/watchdog/special", "special messages", "watchdog_admin", $help);
- menu("admin/watchdog/warning", "warning messages", "watchdog_admin", $help);
- menu("admin/watchdog/error", "error messages", "watchdog_admin", $help);
- menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", $help);
- menu("admin/watchdog/view", "view details", "watchdog_admin", $help, 0, 1); // hidden menu
+- $help["general"] = t("The watchdog module monitors your web site, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.");
+- $help["user"] = t("Watchdog events that have to do with users. Most of these come from the user.module.");
+- $help["regular"] = t("Watchdog events that are \"normal\" and have no other classification.");
+- $help["httpd"] = t("Watchdog events that are from the web server.<br />Note: At this time this logging level is <b>not</b> used.");
+- $help["special"] = t("Watchdog events about adding, changing, and moderating nodes and comments.");
+- $help["error"] = t("Watchdog general error events, such as invalid login, permission denied, and database errors.");
+- $help["warning"] = t("Watchdog warning events. These events don't stop Drupal from running, but are things you should no to correct.");
+
+ menu("admin/watchdog", "site monitoring", "watchdog_admin", $help["general"], 6);
+ menu("admin/watchdog/user", "user messages", "watchdog_admin", $help["user"]);
+ menu("admin/watchdog/regular", "regular messages", "watchdog_admin", $help["regular"]);
+ menu("admin/watchdog/special", "special messages", "watchdog_admin", $help["special"]);
+ menu("admin/watchdog/warning", "warning messages", "watchdog_admin", $help["warning"]);
+ menu("admin/watchdog/error", "error messages", "watchdog_admin", $help["error"]);
+ menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", $help["http"]);
+ menu("admin/watchdog/view", "view details", "watchdog_admin", $help["general"], 0, 1); // hidden menu
}
}
diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module
index 9337d4bbf..601363e0e 100644
--- a/modules/watchdog/watchdog.module
+++ b/modules/watchdog/watchdog.module
@@ -2,14 +2,15 @@
// $Id$
function watchdog_help() {
- ?>
- <p>The watchdog module monitors your website, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.</p>
- <p>To ease administration, the watchdog will automatically discard old log entries.</p>
- <?php
+
+ $output .= "<p>Watchdog module monitors your web site, capturing system events in a log to be reviewed by an authorized individual at a later time. The Watchdog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to ". l("check the Watchdog report", "admin/watchdog") ." on a regular basis as it is often the only way to tell what is going on.</p>";
+ $output .= "<p>To ease administration, the watchdog will automatically discard old log entries, ". l("as configured", "admin/system/modules/watchdog") .". Needs \"cron.php\" to discard the entries.</p>";
+ return t($output);
}
function watchdog_system($field){
$system["description"] = t("Logs and records system events.");
+ $system["admin_help"] = t("Watchdog logs your system events. Too see these logs go to <a href=\"%watchdog\">Site monitoring</a>. Since these logs can grow out of control if kept around forever, below set how long an item should be kept in the log.<br />Note:<ul><li>To discard entries as set below you must run \"cron.php\" regularly.</li></ul>", array("%watchdog" => url("admin/watchdog")));
return $system[$field];
}
@@ -19,16 +20,22 @@ function watchdog_perm() {
function watchdog_link($type) {
if ($type == "admin" && user_access("administer watchdog")) {
- $help = "The watchdog module monitors your website, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.";
-
- menu("admin/watchdog", "site monitoring", "watchdog_admin", $help, 6);
- menu("admin/watchdog/user", "user messages", "watchdog_admin", $help);
- menu("admin/watchdog/regular", "regular messages", "watchdog_admin", $help);
- menu("admin/watchdog/special", "special messages", "watchdog_admin", $help);
- menu("admin/watchdog/warning", "warning messages", "watchdog_admin", $help);
- menu("admin/watchdog/error", "error messages", "watchdog_admin", $help);
- menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", $help);
- menu("admin/watchdog/view", "view details", "watchdog_admin", $help, 0, 1); // hidden menu
+- $help["general"] = t("The watchdog module monitors your web site, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.");
+- $help["user"] = t("Watchdog events that have to do with users. Most of these come from the user.module.");
+- $help["regular"] = t("Watchdog events that are \"normal\" and have no other classification.");
+- $help["httpd"] = t("Watchdog events that are from the web server.<br />Note: At this time this logging level is <b>not</b> used.");
+- $help["special"] = t("Watchdog events about adding, changing, and moderating nodes and comments.");
+- $help["error"] = t("Watchdog general error events, such as invalid login, permission denied, and database errors.");
+- $help["warning"] = t("Watchdog warning events. These events don't stop Drupal from running, but are things you should no to correct.");
+
+ menu("admin/watchdog", "site monitoring", "watchdog_admin", $help["general"], 6);
+ menu("admin/watchdog/user", "user messages", "watchdog_admin", $help["user"]);
+ menu("admin/watchdog/regular", "regular messages", "watchdog_admin", $help["regular"]);
+ menu("admin/watchdog/special", "special messages", "watchdog_admin", $help["special"]);
+ menu("admin/watchdog/warning", "warning messages", "watchdog_admin", $help["warning"]);
+ menu("admin/watchdog/error", "error messages", "watchdog_admin", $help["error"]);
+ menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", $help["http"]);
+ menu("admin/watchdog/view", "view details", "watchdog_admin", $help["general"], 0, 1); // hidden menu
}
}