diff --git a/modules/admin.module b/modules/admin.module index 81e23fffa9d..5af8a76c8af 100644 --- a/modules/admin.module +++ b/modules/admin.module @@ -9,17 +9,35 @@ function status($message) { } } +function admin_help($section) { + $output = ""; + + switch ($section) { + case 'admin/system/modules': + $output .= "Handles the administration pages."; + break; + case 'admin': + $output .= "Welcome to the administration section. 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,bread crumbs, 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."; + break; + case 'admin': + $output = "This is a complete overview of the site administration page."; + break; + } + + return t($output); +} function admin_system($field){ - $system["description"] = t("Handles the administration pages."); - return $system[$field]; + $output = ""; + + if ($field == "description") { $output = admin_help("admin/system/modules"); } + + return $output; } function admin_link($type) { if ($type == "admin") { - $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", "sitemap", "overview_callback", $help["overview"], 8); + menu("admin", "Administration", NULL, admin_help("admin")); + menu("admin/overview", "sitemap", "overview_callback", admin_help("admin/overview"), 8); } } diff --git a/modules/archive.module b/modules/archive.module index 8fbfe6dab21..c12272c04dd 100644 --- a/modules/archive.module +++ b/modules/archive.module @@ -1,10 +1,27 @@ Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.

"; - $output .= "

Which sidebar each block appears in depends on which theme you're using (some are left-only, some right, some both), and also on the settings in block management.

Whether a block is visible in the first place depends on three things:

"; - $output .= "

The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a weight to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.

"; - $output .= "

The path setting lets you define on which pages you want a 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!

"; - $output .= "

In case you should not know what a regular expression is, you should read about them in the PHP manual. The chapter to look at is the one on Perl-Compatible Regular Expressions (PCRE).

"; - $output .= "

However, for basic tasks it is sufficient to look at the following examples:

"; - $output .= "

If the block should only show up on blog pages, use </blog>. To display on all node views use </node/view>. The angular brackets are used as delimiters of the regular expression. To show up on either forum or book pages use <(/forum|/book)>. The round brackets form a group of expressions, divided by the | character. It matches if any of the expressions in it match. A more complicated example is </node/add/(story|blog|image)>. Blocks which have their paths set to this expression will show up on story, block, or image composition pages.

"; - $output .= "

Custom Blocks

"; - $output .= "

A custom block is a block that contains admin-supplied HTML, text or PHP content (as opposed to being generated automatically by a module). 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.

"; - $output .= "

PHP in custom blocks

"; - $output .= "

If you know how to script in PHP, Drupal gives you the power to embed any script you like inside a block. It will be executed at page view and dynamically embedded into the page. This gives you amazing flexibility and power, but of course with that comes danger and insecurity if you don't write good code. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP custom blocks because you can corrupt your database or render your site insecure or even unusable! If you don't plan to do fancy stuff with custom blocks then you're probably better off with straight HTML.

"; - $output .= "

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.

"; - $output .= "

Notes:

"; - $output .= "

A basic example:

"; - $output .= "

You want to have a box with the title \"Welcome\" that you use to greet your visitors. The content for this box could be created by going:

"; - $output .= "
+function block_help($section = "admin/block/help") {
+  $output = "";
+
+  switch ($section) {
+    case 'admin/block/help':
+      $output .= "

Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.

"; + $output .= "

The sidebar each block appears in depends on both which theme you're using (some are left-only, some right, some both), and on the settings in block management.

Whether a block is visible in the first place depends on three things:

"; + $output .= "

The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a weight to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.

"; + $output .= "

The path setting lets you define the pages on which a specific block is visable. If you leave the path blank it will appear on all pages. The path uses a regular expression syntax so remember to escape special characters!

"; + $output .= strtr("

In case you do not know what a regular expression is, you should read about them in the PHP manual. The chapter to look at is the one on %pcre

", array("%pcre" => l(t("Perl-Compatible Regular Expressions (PCRE)"), "php.net/pcre", array("location" => "global")))); + $output .= "

However, for basic tasks it is sufficient to look at the following examples:

"; + $output .= "

If the block should only show up on blog pages, use </blog>. To display on all node views use </node/view>. The angular brackets are used as delimiters of the regular expression. To show up on either forum or book pages use <(/forum|/book)>. The round brackets form a group of expressions, divided by the | character. It matches if any of the expressions in it match. A more complicated example is </node/add/(story|blog|image)>. Blocks which have their paths set to this expression will show up on story, block, or image composition pages.

"; + $output .= "

Custom Blocks

"; + $output .= "

A custom block contains admin-supplied HTML, text or PHP content (as opposed to being generated automatically by a module). Each custom block consists of a title, a description, and a body containing text, HTML, or PHP code which can be as long as you wish. The Drupal engine will 'render' the content of the custom block.

"; + $output .= "

PHP in custom blocks

"; + $output .= "

If you know how to script in PHP, Drupal gives you the power to embed any script you like inside a block. It will be executed when the page is viewed and dynamically embedded into the page. This gives you amazing flexibility and power, but of course with that comes danger and insecurity if you don't write good code. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP custom blocks because you can corrupt your database or render your site insecure or even unusable! If you don't plan to do fancy stuff with custom blocks then you're probably better off with straight HTML.

"; + $output .= "

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.

"; + $output .= "

Notes:

"; + $output .= "

A basic example:

"; + $output .= "

You want to have a box with the title \"Welcome\" that you use to greet your visitors. The content for this box could be created by going:

"; + $output .= "
   return t(\"Welcome visitor, ... welcome message goes here ...\");
 
"; - $output .= "

If we are however dealing with a registered user, we can customize the message by using:

"; - $output .= "
+      $output .= "

If we are however dealing with a registered user, we can customize the message by using:

"; + $output .= "
   if (\$user->uid) {
     return t(\"Welcome \$user->name, ... welcome message goes here ...\");
   }
   else {
     return t(\"Welcome visitor, ... welcome message goes here ...\");
   }";
-  $output .= "
"; - $output .= "

For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.

"; - return t($output); + $output .= "
"; + $output .= "

For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.

"; + break; + case 'admin/system/modules': + $output = "Controls the boxes that are displayed around the main content."; + break; + case 'admin/block': + $output = strtr("Blocks are the boxes in the left- and right- side bars of the web site, depending on the choosen theme. They are created by active Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting lets you define which pages you want a block to be shown on. The custom checkbox lets your users hide the block using their account setting. You can also create your own blocks, where you specify the content of the block rather than its being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks.", array("%createblock" => l(t("create new block"), "admin/block/add"))); +; + break; + case 'admin/block/add': + $output = strtr("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using %overview. The title is used when displaying the block. The description is used in the \"block\" column on the %overview page. If you are going to place PHP code in the block, and you have create php content permission (see %permission) you must change the type to PHP to make your code active.", array("%overview" => l(t("block management"), "admin/block"), "%permission" => l(t("user management"), "admin/user/permission"))); + break; + case 'admin/block/preview': + $output = "This page show you the placement of your blocks in different themes types. The numbers are the weight of each block, which is used to sort them within the sidebars."; + break; + } + return t($output); } function block_system($field){ - $system["description"] = t("Controls the boxes that are displayed around the main content."); - return $system[$field]; + $output = ""; + + if ($field == "description") { $output = admin_help("admin/system/modules"); }; + + return $output; } function block_perm() { @@ -45,13 +67,10 @@ function block_perm() { function block_link($type) { if ($type == "admin" && user_access("administer blocks")) { - $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 active Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" 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 lets your users hide the block from their account setting page. You can also create your own blocks, where you specify the content of the block rather than it being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks.", array("%createblock" => l(t("create new block"), "admin/block/add"))); - $help["create"] = t("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using block management. The title is used when displaying the block. The description is used in the \"block\" column on the block management page. If you are going to place PHP code in the block, and you have create php content permission (see user management >> user permissions) you must 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 helps show you the placement of your blocks in different themes. The numbers are the weight of each block, which is used to sort them within the sidebars."); - menu("admin/block", "block management", "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", "block management", "block_admin", block_help("admin/block"), 3); + menu("admin/block/add", "create new block", "block_admin", block_help("admin/block/add"), 2); + menu("admin/block/preview", "preview placement", "block_admin", block_help("admin/block/preview"), 3); menu("admin/block/help", "help", "block_help", NULL, 9); } } diff --git a/modules/block/block.module b/modules/block/block.module index 2c9ca8eef48..1d752f13c01 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -1,42 +1,64 @@ Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.

"; - $output .= "

Which sidebar each block appears in depends on which theme you're using (some are left-only, some right, some both), and also on the settings in block management.

Whether a block is visible in the first place depends on three things:

"; - $output .= "

The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a weight to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.

"; - $output .= "

The path setting lets you define on which pages you want a 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!

"; - $output .= "

In case you should not know what a regular expression is, you should read about them in the PHP manual. The chapter to look at is the one on Perl-Compatible Regular Expressions (PCRE).

"; - $output .= "

However, for basic tasks it is sufficient to look at the following examples:

"; - $output .= "

If the block should only show up on blog pages, use </blog>. To display on all node views use </node/view>. The angular brackets are used as delimiters of the regular expression. To show up on either forum or book pages use <(/forum|/book)>. The round brackets form a group of expressions, divided by the | character. It matches if any of the expressions in it match. A more complicated example is </node/add/(story|blog|image)>. Blocks which have their paths set to this expression will show up on story, block, or image composition pages.

"; - $output .= "

Custom Blocks

"; - $output .= "

A custom block is a block that contains admin-supplied HTML, text or PHP content (as opposed to being generated automatically by a module). 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.

"; - $output .= "

PHP in custom blocks

"; - $output .= "

If you know how to script in PHP, Drupal gives you the power to embed any script you like inside a block. It will be executed at page view and dynamically embedded into the page. This gives you amazing flexibility and power, but of course with that comes danger and insecurity if you don't write good code. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP custom blocks because you can corrupt your database or render your site insecure or even unusable! If you don't plan to do fancy stuff with custom blocks then you're probably better off with straight HTML.

"; - $output .= "

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.

"; - $output .= "

Notes:

"; - $output .= "

A basic example:

"; - $output .= "

You want to have a box with the title \"Welcome\" that you use to greet your visitors. The content for this box could be created by going:

"; - $output .= "
+function block_help($section = "admin/block/help") {
+  $output = "";
+
+  switch ($section) {
+    case 'admin/block/help':
+      $output .= "

Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.

"; + $output .= "

The sidebar each block appears in depends on both which theme you're using (some are left-only, some right, some both), and on the settings in block management.

Whether a block is visible in the first place depends on three things:

"; + $output .= "

The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a weight to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.

"; + $output .= "

The path setting lets you define the pages on which a specific block is visable. If you leave the path blank it will appear on all pages. The path uses a regular expression syntax so remember to escape special characters!

"; + $output .= strtr("

In case you do not know what a regular expression is, you should read about them in the PHP manual. The chapter to look at is the one on %pcre

", array("%pcre" => l(t("Perl-Compatible Regular Expressions (PCRE)"), "php.net/pcre", array("location" => "global")))); + $output .= "

However, for basic tasks it is sufficient to look at the following examples:

"; + $output .= "

If the block should only show up on blog pages, use </blog>. To display on all node views use </node/view>. The angular brackets are used as delimiters of the regular expression. To show up on either forum or book pages use <(/forum|/book)>. The round brackets form a group of expressions, divided by the | character. It matches if any of the expressions in it match. A more complicated example is </node/add/(story|blog|image)>. Blocks which have their paths set to this expression will show up on story, block, or image composition pages.

"; + $output .= "

Custom Blocks

"; + $output .= "

A custom block contains admin-supplied HTML, text or PHP content (as opposed to being generated automatically by a module). Each custom block consists of a title, a description, and a body containing text, HTML, or PHP code which can be as long as you wish. The Drupal engine will 'render' the content of the custom block.

"; + $output .= "

PHP in custom blocks

"; + $output .= "

If you know how to script in PHP, Drupal gives you the power to embed any script you like inside a block. It will be executed when the page is viewed and dynamically embedded into the page. This gives you amazing flexibility and power, but of course with that comes danger and insecurity if you don't write good code. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP custom blocks because you can corrupt your database or render your site insecure or even unusable! If you don't plan to do fancy stuff with custom blocks then you're probably better off with straight HTML.

"; + $output .= "

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.

"; + $output .= "

Notes:

"; + $output .= "

A basic example:

"; + $output .= "

You want to have a box with the title \"Welcome\" that you use to greet your visitors. The content for this box could be created by going:

"; + $output .= "
   return t(\"Welcome visitor, ... welcome message goes here ...\");
 
"; - $output .= "

If we are however dealing with a registered user, we can customize the message by using:

"; - $output .= "
+      $output .= "

If we are however dealing with a registered user, we can customize the message by using:

"; + $output .= "
   if (\$user->uid) {
     return t(\"Welcome \$user->name, ... welcome message goes here ...\");
   }
   else {
     return t(\"Welcome visitor, ... welcome message goes here ...\");
   }";
-  $output .= "
"; - $output .= "

For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.

"; - return t($output); + $output .= "
"; + $output .= "

For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.

"; + break; + case 'admin/system/modules': + $output = "Controls the boxes that are displayed around the main content."; + break; + case 'admin/block': + $output = strtr("Blocks are the boxes in the left- and right- side bars of the web site, depending on the choosen theme. They are created by active Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting lets you define which pages you want a block to be shown on. The custom checkbox lets your users hide the block using their account setting. You can also create your own blocks, where you specify the content of the block rather than its being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks.", array("%createblock" => l(t("create new block"), "admin/block/add"))); +; + break; + case 'admin/block/add': + $output = strtr("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using %overview. The title is used when displaying the block. The description is used in the \"block\" column on the %overview page. If you are going to place PHP code in the block, and you have create php content permission (see %permission) you must change the type to PHP to make your code active.", array("%overview" => l(t("block management"), "admin/block"), "%permission" => l(t("user management"), "admin/user/permission"))); + break; + case 'admin/block/preview': + $output = "This page show you the placement of your blocks in different themes types. The numbers are the weight of each block, which is used to sort them within the sidebars."; + break; + } + return t($output); } function block_system($field){ - $system["description"] = t("Controls the boxes that are displayed around the main content."); - return $system[$field]; + $output = ""; + + if ($field == "description") { $output = admin_help("admin/system/modules"); }; + + return $output; } function block_perm() { @@ -45,13 +67,10 @@ function block_perm() { function block_link($type) { if ($type == "admin" && user_access("administer blocks")) { - $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 active Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" 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 lets your users hide the block from their account setting page. You can also create your own blocks, where you specify the content of the block rather than it being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks.", array("%createblock" => l(t("create new block"), "admin/block/add"))); - $help["create"] = t("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using block management. The title is used when displaying the block. The description is used in the \"block\" column on the block management page. If you are going to place PHP code in the block, and you have create php content permission (see user management >> user permissions) you must 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 helps show you the placement of your blocks in different themes. The numbers are the weight of each block, which is used to sort them within the sidebars."); - menu("admin/block", "block management", "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", "block management", "block_admin", block_help("admin/block"), 3); + menu("admin/block/add", "create new block", "block_admin", block_help("admin/block/add"), 2); + menu("admin/block/preview", "preview placement", "block_admin", block_help("admin/block/preview"), 3); menu("admin/block/help", "help", "block_help", NULL, 9); } } diff --git a/modules/blog.module b/modules/blog.module index 951d6a060b1..9dab214f4c5 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -2,9 +2,12 @@ // $Id$ 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]; + $output = ""; + + if ($field == "description") { $output = blog_help("admin/system/modules"); } + else if ($field == "admin_help") { $output = blog_help("admin/system/modules/blog"); }; + + return $output; } function blog_settings() { @@ -71,14 +74,26 @@ function blog_user($type, &$edit, &$user) { } } -function blog_help() { - $output .= "

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. These 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 are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen, or agree/disagree with. A typical example of a long term blog can be seen at http://www.scripting.com/.

"; - $output .= "

The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.

"; - $output .= "

If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link (b) next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.

"; +function blog_help($section) { + $output =""; + + switch ($section) { + case 'admin/blog/help': + case 'admin/help': + $output .= "

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. These 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 .= strtr("

Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.

", array("%scripting-com" => l(t("http://www.scripting.com"), "www.scripting.com", array("location" => "global")))); + $output .= "

The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.

"; + $output .= "

If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link (b) next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.

"; + break; + case 'admin/system/modules': + $output .= "Enables keeping a blog or easily and regularly updated web page."; + break; + case 'admin/system/modules/blog': + $output .= "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"; + break; + } return t($output); - } function blog_feed_user($uid = 0) { diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 951d6a060b1..9dab214f4c5 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -2,9 +2,12 @@ // $Id$ 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]; + $output = ""; + + if ($field == "description") { $output = blog_help("admin/system/modules"); } + else if ($field == "admin_help") { $output = blog_help("admin/system/modules/blog"); }; + + return $output; } function blog_settings() { @@ -71,14 +74,26 @@ function blog_user($type, &$edit, &$user) { } } -function blog_help() { - $output .= "

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. These 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 are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen, or agree/disagree with. A typical example of a long term blog can be seen at http://www.scripting.com/.

"; - $output .= "

The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.

"; - $output .= "

If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link (b) next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.

"; +function blog_help($section) { + $output =""; + + switch ($section) { + case 'admin/blog/help': + case 'admin/help': + $output .= "

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. These 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 .= strtr("

Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.

", array("%scripting-com" => l(t("http://www.scripting.com"), "www.scripting.com", array("location" => "global")))); + $output .= "

The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.

"; + $output .= "

If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link (b) next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.

"; + break; + case 'admin/system/modules': + $output .= "Enables keeping a blog or easily and regularly updated web page."; + break; + case 'admin/system/modules/blog': + $output .= "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"; + break; + } return t($output); - } function blog_feed_user($uid = 0) { diff --git a/modules/bloggerapi.module b/modules/bloggerapi.module index 3fb5d4edc3b..0535fa21f54 100644 --- a/modules/bloggerapi.module +++ b/modules/bloggerapi.module @@ -365,29 +365,43 @@ function bloggerapi_perm() { } function bloggerapi_system($field){ - $system["description"] = t("Enables users to post using tools or applications that support the Blogger API."); - return $system[$field]; + $output = ""; + + if ($field == "description") {$output .= bloggerapi_help("admin/system/modules"); }; + + return $output; } -function bloggerapi_help() { +function bloggerapi_help($section) { + $output = ""; - $output = "

Introduction

"; - $output .= "

Blogger, 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 Blogger API, which means that many remote clients (e.g. Radio, Blogbuddy, w.bloggar, TextRouter, 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 content accepting machine™.

"; - $output .= "

The Blogger API uses the XML-RPC protocol for communicating with the outside world. XML-RPC, originally developed by Dave Winer of UserLand Software, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses XML-RPC for several other tasks (e.g. notifiying weblogs.com of blog updates and making/accepting ". l("distributed authentication", "user/help") ." requests)

"; - $output .= "

Blogger API implementation

"; - $output .= "

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 may not be the best implementation of a distributed weblog API. For a promising candidate, see the Echo project.

"; - $output .= "

Drupal's support for the Blogger API is quite complete. Each method with an asterisk below has been implemented in Drupal.

"; - $output .= "

blogger.newPost()*
blogger.editPost()*
blogger.getUsersBlogs()*
blogger.getUserInfo()*
blogger.getTemplate()
blogger.setTemplate()

"; - $output .= "

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:

"; - $output .= "

blogger.getPost()*
blogger.getRecentPosts()*
blogger.deletePost()*

"; - $output .= "

Installation and usage

"; - $output .= "

To install the Blogger API module, enable the module on the ". l("modules configuration page", "admin/systems/modules") ." 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 pages. Check the checkbox behind the line \"access Blogger API\" for the roles that are allowed to use the Blogger API.

"; - $output .= "

Once the API is enabled you can download one of the above mentioned Blogger API clients and get blogging.

"; - $output .= "

Setup of the client

"; - $output .= "

The Drupal page you need to call in order to connect using the Blogger API is http://server/xmlrpc.php where server is the URL of the site you want to post to. As an example when posting to drupal.org, the account settings for w.bloggar would be: host: www.drupal.org (default = plant.blogger.com) and page: xmlrpc.php (default = /api/RPC2).

"; - $output .= "

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.

"; - $output .= "

Notes and limitations

"; - $output .= ""; + switch ($section) { + case 'admin/bloggerapi/help': + case 'admin/help': + $output = "

Introduction

"; + $output .= strtr("

%blogger-com, 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 %blogger-api, which means that many remote clients (e.g. %client-radio, %client-blogbuddy, %client-w_bloggar, and %client-textrouter) 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 content accepting machine™.

", array("%blogger-com" => l(t("Blogger"), "www.blogger.com", array("location" => "global")), "%blogger-api" => l(t("Blogger API"), "www.blogger.com/developers/api/1_docs/", array("location" => "global")), "%client-radio" => l(t("Radio"), "radio.userland.com", array("location" => "global")), "%client-blogbuddy" => l(t("BlogBuddy"), "blogbuddy.sourceforge.net", array("location" => "global")), "%client-w_bloggar" => l(t("w.bloggar"), "www.wbloggar.com", array("location" => "global")), "%client-textrouter" => l(t("TextRouter"), "projects.kittle.info/tr", array("location" => "global")) )); + $output .= strtr("

The %blogger-api uses the %xml-rpc protocol for communicating with the outside world. %xml-rpc, originally developed by Dave Winer of %userland-software, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses %xml-rpc for several other tasks (e.g. notifiying %weblogs-com of blog updates and making/accepting %dist-auth requests)

",array("%blogger-api" => l(t("Blogger API"), "www.blogger.com/developers/api/1_docs", array("location" => "global")), "%xml-rpc" => l(t("XML-RPC"), "www.xmlrpc.com", array("location" => "global")), "%userland-software" => l(t("UserLand Software"), "www.userland.com", array("location" => "global")), "%weblogs-com" => l(t("weblogs.com"), "www.weblogs.com", array("location" => "global")), "%dist-auth" => l(t("distributed authentication"), "user/help") )) ; + $output .= "

Blogger API implementation

"; + $output .= strtr("

A word of warning on the Blogger API: it is unofficial. It exists because Blogger is one of the most popular and the first service to implement an XML-RPC interface. It may not be the best implementation of a distributed weblog API. For a promising candidate, see the %echo-proj.

", array("%echo-proj" => l(t("Echo project"), "www.intertwingly.net/wiki/pie/RoadMap", array("location" => "global")) )); + $output .= "

Drupal's support for the Blogger API is quite complete. Each method with an asterisk below has been implemented in Drupal.

"; + $output .= strtr("

%bloggerapi-newpost
%bloggerapi-editpost
%bloggerapi-getuserblogs
%bloggerapi-getuserinfo
%bloggerapi-gettemplate
%bloggerapi-settemplate

", array("%bloggerapi-newpost" => l(t("blogger.newPost()*"), "%blogger-api/xmlrpc_newPost.html", array("location" => "global")), "%bloggerapi-editpost" => l(t("blogger.editPost()*"), "%blogger-api/xmlrpc_editPost.html", array("location" => "global")), "%bloggerapi-getuserblogs" => l(t("blogger.getUsersBlogs()*"), "%blogger-api/xmlrpc_getUserBlogs.html", array("location" => "global")), "%bloggerapi-getuserinfo" => l(t("blogger.getUserInfo()*"), "%blogger-api/xmlrpc_getUserInfo.html", array("location" => "global")), "%bloggerapi-gettemplate" => l(t("blogger.getTemplate()*"), "%blogger-api/xmlrpc_getTemplate.html", array("location" => "global")), "%bloggerapi-settemplate" => l(t("blogger.setTemplate()*"), "%blogger-api/xmlrpc_setTemplate.html", array("location" => "global")) )); + $output = strtr($output, array("%blogger-api" => "www.blogger.com/developers/api/1_docs")); + $output .= "

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 post:

"; + $output .= strtr("

%mess-296
%mess-225
%mess-147

", array("%mess-296" => l(t("blogger.getPost()*"), "%blogger-dev/296", array("location" => "global")), "%mess-225" => l(t("blogger.getRecentPosts()*"), "%blogger-dev/225", array("location" => "global")), "%mess-147" => l(t("blogger.deletePost()*"), "%blogger-dev/147", array("location" => "global")) )); + $output = strtr($output, array("%blogger-dev" => "groups.yahoo.com/group/bloggerDev/message")); + $output .= "

Installation and usage

"; + $output .= strtr("

To install the Blogger API module, enable the module on the %mod-config. Also make sure you have your permissions set correctly for accessing the Blogger API, the relevant settings can be found under the %user-management section in the administration pages. Check the checkbox behind the line \"access Blogger API\" for the roles that are allowed to use the Blogger API.

", array("%mod-config" => l(t("modules configuration page"), "admin/systems/modules"), "%user-management" => l(t("user management"), "admin/user/permission") )); + $output .= "

Once the API is enabled you can download one of the above mentioned Blogger API clients and get blogging.

"; + $output .= "

Setup of the client

"; + $output .= strtr("

The Drupal page you need to call in order to connect using the Blogger API is http://server/xmlrpc.php where server is the URL of the site you want to post to. As an example when posting to drupal.org, the account settings for %client-wbloggar would be: host: www.drupal.org (default = plant.blogger.com) and page: xmlrpc.php (default = /api/RPC2).

", array("%client-wbloggar" => l(t("w.bloggar"), "www.wbloggar.com", array("location" => "global")) )); + $output .= "

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.

"; + $output .= "

Notes and limitations

"; + $output .= ""; + break; + case 'admin/system/modules': + $output .= "Enables users to post using tools or applications that support the Blogger API."; + break; + } return t($output); } diff --git a/modules/book.module b/modules/book.module index cec2b08c82c..fa1dbb3f2c9 100644 --- a/modules/book.module +++ b/modules/book.module @@ -2,8 +2,11 @@ // $Id$ function book_system($field){ - $system["description"] = t("Allows users to collaboratively author a book."); - return $system[$field]; + $output = ""; + + if ($field == "description") { $output = book_help("admin/system/modules"); }; + return $output; + } function book_node($field) { @@ -79,11 +82,8 @@ 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"] = "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); + menu("admin/node/book", "collaborative books", "book_admin", book_help("admin/node/book"), 4); + menu("admin/node/book/orphan", "orphan pages", "book_admin", book_help("admin/node/book/orphan"), 8); menu("admin/node/book/help", "help", "book_help", NULL, 9); $result = db_query("SELECT n.nid, n.title FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title"); @@ -770,18 +770,36 @@ function book_admin() { } } -function book_help() { - $output .= "

The collaborative book organises content into a nested hierarchical structure. It is particularly good for manuals,FAQs and the like, allowing you to have chapters, sections, etc.

"; - $output .= "

A book is simply a collection of nodes that have been linked together. These nodes are usually of type book page, but you can insert nodes of any type into a book outline. Every node in the book has a parent node which \"contains\" it. This is how book.module establishes its hierarchy. At any given level in the hierarchy, a book can contain many nodes. All these sibling nodes are sorted according to the weight that you give them.

"; - $output .= "

A book page is a special node type that allows you 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 log message field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that be desirable.

"; - $output .= "

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 <root>. 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 edit book outline 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 create book page link.

"; - $output .= "

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, it may leave behind child nodes. These nodes are now orphans. 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.

"; - $output .= "

Maintaining a FAQ using a collaborative book

"; - $output .= "

Collaborative books let you easily set up a Frequently Asked Questions section on your web site. The main benefit is that you don't have to write all the questions/answers by yourself - let the community do it for you!

"; - $output .= "

In order to set up the FAQ, you have to create a new book which will hold all your content. To do so, click on create book page 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 <root> as the parent of this page. Leave the log message and type 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.

"; - $output .= "

Whenever you come across a post which you want to include in your FAQ, click on the administer link. Then click on the edit book outline button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a parent. Books are quite flexible. They can have sections like Flying to Estonia, Eating in Estonia and so on. As you get more experienced with the collaborative book, you can reorganize posts in your book so that it stays organized.

"; - $output .= "

Notes:

"; - return t($output); +function book_help($section = "admin/node/book/help") { + $output = ""; + switch ($section) { + case 'admin/node/book/help': + case 'admin/book/help': + case 'admin/help': + $output .= "

The collaborative book organises content into a nested hierarchical structure. It is particularly good for manuals, Frequently Asked Questions (FAQs) and the like, allowing you to have chapters, sections, etc.

"; + $output .= "

A book is simply a collection of nodes that have been linked together. These nodes are usually of type book page, but you can insert nodes of any type into a book outline. Every node in the book has a parent node which \"contains\" it. This is how book.module establishes its hierarchy. At any given level in the hierarchy, a book can contain many nodes. All these sibling nodes are sorted according to the weight that you give them.

"; + $output .= "

A book page is a special node type that allows you 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 log message field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that be desirable.

"; + $output .= strtr("

Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use %permissions 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 <root>. 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 edit book outline 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 %create link.

", array("%permissions" => l(t("permissions"), "admin/user/permission"), "%create" => l(t("create book page"), "node/add/book") )); + $output .= strtr("

Administrators may review the hierarchy of their books by clicking on the %collaborative-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, it may leave behind child nodes. These nodes are now orphans. Administrators should periodically %orphans-book and reaffiliate those pages as desired. Finally, administrators may also %export-book to a single, flat HTML page which is suitable for printing.

", array( "%collaborative-book" => l(t("collaborative book"), "admin/node/book"), "%orphans-book" => l(t("review their books for orphans"), "admin/node/book/orphan"), "%export-book" => l(t("export their books"), "book/print") )); + $output .= "

Maintaining a FAQ using a collaborative book

"; + $output .= "

Collaborative books let you easily set up a Frequently Asked Questions (FAQ) section on your web site. The main benefit is that you don't have to write all the questions/answers by yourself - let the community do it for you!

"; + $output .= strtr("

In order to set up the FAQ, you have to create a new book which will hold all your content. To do so, click on the %create link. 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 <root> as the parent of this page. Leave the log message and type 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.

", array("%create" => l(t("create book page"), "node/add/book") )); + $output .= "

Whenever you come across a post which you want to include in your FAQ, click on the administer link. Then click on the edit book outline button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a parent. Books are quite flexible. They can have sections like Flying to Estonia, Eating in Estonia and so on. As you get more experienced with the collaborative book, you can reorganize posts in your book so that it stays organized.

"; + $output .= strtr("

Notes:

", array("%create" => l(t("create book page"), "node/add/book"), "%permission" => l(t("permissions"), "admin/user/permission") )); + break; + case 'admin/system/modules': + $output = "Allows users to collaboratively author a book."; + break; + case 'admin/node/book': + $output = "The collaborative book offers a mean to organize content, authored by many users, in an online manual, outline or FAQ."; + break; + case 'admin/node/book/orphan': + $output = "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."; + break; + + } + + return t($output); } ?> diff --git a/modules/book/book.module b/modules/book/book.module index cec2b08c82c..fa1dbb3f2c9 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -2,8 +2,11 @@ // $Id$ function book_system($field){ - $system["description"] = t("Allows users to collaboratively author a book."); - return $system[$field]; + $output = ""; + + if ($field == "description") { $output = book_help("admin/system/modules"); }; + return $output; + } function book_node($field) { @@ -79,11 +82,8 @@ 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"] = "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); + menu("admin/node/book", "collaborative books", "book_admin", book_help("admin/node/book"), 4); + menu("admin/node/book/orphan", "orphan pages", "book_admin", book_help("admin/node/book/orphan"), 8); menu("admin/node/book/help", "help", "book_help", NULL, 9); $result = db_query("SELECT n.nid, n.title FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title"); @@ -770,18 +770,36 @@ function book_admin() { } } -function book_help() { - $output .= "

The collaborative book organises content into a nested hierarchical structure. It is particularly good for manuals,FAQs and the like, allowing you to have chapters, sections, etc.

"; - $output .= "

A book is simply a collection of nodes that have been linked together. These nodes are usually of type book page, but you can insert nodes of any type into a book outline. Every node in the book has a parent node which \"contains\" it. This is how book.module establishes its hierarchy. At any given level in the hierarchy, a book can contain many nodes. All these sibling nodes are sorted according to the weight that you give them.

"; - $output .= "

A book page is a special node type that allows you 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 log message field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that be desirable.

"; - $output .= "

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 <root>. 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 edit book outline 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 create book page link.

"; - $output .= "

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, it may leave behind child nodes. These nodes are now orphans. 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.

"; - $output .= "

Maintaining a FAQ using a collaborative book

"; - $output .= "

Collaborative books let you easily set up a Frequently Asked Questions section on your web site. The main benefit is that you don't have to write all the questions/answers by yourself - let the community do it for you!

"; - $output .= "

In order to set up the FAQ, you have to create a new book which will hold all your content. To do so, click on create book page 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 <root> as the parent of this page. Leave the log message and type 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.

"; - $output .= "

Whenever you come across a post which you want to include in your FAQ, click on the administer link. Then click on the edit book outline button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a parent. Books are quite flexible. They can have sections like Flying to Estonia, Eating in Estonia and so on. As you get more experienced with the collaborative book, you can reorganize posts in your book so that it stays organized.

"; - $output .= "

Notes:

"; - return t($output); +function book_help($section = "admin/node/book/help") { + $output = ""; + switch ($section) { + case 'admin/node/book/help': + case 'admin/book/help': + case 'admin/help': + $output .= "

The collaborative book organises content into a nested hierarchical structure. It is particularly good for manuals, Frequently Asked Questions (FAQs) and the like, allowing you to have chapters, sections, etc.

"; + $output .= "

A book is simply a collection of nodes that have been linked together. These nodes are usually of type book page, but you can insert nodes of any type into a book outline. Every node in the book has a parent node which \"contains\" it. This is how book.module establishes its hierarchy. At any given level in the hierarchy, a book can contain many nodes. All these sibling nodes are sorted according to the weight that you give them.

"; + $output .= "

A book page is a special node type that allows you 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 log message field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that be desirable.

"; + $output .= strtr("

Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use %permissions 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 <root>. 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 edit book outline 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 %create link.

", array("%permissions" => l(t("permissions"), "admin/user/permission"), "%create" => l(t("create book page"), "node/add/book") )); + $output .= strtr("

Administrators may review the hierarchy of their books by clicking on the %collaborative-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, it may leave behind child nodes. These nodes are now orphans. Administrators should periodically %orphans-book and reaffiliate those pages as desired. Finally, administrators may also %export-book to a single, flat HTML page which is suitable for printing.

", array( "%collaborative-book" => l(t("collaborative book"), "admin/node/book"), "%orphans-book" => l(t("review their books for orphans"), "admin/node/book/orphan"), "%export-book" => l(t("export their books"), "book/print") )); + $output .= "

Maintaining a FAQ using a collaborative book

"; + $output .= "

Collaborative books let you easily set up a Frequently Asked Questions (FAQ) section on your web site. The main benefit is that you don't have to write all the questions/answers by yourself - let the community do it for you!

"; + $output .= strtr("

In order to set up the FAQ, you have to create a new book which will hold all your content. To do so, click on the %create link. 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 <root> as the parent of this page. Leave the log message and type 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.

", array("%create" => l(t("create book page"), "node/add/book") )); + $output .= "

Whenever you come across a post which you want to include in your FAQ, click on the administer link. Then click on the edit book outline button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a parent. Books are quite flexible. They can have sections like Flying to Estonia, Eating in Estonia and so on. As you get more experienced with the collaborative book, you can reorganize posts in your book so that it stays organized.

"; + $output .= strtr("

Notes:

", array("%create" => l(t("create book page"), "node/add/book"), "%permission" => l(t("permissions"), "admin/user/permission") )); + break; + case 'admin/system/modules': + $output = "Allows users to collaboratively author a book."; + break; + case 'admin/node/book': + $output = "The collaborative book offers a mean to organize content, authored by many users, in an online manual, outline or FAQ."; + break; + case 'admin/node/book/orphan': + $output = "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."; + break; + + } + + return t($output); } ?> diff --git a/modules/cloud.module b/modules/cloud.module index 9215e2e9b98..6cd0b8290da 100644 --- a/modules/cloud.module +++ b/modules/cloud.module @@ -1,25 +1,42 @@ ". 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.") ."

"; - } - else { - $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 .= ""; +function cloud_help($section = "admin/syndication/cloud/help") { + $output = ""; + + switch ($section) { + case 'admin/help': + case 'admin/cloud/help': + case 'admin/syndication/cloud/help': + $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 .= ""; + break; + case 'cloud': + $output .= "

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 the cloud.

"; + break; + case 'admin/system/modules': + $output = "Tracks other sites and displays last date changed."; + break; + case 'admin/syndication/cloud': + $output = strtr("The cloud monitor tracks or crawls other interesting web sites and displays their last modification dates. Visitors to this site learn about other relevant sites and can easily see if there is new content. To get this working you must setup cron support. To get the site cloud block to display you must turn on the Site bloud block in %block. To go to a monitored site, click on the site name, to immediately load and/or update the record for a site, click on \"update site\", to delete a site go to \"edit site\". ", array("%block" => l(t("block management"), "admin/block") )); + break; + case 'admin/syndication/cloud/add': + $output = "Add a site to the site cloud. Don't forget the \"http://\" for your URLs."; + break; } - return $output; + return t($output); } function cloud_system($field){ - $system["description"] = t("Tracks other sites and displays last date changed."); - return $system[$field]; + $output = ""; + + if ($field == "description") {$output = cloud_help("admin/system/modules");}; + return $output; } function cloud_cron() { @@ -42,12 +59,9 @@ function cloud_link($type) { } if ($type == "admin" && user_access("administer site cloud")) { - $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 must setup cron support. To get the site cloud block to display you must turn on the Site cloud block. To go to a monitored site, click on the site name, to load and/or update the record 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 to the site cloud. Don't forget the \"http://\" for your URLs."); - menu("admin/syndication", "content syndication", NULL, NULL, 5); - menu("admin/syndication/cloud", "site cloud", "cloud_admin", $help["general"]); - menu("admin/syndication/cloud/add", "add new site", "cloud_admin", $help["add"]); + menu("admin/syndication/cloud", "site cloud", "cloud_admin", cloud_help("admin/syndication/cloud")); + menu("admin/syndication/cloud/add", "add new site", "cloud_admin", cloud_help("admin/syndication/cloud/add")); menu("admin/syndication/cloud/help", "help", "cloud_help", NULL, 9); } @@ -186,7 +200,7 @@ function cloud_page() { if (user_access("access site cloud")) { theme("header"); - theme("box", t("Site cloud"), cloud_help("user") . cloud_list(100)); + theme("box", t("Site cloud"), cloud_help("cloud") . cloud_list(100)); theme("footer"); } } diff --git a/modules/comment.module b/modules/comment.module index 7aba642296e..66667bf6899 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -4,71 +4,76 @@ $GLOBALS["cmodes"] = array(1 => t("Flat list - collapsed"), 2 => t("Flat list - expanded"), 3 => t("Threaded list - collapsed"), 4 => t("Threaded list - expanded")); $GLOBALS["corder"] = array(1 => t("Date - newest first"), 2 => t("Date - oldest first")); -function comment_help() { - $output .= t("

When enabled, the Drupal comment module creates a discussion board for each Drupal node. Users can post comments to discuss a forum topic, weblog post, collaborative book page, etc.

+function comment_help($section = "admin/comment/help") { + $output = ""; -

User control of comment display

-

Attached to each comment board is a control panel for customizing the way that comments are displayed. Users can control the chronological ordering of posts (newest or oldest first) and the number of posts to display on each page. Additional settings include:

- -

When users choose save settings, the comments are then redisplayed with the user's choices. Know that administrators can set the default settings for the control panel, along with other comment configuration defaults, in site configuration » modules » comment.

-

NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).

+ switch ($section) { + case 'admin/help': + case 'admin/comment/help': + $output .= "

When enabled, the Drupal comment module creates a discussion board for each Drupal node. Users can post comments to discuss a forum topic, weblog post, collaborative book page, etc.

"; + $output .= "

User control of comment display

"; + $output .= "

Attached to each comment board is a control panel for customizing the way that comments are displayed. Users can control the chronological ordering of posts (newest or oldest first) and the number of posts to display on each page. Additional settings include:

"; + $output .= ""; + $output .= strtr("

When a user chooses save settings, the comments are then redisplayed using the user's new choices. Administrators can set the default settings for the comment control panel, along with other comment defaults, in %comment-config.

",array("%comment-config" => l(t("site configuration » modules » comment"), "admin/system/modules/comment") )); + $output .= "

NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).

"; -

Additional comment configurations

-

Comments behave like other user submissions in Drupal. Filters, smileys and HTML that work in nodes will also work with content. To prevent a single user from spamming the web site with too many comments, administrators can set a comment throttle in site configuration under Submission settings.

-

Administrators can control access to various comment module functions through user management » user permissions. Know that in a new Drupal installation, all comment permissions are disabled by default. The choice of which permissions to grant to which roles (groups of users) is left up to the site administrator.

-

The following permissions can be enabled for anonymous users, authenticated users, or any other roles that the administrator chooses to define:

- + $output .= "

Additional comment configurations

"; + $output .= strtr("

Comments behave like other user submissions in Drupal. Filters, smileys and HTML that work in nodes will also work with content. To prevent a single user from spamming the web site with too many comments, administrators can set a comment throttle in %site-config under Submission settings.

", array("%site-config" => l(t("site configuration"), "admin/system") )); + $output .= strtr("

Administrators can control access to various comment module functions through %user-permissions. Know that in a new Drupal installation, all comment permissions are disabled by default. The choice of which permissions to grant to which roles (groups of users) is left up to the site administrator.

", array("%user-permissions" => l(t("user management » user permissions"), "admin/user/permission") )); + $output .= "

The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:

"; + $output .= ""; -

Notification of new comments

-

Drupal provides specific features to inform site members when new comments have been posted:

- + $output .= "

Notification of new comments

"; + $output .= "

Drupal provides specific features to inform site members when new comments have been posted:

"; + $output .= ""; -

Comment moderation

-

On sites with active commenting from users, the administrator can turn over comment moderation to the community.

-

With comment moderation, each comment is automatically assigned an initial rating. As users read comments, they can apply a vote which affects the comment rating. At the same time, users have an additional option in the control panel which allows them to set a threshold for comment display. Those comments with ratings lower than the set threshold will not appear.

-

To enable moderation, the administrator must grant moderate comments permissions. Then, a number of options in comment management » comment moderation must be configured.

+ $output .= "

Comment moderation

"; + $output .= "

On sites with active commenting from users, the administrator can turn over comment moderation to the community.

"; + $output .= "

With comment moderation, each comment is automatically assigned an initial rating. As users read comments, they can apply a vote which affects the comment rating. At the same time, users have an additional option in the control panel which allows them to set a threshold for the comments they wish to view. Those comments with ratings lower than the set threshold will not be shown.

"; + $output .= strtr("

To enable moderation, the administrator must grant %permission permissions. Then, a number of options in %comment-moderation must be configured.

", array("%permission" => l(t("moderate comments"), "admin/user/permissions"), "%comment-moderation" => l(t("comment management » comment moderation"), "admin/comment/moderation") )); -

Moderation votes

-

The first step is to create moderation labels which allow users to rate a comment. Go to comment management » comment moderation » votes. In the vote field, enter the textual labels which users will see when casting their votes. Some examples might be

- -

So that users know how there votes affect the comment, these examples include the vote value as part of the label, although that is optional.

-

Using the weight option, you can control the order in which the votes appear to users. Setting the weight heavier (positive numbers) will make the vote label appear at the bottom of the list. Lighter (a negative number) will push it to the top. To encourage positive voting, a useful order might be higher values, positive votes, at the top, with negative votes at the bottom.

+ $output .= "

Moderation votes

"; + $output .= strtr("

The first step is to create moderation labels which allow users to rate a comment. Go to %comment-votes. In the vote field, enter the textual labels which users will see when casting their votes. Some examples are

", array("%comment-votes" => l(t("comment management » comment moderation » votes"), "admin/comment/moderation/votes") )); + $output .= ""; + $output .= "

So that users know how their votes affect the comment, these examples include the vote value as part of the label, although that is optional.

"; + $output .= "

Using the weight option, you can control the order in which the votes appear to users. Setting the weight heavier (positive numbers) will make the vote label appear at the bottom of the list. Lighter (a negative number) will push it to the top. To encourage positive voting, a useful order might be higher values, positive votes, at the top, with negative votes at the bottom.

"; -

Moderators/vote values matrix

+ $output .= "

Moderators/vote values matrix

"; -

Next go to comment management » comment moderation » matrix. Enter vote values for each of the labels in the matrix with each permission role. The values entered here will be used to create the rating for each comment.

-

NOTE: Comment ratings are calculated by averaging user votes with the initial rating.

-

Creating comment thresholds

+ $output .= strtr("

Next go to %comment-matrix. Enter the values for the vote labels for each permission role in the vote matrix. The values entered here will be used to create the rating for each comment.

", array("%comment-matrix" => l(t("comment management » comment moderation » matrix"), "admin/comment/moderation/,atrix") )); + $output .= "

NOTE: Comment ratings are calculated by averaging user votes with the initial rating.

"; + $output .= "

Creating comment thresholds

In comment management » comment moderation » thresholds, you'll have to create some comment thresholds to make the comment rating system useful. When comment moderation is enabled and the thresholds are created, users will find another comment control panel option for selecting thresholds. They'll use the thresholds you enter here to filter out comments with low ratings. Consequently, you'll probably want to create more than one threshold to give users some flexibility in filtering comments.

When creating the thresholds, note that the Minimum score is asking you for the lowest rating that a comment can have in order to be displayed.

To see a common example of how thresholds work, you might visit Slashdot and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.

Initial comment scores

-

Finally, you may want to enter some initial comment scores. In comment management » initial comment scores you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of 0 as the default.

"); - - return $output; +

Finally, you may want to enter some initial comment scores. In comment management » initial comment scores you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of 0 as the default.

"; + break; + } + return t($output); } function comment_system($field) { @@ -1226,6 +1231,11 @@ function comment_moderation_form($comment) { } } + if (user_access("administer comments")) { + $options .= " \n"; + $options .= " \n"; + } + $output .= "\n"; } @@ -1325,7 +1335,9 @@ function comment_visible($comment, $threshold = 0) { } function comment_moderate() { - global $moderation, $user; + global $user; + + $moderation = $_POST["moderation"]; if ($moderation) { $result = db_query("SELECT mid, value FROM {moderation_roles} WHERE rid = %d", $user->rid); @@ -1338,40 +1350,28 @@ function comment_moderate() { if (user_access("administer comments") || comment_user_can_moderate($node)) { foreach ($moderation as $cid => $vote) { if ($vote) { - if (($vote == 'offline') && (user_access("administer comments"))) { - db_query("UPDATE {comments} SET status = 1 WHERE cid = %d", $cid); - watchdog("special", "comment: unpublished comment #". $cid); + $comment = db_fetch_object(db_query("SELECT * FROM {comments} WHERE cid = %d", $cid)); + $users = unserialize($comment->users); + if ($user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) { + $users[$user->uid] = $vote; + $tot_score = 0; + foreach ($users as $uid => $vote) { + if ($uid) { + $tot_score = $tot_score + $votes[$vote]; + } + else { + // vote 0 is the start value + $tot_score = $tot_score + $vote; + } + } + $new_score = round($tot_score / count($users)); + db_query("UPDATE {comments} SET score = '$new_score', users = '%s' WHERE cid = %d", serialize($users), $cid); /* ** Fire a hook */ - module_invoke_all("comment", "unpublish", $cid); - } - else { - $comment = db_fetch_object(db_query("SELECT * FROM {comments} WHERE cid = %d", $cid)); - $users = unserialize($comment->users); - if ($user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) { - $users[$user->uid] = $vote; - $tot_score = 0; - foreach ($users as $uid => $vote) { - if ($uid) { - $tot_score = $tot_score + $votes[$vote]; - } - else { - // vote 0 is the start value - $tot_score = $tot_score + $vote; - } - } - $new_score = round($tot_score / count($users)); - db_query("UPDATE {comments} SET score = '$new_score', users = '%s' WHERE cid = %d", serialize($users), $cid); - - /* - ** Fire a hook - */ - - module_invoke_all("comment", "moderate", $cid, $vote); - } + module_invoke_all("comment", "moderate", $cid, $vote); } } } diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 7aba642296e..66667bf6899 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -4,71 +4,76 @@ $GLOBALS["cmodes"] = array(1 => t("Flat list - collapsed"), 2 => t("Flat list - expanded"), 3 => t("Threaded list - collapsed"), 4 => t("Threaded list - expanded")); $GLOBALS["corder"] = array(1 => t("Date - newest first"), 2 => t("Date - oldest first")); -function comment_help() { - $output .= t("

When enabled, the Drupal comment module creates a discussion board for each Drupal node. Users can post comments to discuss a forum topic, weblog post, collaborative book page, etc.

+function comment_help($section = "admin/comment/help") { + $output = ""; -

User control of comment display

-

Attached to each comment board is a control panel for customizing the way that comments are displayed. Users can control the chronological ordering of posts (newest or oldest first) and the number of posts to display on each page. Additional settings include:

- -

When users choose save settings, the comments are then redisplayed with the user's choices. Know that administrators can set the default settings for the control panel, along with other comment configuration defaults, in site configuration » modules » comment.

-

NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).

+ switch ($section) { + case 'admin/help': + case 'admin/comment/help': + $output .= "

When enabled, the Drupal comment module creates a discussion board for each Drupal node. Users can post comments to discuss a forum topic, weblog post, collaborative book page, etc.

"; + $output .= "

User control of comment display

"; + $output .= "

Attached to each comment board is a control panel for customizing the way that comments are displayed. Users can control the chronological ordering of posts (newest or oldest first) and the number of posts to display on each page. Additional settings include:

"; + $output .= ""; + $output .= strtr("

When a user chooses save settings, the comments are then redisplayed using the user's new choices. Administrators can set the default settings for the comment control panel, along with other comment defaults, in %comment-config.

",array("%comment-config" => l(t("site configuration » modules » comment"), "admin/system/modules/comment") )); + $output .= "

NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).

"; -

Additional comment configurations

-

Comments behave like other user submissions in Drupal. Filters, smileys and HTML that work in nodes will also work with content. To prevent a single user from spamming the web site with too many comments, administrators can set a comment throttle in site configuration under Submission settings.

-

Administrators can control access to various comment module functions through user management » user permissions. Know that in a new Drupal installation, all comment permissions are disabled by default. The choice of which permissions to grant to which roles (groups of users) is left up to the site administrator.

-

The following permissions can be enabled for anonymous users, authenticated users, or any other roles that the administrator chooses to define:

- + $output .= "

Additional comment configurations

"; + $output .= strtr("

Comments behave like other user submissions in Drupal. Filters, smileys and HTML that work in nodes will also work with content. To prevent a single user from spamming the web site with too many comments, administrators can set a comment throttle in %site-config under Submission settings.

", array("%site-config" => l(t("site configuration"), "admin/system") )); + $output .= strtr("

Administrators can control access to various comment module functions through %user-permissions. Know that in a new Drupal installation, all comment permissions are disabled by default. The choice of which permissions to grant to which roles (groups of users) is left up to the site administrator.

", array("%user-permissions" => l(t("user management » user permissions"), "admin/user/permission") )); + $output .= "

The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:

"; + $output .= ""; -

Notification of new comments

-

Drupal provides specific features to inform site members when new comments have been posted:

- + $output .= "

Notification of new comments

"; + $output .= "

Drupal provides specific features to inform site members when new comments have been posted:

"; + $output .= ""; -

Comment moderation

-

On sites with active commenting from users, the administrator can turn over comment moderation to the community.

-

With comment moderation, each comment is automatically assigned an initial rating. As users read comments, they can apply a vote which affects the comment rating. At the same time, users have an additional option in the control panel which allows them to set a threshold for comment display. Those comments with ratings lower than the set threshold will not appear.

-

To enable moderation, the administrator must grant moderate comments permissions. Then, a number of options in comment management » comment moderation must be configured.

+ $output .= "

Comment moderation

"; + $output .= "

On sites with active commenting from users, the administrator can turn over comment moderation to the community.

"; + $output .= "

With comment moderation, each comment is automatically assigned an initial rating. As users read comments, they can apply a vote which affects the comment rating. At the same time, users have an additional option in the control panel which allows them to set a threshold for the comments they wish to view. Those comments with ratings lower than the set threshold will not be shown.

"; + $output .= strtr("

To enable moderation, the administrator must grant %permission permissions. Then, a number of options in %comment-moderation must be configured.

", array("%permission" => l(t("moderate comments"), "admin/user/permissions"), "%comment-moderation" => l(t("comment management » comment moderation"), "admin/comment/moderation") )); -

Moderation votes

-

The first step is to create moderation labels which allow users to rate a comment. Go to comment management » comment moderation » votes. In the vote field, enter the textual labels which users will see when casting their votes. Some examples might be

- -

So that users know how there votes affect the comment, these examples include the vote value as part of the label, although that is optional.

-

Using the weight option, you can control the order in which the votes appear to users. Setting the weight heavier (positive numbers) will make the vote label appear at the bottom of the list. Lighter (a negative number) will push it to the top. To encourage positive voting, a useful order might be higher values, positive votes, at the top, with negative votes at the bottom.

+ $output .= "

Moderation votes

"; + $output .= strtr("

The first step is to create moderation labels which allow users to rate a comment. Go to %comment-votes. In the vote field, enter the textual labels which users will see when casting their votes. Some examples are

", array("%comment-votes" => l(t("comment management » comment moderation » votes"), "admin/comment/moderation/votes") )); + $output .= ""; + $output .= "

So that users know how their votes affect the comment, these examples include the vote value as part of the label, although that is optional.

"; + $output .= "

Using the weight option, you can control the order in which the votes appear to users. Setting the weight heavier (positive numbers) will make the vote label appear at the bottom of the list. Lighter (a negative number) will push it to the top. To encourage positive voting, a useful order might be higher values, positive votes, at the top, with negative votes at the bottom.

"; -

Moderators/vote values matrix

+ $output .= "

Moderators/vote values matrix

"; -

Next go to comment management » comment moderation » matrix. Enter vote values for each of the labels in the matrix with each permission role. The values entered here will be used to create the rating for each comment.

-

NOTE: Comment ratings are calculated by averaging user votes with the initial rating.

-

Creating comment thresholds

+ $output .= strtr("

Next go to %comment-matrix. Enter the values for the vote labels for each permission role in the vote matrix. The values entered here will be used to create the rating for each comment.

", array("%comment-matrix" => l(t("comment management » comment moderation » matrix"), "admin/comment/moderation/,atrix") )); + $output .= "

NOTE: Comment ratings are calculated by averaging user votes with the initial rating.

"; + $output .= "

Creating comment thresholds

In comment management » comment moderation » thresholds, you'll have to create some comment thresholds to make the comment rating system useful. When comment moderation is enabled and the thresholds are created, users will find another comment control panel option for selecting thresholds. They'll use the thresholds you enter here to filter out comments with low ratings. Consequently, you'll probably want to create more than one threshold to give users some flexibility in filtering comments.

When creating the thresholds, note that the Minimum score is asking you for the lowest rating that a comment can have in order to be displayed.

To see a common example of how thresholds work, you might visit Slashdot and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.

Initial comment scores

-

Finally, you may want to enter some initial comment scores. In comment management » initial comment scores you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of 0 as the default.

"); - - return $output; +

Finally, you may want to enter some initial comment scores. In comment management » initial comment scores you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of 0 as the default.

"; + break; + } + return t($output); } function comment_system($field) { @@ -1226,6 +1231,11 @@ function comment_moderation_form($comment) { } } + if (user_access("administer comments")) { + $options .= " \n"; + $options .= " \n"; + } + $output .= "\n"; } @@ -1325,7 +1335,9 @@ function comment_visible($comment, $threshold = 0) { } function comment_moderate() { - global $moderation, $user; + global $user; + + $moderation = $_POST["moderation"]; if ($moderation) { $result = db_query("SELECT mid, value FROM {moderation_roles} WHERE rid = %d", $user->rid); @@ -1338,40 +1350,28 @@ function comment_moderate() { if (user_access("administer comments") || comment_user_can_moderate($node)) { foreach ($moderation as $cid => $vote) { if ($vote) { - if (($vote == 'offline') && (user_access("administer comments"))) { - db_query("UPDATE {comments} SET status = 1 WHERE cid = %d", $cid); - watchdog("special", "comment: unpublished comment #". $cid); + $comment = db_fetch_object(db_query("SELECT * FROM {comments} WHERE cid = %d", $cid)); + $users = unserialize($comment->users); + if ($user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) { + $users[$user->uid] = $vote; + $tot_score = 0; + foreach ($users as $uid => $vote) { + if ($uid) { + $tot_score = $tot_score + $votes[$vote]; + } + else { + // vote 0 is the start value + $tot_score = $tot_score + $vote; + } + } + $new_score = round($tot_score / count($users)); + db_query("UPDATE {comments} SET score = '$new_score', users = '%s' WHERE cid = %d", serialize($users), $cid); /* ** Fire a hook */ - module_invoke_all("comment", "unpublish", $cid); - } - else { - $comment = db_fetch_object(db_query("SELECT * FROM {comments} WHERE cid = %d", $cid)); - $users = unserialize($comment->users); - if ($user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) { - $users[$user->uid] = $vote; - $tot_score = 0; - foreach ($users as $uid => $vote) { - if ($uid) { - $tot_score = $tot_score + $votes[$vote]; - } - else { - // vote 0 is the start value - $tot_score = $tot_score + $vote; - } - } - $new_score = round($tot_score / count($users)); - db_query("UPDATE {comments} SET score = '$new_score', users = '%s' WHERE cid = %d", serialize($users), $cid); - - /* - ** Fire a hook - */ - - module_invoke_all("comment", "moderate", $cid, $vote); - } + module_invoke_all("comment", "moderate", $cid, $vote); } } } diff --git a/modules/help.module b/modules/help.module index d07e77ff979..7a0dace8e2b 100644 --- a/modules/help.module +++ b/modules/help.module @@ -25,32 +25,32 @@ function help_glossary() { $output .= "
Node
The basic data unit in Drupal. Everything is a node or an extention of a node.
"; $output .= "
Public
See published.
"; $output .= "
Published
A node that is viewable by everyone. (See unpublished.)
"; - $output .= "
Role
You can classify users into roles, for the purpose of setting lots of users' permissions at once.
"; - $output .= "
Taxonomy
A division of a collection of things into ordered, classified groups. (See ". l("taxonomy help","admin/taxonomy/help") .")
"; + $output .= "
Role
A classification users are placed into for the purpose of setting users' permissions.
"; + $output .= strtr("
Taxonomy
A division of a collection of things into ordered, classified groups. (See %taxonomy.)
", array("%taxonomy" => l(t("taxonomy help"), "admin/taxonomy/help"))); $output .= "
Unpublished
A node that is only viewable by administrators and moderators.
"; $output .= "
User
A person who has an account at your Drupal site, and is logged in with that account.
"; - $output .= "
Visitor
A person who does not have an account at your Drupal site or a person who has an account at your Drupal bite but is not logged in with that account. Also termed \"anonymous user\".
"; + $output .= "
Visitor
A person who does not have an account at your Drupal site or a person who has an account at your Drupal site but is not logged in with that account. Also termed \"anonymous user\".
"; $output .= ""; - return t($output); + return t($output); } function help_admin() { + $output = ""; foreach (module_list() as $name) { if (module_hook($name, "help")) { - $links[] = l($name, "admin/help#$name"); + $temp = module_invoke($name, "help", "admin/".$name."/help"); + if (!empty($temp)) { + $links[] = l($name, "admin/help#$name"); + $output .= "

". ucfirst($name) ." module

"; + $output .= $temp; + } } } print "". implode(" · ", $links) ."
"; - - foreach (module_list() as $name) { - if (module_hook($name, "help")) { - print "

". ucfirst($name) ." module

"; - print module_invoke($name, "help"); - } - } + print $output; } ?> diff --git a/modules/help/help.module b/modules/help/help.module index d07e77ff979..7a0dace8e2b 100644 --- a/modules/help/help.module +++ b/modules/help/help.module @@ -25,32 +25,32 @@ function help_glossary() { $output .= "
Node
The basic data unit in Drupal. Everything is a node or an extention of a node.
"; $output .= "
Public
See published.
"; $output .= "
Published
A node that is viewable by everyone. (See unpublished.)
"; - $output .= "
Role
You can classify users into roles, for the purpose of setting lots of users' permissions at once.
"; - $output .= "
Taxonomy
A division of a collection of things into ordered, classified groups. (See ". l("taxonomy help","admin/taxonomy/help") .")
"; + $output .= "
Role
A classification users are placed into for the purpose of setting users' permissions.
"; + $output .= strtr("
Taxonomy
A division of a collection of things into ordered, classified groups. (See %taxonomy.)
", array("%taxonomy" => l(t("taxonomy help"), "admin/taxonomy/help"))); $output .= "
Unpublished
A node that is only viewable by administrators and moderators.
"; $output .= "
User
A person who has an account at your Drupal site, and is logged in with that account.
"; - $output .= "
Visitor
A person who does not have an account at your Drupal site or a person who has an account at your Drupal bite but is not logged in with that account. Also termed \"anonymous user\".
"; + $output .= "
Visitor
A person who does not have an account at your Drupal site or a person who has an account at your Drupal site but is not logged in with that account. Also termed \"anonymous user\".
"; $output .= ""; - return t($output); + return t($output); } function help_admin() { + $output = ""; foreach (module_list() as $name) { if (module_hook($name, "help")) { - $links[] = l($name, "admin/help#$name"); + $temp = module_invoke($name, "help", "admin/".$name."/help"); + if (!empty($temp)) { + $links[] = l($name, "admin/help#$name"); + $output .= "

". ucfirst($name) ." module

"; + $output .= $temp; + } } } print "". implode(" · ", $links) ."
"; - - foreach (module_list() as $name) { - if (module_hook($name, "help")) { - print "

". ucfirst($name) ." module

"; - print module_invoke($name, "help"); - } - } + print $output; } ?> diff --git a/modules/ping.module b/modules/ping.module index 2a2f515d36b..43e6dd1209f 100644 --- a/modules/ping.module +++ b/modules/ping.module @@ -9,7 +9,7 @@ function ping_help() { // for optional modules that ping other sites // $output .= module_invoke_all("ping_help"); $output .= "

The ping feature requires crontab.

"; - print $output; + return t($output); } function ping_system($field){ diff --git a/modules/ping/ping.module b/modules/ping/ping.module index 2a2f515d36b..43e6dd1209f 100644 --- a/modules/ping/ping.module +++ b/modules/ping/ping.module @@ -9,7 +9,7 @@ function ping_help() { // for optional modules that ping other sites // $output .= module_invoke_all("ping_help"); $output .= "

The ping feature requires crontab.

"; - print $output; + return t($output); } function ping_system($field){