- Help system improvements from Michael.

4.3.x
Dries Buytaert 2003-08-05 18:33:39 +00:00
parent 173dfb5950
commit 4131b785f7
17 changed files with 544 additions and 360 deletions

View File

@ -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);
}
}

View File

@ -1,10 +1,27 @@
<?php
// $Id$
function archive_help($section) {
$output = "";
switch ($section) {
case 'admin/system/modules':
$output = "Displays a calendar to navigate old content.";
break;
case 'admin/system/modules/archive':
$output = "Choose the starting \"day of the week\" for the displayed calendar block.";
break;
}
return t($output);
}
function archive_system($field){
$system["description"] = t("Displays a calendar to navigate old content.");
$system["admin_help"] = t("Choose the starting \"day of the week\" for the displayed calendar block.");
return $system[$field];
$output = "";
if ($field == "description") { $output = archive_help("admin/system/modules"); }
else if ($field == "admin_help") { $output = archive_help("admin/system/modules/archive"); };
return $output;
}
function archive_calendar($original = 0) {

View File

@ -1,10 +1,27 @@
<?php
// $Id$
function archive_help($section) {
$output = "";
switch ($section) {
case 'admin/system/modules':
$output = "Displays a calendar to navigate old content.";
break;
case 'admin/system/modules/archive':
$output = "Choose the starting \"day of the week\" for the displayed calendar block.";
break;
}
return t($output);
}
function archive_system($field){
$system["description"] = t("Displays a calendar to navigate old content.");
$system["admin_help"] = t("Choose the starting \"day of the week\" for the displayed calendar block.");
return $system[$field];
$output = "";
if ($field == "description") { $output = archive_help("admin/system/modules"); }
else if ($field == "admin_help") { $output = archive_help("admin/system/modules/archive"); };
return $output;
}
function archive_calendar($original = 0) {

View File

@ -1,18 +1,22 @@
<?php
// $Id$
function block_help() {
function block_help($section = "admin/block/help") {
$output = "";
switch ($section) {
case 'admin/block/help':
$output .= "<p>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.</p>";
$output .= "<p>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.</p><p>Whether a block is visible in the first place depends on three things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li></ul>";
$output .= "<p>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.</p><p>Whether a block is visible in the first place depends on three things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li></ul>";
$output .= "<p>The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a <b>weight</b> 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.</p>";
$output .= "<p>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!</p>";
$output .= "<p>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 <a href=\"http://php.net/pcre\">Perl-Compatible Regular Expressions (PCRE)</a>.</p>";
$output .= "<p>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!</p>";
$output .= strtr("<p>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</p>", array("%pcre" => l(t("Perl-Compatible Regular Expressions (PCRE)"), "php.net/pcre", array("location" => "global"))));
$output .= "<p>However, for basic tasks it is sufficient to look at the following examples:</p>";
$output .= "<p>If the block should only show up on blog pages, use &lt;/blog&gt;. To display on all node views use &lt;/node/view&gt;. The angular brackets are used as delimiters of the regular expression. To show up on either forum or book pages use &lt;(/forum|/book)&gt;. 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 &lt;/node/add/(story|blog|image)&gt;. Blocks which have their paths set to this expression will show up on story, block, or image composition pages.</p>";
$output .= "<h3>Custom Blocks</h3>";
$output .= "<p>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.</p>";
$output .= "<p>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.</p>";
$output .= "<h4>PHP in custom blocks</h4>";
$output .= "<p>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.</p>";
$output .= "<p>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.</p>";
$output .= "<p>Remember that the code within each PHP custom block must be valid PHP code - including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your cusom blocks separately using a simple test script on top of a test database before migrating to your production environment.</p>";
$output .= "<p>Notes:</p><ul><li>You can use global variables, such as configuration parameters, within the scope of a PHP box but remember that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.</li><li>register_globals is now set to <b>off</b> by default. If you need form information you need to get it from the \"superglobals\" \$_POST, \$_GET, etc.</li><li>You can use the <code>return</code> statement to return the actual content for your block as well.</li></ul>";
$output .= "<p>A basic example:</p>";
@ -30,13 +34,31 @@ function block_help() {
}";
$output .= "</pre></blockquote>";
$output .= "<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>";
return t($output);
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 <b>active</b> 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 <b>create php content</b> permission (see %permission) you <b>must</b> 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 <b>active</b> 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 <a href=\"%overview\">block management</a>. The title is used when displaying the block. The description is used in the \"block\" column on the <a href=\"%overview\">block management</a> page. If you are going to place PHP code in the block, and you have <b>create php content</b> permission (see <a href=\"%permission\">user management >> user permissions</a>) you <B>must</b> change the type to PHP to make your code active.", array("%overview" => url("admin/block"), "%permission" => url("admin/user/permission")));
$help["preview"] = t("This page 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);
}
}

View File

@ -1,18 +1,22 @@
<?php
// $Id$
function block_help() {
function block_help($section = "admin/block/help") {
$output = "";
switch ($section) {
case 'admin/block/help':
$output .= "<p>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.</p>";
$output .= "<p>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.</p><p>Whether a block is visible in the first place depends on three things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li></ul>";
$output .= "<p>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.</p><p>Whether a block is visible in the first place depends on three things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li></ul>";
$output .= "<p>The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a <b>weight</b> 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.</p>";
$output .= "<p>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!</p>";
$output .= "<p>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 <a href=\"http://php.net/pcre\">Perl-Compatible Regular Expressions (PCRE)</a>.</p>";
$output .= "<p>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!</p>";
$output .= strtr("<p>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</p>", array("%pcre" => l(t("Perl-Compatible Regular Expressions (PCRE)"), "php.net/pcre", array("location" => "global"))));
$output .= "<p>However, for basic tasks it is sufficient to look at the following examples:</p>";
$output .= "<p>If the block should only show up on blog pages, use &lt;/blog&gt;. To display on all node views use &lt;/node/view&gt;. The angular brackets are used as delimiters of the regular expression. To show up on either forum or book pages use &lt;(/forum|/book)&gt;. 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 &lt;/node/add/(story|blog|image)&gt;. Blocks which have their paths set to this expression will show up on story, block, or image composition pages.</p>";
$output .= "<h3>Custom Blocks</h3>";
$output .= "<p>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.</p>";
$output .= "<p>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.</p>";
$output .= "<h4>PHP in custom blocks</h4>";
$output .= "<p>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.</p>";
$output .= "<p>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.</p>";
$output .= "<p>Remember that the code within each PHP custom block must be valid PHP code - including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your cusom blocks separately using a simple test script on top of a test database before migrating to your production environment.</p>";
$output .= "<p>Notes:</p><ul><li>You can use global variables, such as configuration parameters, within the scope of a PHP box but remember that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.</li><li>register_globals is now set to <b>off</b> by default. If you need form information you need to get it from the \"superglobals\" \$_POST, \$_GET, etc.</li><li>You can use the <code>return</code> statement to return the actual content for your block as well.</li></ul>";
$output .= "<p>A basic example:</p>";
@ -30,13 +34,31 @@ function block_help() {
}";
$output .= "</pre></blockquote>";
$output .= "<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>";
return t($output);
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 <b>active</b> 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 <b>create php content</b> permission (see %permission) you <b>must</b> 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 <b>active</b> 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 <a href=\"%overview\">block management</a>. The title is used when displaying the block. The description is used in the \"block\" column on the <a href=\"%overview\">block management</a> page. If you are going to place PHP code in the block, and you have <b>create php content</b> permission (see <a href=\"%permission\">user management >> user permissions</a>) you <B>must</b> change the type to PHP to make your code active.", array("%overview" => url("admin/block"), "%permission" => url("admin/user/permission")));
$help["preview"] = t("This page 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);
}
}

View File

@ -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() {
function blog_help($section) {
$output ="";
switch ($section) {
case 'admin/blog/help':
case 'admin/help':
$output .= "<p>Drupal's blog module allows registered users to maintain an online weblog (commonly known as a blog), often referred to as an online journal or diary. 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.</p>";
$output .= "<p>Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen, or agree/disagree with. A typical example of a long term blog can be seen at <a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>.</p>";
$output .= strtr("<p>Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.</p>", array("%scripting-com" => l(t("http://www.scripting.com"), "www.scripting.com", array("location" => "global"))));
$output .= "<p>The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.</p>";
$output .= "<p>If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link <b>(b)</b> next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.</p>";
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) {

View File

@ -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() {
function blog_help($section) {
$output ="";
switch ($section) {
case 'admin/blog/help':
case 'admin/help':
$output .= "<p>Drupal's blog module allows registered users to maintain an online weblog (commonly known as a blog), often referred to as an online journal or diary. 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.</p>";
$output .= "<p>Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen, or agree/disagree with. A typical example of a long term blog can be seen at <a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>.</p>";
$output .= strtr("<p>Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.</p>", array("%scripting-com" => l(t("http://www.scripting.com"), "www.scripting.com", array("location" => "global"))));
$output .= "<p>The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.</p>";
$output .= "<p>If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link <b>(b)</b> next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.</p>";
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) {

View File

@ -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 = "";
switch ($section) {
case 'admin/bloggerapi/help':
case 'admin/help':
$output = "<h3>Introduction</h3>";
$output .= "<p><a href=\"http://www.blogger.com\">Blogger</a>, the well-known public weblog service, provides an application programing interface (API) to allow remote procedure calls (RPC) to the Blogger service. Drupal supports this <a href=\"http://www.blogger.com/developers/api/1_docs/\">Blogger API</a>, which means that many remote clients (e.g. <a href=\"http://radio.userland.com/\">Radio</a>, <a href=\"http://blogbuddy.sourceforge.net/\">Blogbuddy</a>, <a href=\"http://www.wbloggar.com/\">w.bloggar</a>, <a href=\"http://projects.kittle.info/tr/\">TextRouter</a>, may post to Drupal. These clients provide a bevy of interesting capabilities like offline composing, spellcheck, and WYSIWYG editing; many folks prefer to blog with a client application over typical web forms. By supporting the Blogger API, Drupal grows grander than a web site engine, it's a <i>content accepting machine</i>&trade;.</p>";
$output .= "<p>The <a href=\"http://www.blogger.com/developers/api/1_docs/\">Blogger API</a> uses the <a href=\"http://www.xmlrpc.com\">XML-RPC</a> protocol for communicating with the outside world. XML-RPC, originally developed by Dave Winer of <a href=\"http://www.userland.com\">UserLand Software</a>, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses XML-RPC for several other tasks (e.g. notifiying <a href=\"http://www.weblogs.com\">weblogs.com</a> of blog updates and making/accepting ". l("distributed authentication", "user/help") ." requests)</p>";
$output .= strtr("<p>%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 <i>content accepting machine</i>&trade;.</p>", 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("<p>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)</p>",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 .= "<h3>Blogger API implementation</h3>";
$output .= "<p>A word of warning on the Blogger API: it is <b>unofficial</b>. It exists because Blogger is one of the most popular services and also they were first to implement an XML-RPC interface to their service. It may not be the best implementation of a distributed weblog API. For a promising candidate, see the <a href=\"http://www.intertwingly.net/wiki/pie/RoadMap\">Echo project</a>.</p>";
$output .= strtr("<p>A word of warning on the Blogger API: it is <b>unofficial</b>. 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.</p>", array("%echo-proj" => l(t("Echo project"), "www.intertwingly.net/wiki/pie/RoadMap", array("location" => "global")) ));
$output .= "<p>Drupal's support for the Blogger API is quite complete. Each method with an asterisk below has been implemented in Drupal.</p>";
$output .= "<p><a href=\"http://www.blogger.com/developers/api/1_docs/xmlrpc_newPost.html\">blogger.newPost()*</a><br /><a href=\"http://www.blogger.com/developers/api/1_docs/xmlrpc_editPost.html\">blogger.editPost()*</a><br /><a href=\"http://www.blogger.com/developers/api/1_docs/xmlrpc_getUsersBlogs.html\">blogger.getUsersBlogs()*</a><br /><a href=\"http://www.blogger.com/developers/api/1_docs/xmlrpc_getUserInfo.html\">blogger.getUserInfo()*</a><br /><a href=\"http://www.blogger.com/developers/api/1_docs/xmlrpc_getTemplate.html\">blogger.getTemplate()</a><br /><a href=\"http://www.blogger.com/developers/api/1_docs/xmlrpc_setTemplate.html\">blogger.setTemplate()</a></p>";
$output .= "<p>Drupal also supports the following methods. These methods were added after the those listed above and are not documented on the Blogger API web site. Each method is linked to its corresponding blogger-dev mailing list posts:</p>";
$output .= "<p><a href=\"http://groups.yahoo.com/group/bloggerDev/message/296\">blogger.getPost()*</a><br /><a href=\"http://groups.yahoo.com/group/bloggerDev/message/225\">blogger.getRecentPosts()*</a><br /><a href=\"http://groups.yahoo.com/group/bloggerDev/message/147\">blogger.deletePost()*</a></p>";
$output .= strtr("<p>%bloggerapi-newpost<br />%bloggerapi-editpost<br />%bloggerapi-getuserblogs<br />%bloggerapi-getuserinfo<br />%bloggerapi-gettemplate<br />%bloggerapi-settemplate</p>", 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 .= "<p>Drupal also supports the following methods. These methods were added after the those listed above and are not documented on the Blogger API web site. Each method is linked to its corresponding blogger-dev mailing list post:</p>";
$output .= strtr("<p>%mess-296<br />%mess-225<br />%mess-147</p>", 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 .= "<h3>Installation and usage</h3>";
$output .= "<p>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.</p>";
$output .= strtr("<p>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.</p>", array("%mod-config" => l(t("modules configuration page"), "admin/systems/modules"), "%user-management" => l(t("user management"), "admin/user/permission") ));
$output .= "<p>Once the API is enabled you can download one of the above mentioned Blogger API clients and get blogging.</p>";
$output .= "<h3>Setup of the client</h3>";
$output .= "<p>The Drupal page you need to call in order to connect using the Blogger API is <i>http://server/xmlrpc.php</i> where <i>server</i> is the URL of the site you want to post to. As an example when posting to drupal.org, the account settings for <a href=\"http://www.wbloggar.com/\">w.bloggar</a> would be: host: www.drupal.org (default = plant.blogger.com) and page: xmlrpc.php (default = /api/RPC2).</p>";
$output .= strtr("<p>The Drupal page you need to call in order to connect using the Blogger API is <i>http://server/xmlrpc.php</i> where <i>server</i> is the URL of the site you want to post to. As an example when posting to drupal.org, the account settings for %client-wbloggar would be: host: www.drupal.org (default = plant.blogger.com) and page: xmlrpc.php (default = /api/RPC2).</p>", array("%client-wbloggar" => l(t("w.bloggar"), "www.wbloggar.com", array("location" => "global")) ));
$output .= "<p>You can't use remote authentication when posting using a Blogger API enabled client, even when you could use that to authenticate on the site itself. You will have to use the site's local username, enter a password for that account, and then use that combination to post using the Blogger API client.</p>";
$output .= "<h3>Notes and limitations</h3>";
$output .= "<ul><li>The Blogger API contains an AppKey that is discarded in the Drupal Implementation.</li><li>The Blogger API does not allow for a title element. Our work around for this is either to use &lt;title&gt;&lt;/title&gt; tags in the body of your post or let the module create a title by inspecting the first few lines of the post body.</li><li>The publish parameter is always set to <i>1</i>.</li><li>When using the <i>getUserInfo</i> call, Drupal attempts to generate a first and last name from the Drupal username; no distinction is made internally</li><li><i>GetUsersBlogs</i> only returns one blog because unlike Blogger, Drupal only allows one blog per user.</li></ul>";
break;
case 'admin/system/modules':
$output .= "Enables users to post using tools or applications that support the Blogger API.";
break;
}
return t($output);
}

View File

@ -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 .= "<p>The <i>collaborative book</i> organises content into a nested hierarchical structure. It is particularly good for manuals,FAQs and the like, allowing you to have chapters, sections, etc.</p>";
function book_help($section = "admin/node/book/help") {
$output = "";
switch ($section) {
case 'admin/node/book/help':
case 'admin/book/help':
case 'admin/help':
$output .= "<p>The <i>collaborative book</i> 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.</p>";
$output .= "<p>A book is simply a collection of nodes that have been linked together. These nodes are usually of type <i>book page</i>, but you can insert nodes of any type into a book outline. Every node in the book has a <i>parent</i> 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 <i>weight</i> that you give them.</p>";
$output .= "<p>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 <i>log message</i> field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is 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.</p>";
$output .= "<p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use ". l("permissions", "admin/user/permission") ." to determine who may read and write to them. Only administrators are allowed to create new books, which are really just nodes whose parent is <i>&lt;root&gt;</i>. To include an existing node in your book, click on the \"administer\"-link in that node. At the bottom of this administration page, click on the <i>edit book outline</i> button. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the <i>create book page</i> link.</p>";
$output .= "<p>Administrators may review the hierarchy of their books by clicking on the ". l("collaborative book", "admin/node/book")." link in the adminstration pages. There, nodes may be edited, reorganized, removed from book, and deleted. This behavior may change in the future. When a parent node is deleted, it may leave behind child nodes. These nodes are now <i>orphans</i>. Administrators should periodically ". l("review their books for orphans", "admin/node/book/orphan") ." and reaffiliate those pages as desired. Finally, administrators may also ". l("export their books", "book/print") ." to a single, flat HTML page which is suitable for printing.</p>";
$output .= strtr("<p>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 <i>&lt;root&gt;</i>. To include an existing node in your book, click on the \"administer\"-link in that node. At the bottom of this administration page, click on the <i>edit book outline</i> button. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the %create link.</p>", array("%permissions" => l(t("permissions"), "admin/user/permission"), "%create" => l(t("create book page"), "node/add/book") ));
$output .= strtr("<p>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 <i>orphans</i>. 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.</p>", 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 .= "<h3>Maintaining a FAQ using a collaborative book</h3>";
$output .= "<p>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!</p>";
$output .= "<p>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 <i>create book page</i> in your user box. Give it a thoughtful title, and body. A title like \"Estonia Travel - FAQ\" is nice. You may always edit these fields later. You will probably want to designate <i>&lt;root&gt;</i> as the parent of this page. Leave the <i>log message</i> and <i>type</i> fields blank for now. After you have submitted this book page, you are ready to begin filling up your book with questions that are frequently asked.</p>";
$output .= "<p>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!</p>";
$output .= strtr("<p>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 <i>&lt;root&gt;</i> as the parent of this page. Leave the <i>log message</i> and <i>type</i> fields blank for now. After you have submitted this book page, you are ready to begin filling up your book with questions that are frequently asked.</p>", array("%create" => l(t("create book page"), "node/add/book") ));
$output .= "<p>Whenever you come across a post which you want to include in your FAQ, click on the <i>administer</i> link. Then click on the <i>edit book outline</i> button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a <i>parent</i>. Books are quite flexible. They can have sections like <i>Flying to Estonia</i>, <i>Eating in Estonia</i> and so on. As you get more experienced with the <i>collaborative book</i>, you can reorganize posts in your book so that it stays organized.</p>";
$output .= "<p>Notes:</p><ul><li>Any comments attached to those relevant posts which you designate as book pages will also be transported into your book. This is a great feature, since much wisdom is shared via comments. Remember that all future comments and edits will automatically be reflected in your book.</li><li>You may wish to edit the title of posts when adding them to your FAQ. This is done on the same page as the <i>Edit book outline</i> button. Clear titles improve navigability enormously.</li><li>Book pages may come from any content type (blog, story, page, etc.). If you are creating a post solely for inclusion in your book, then use the <i>Create book page</i> link.</li><li>If you don't see the <i>administer</i> link, then you probably have insufficient ". l("permissions", "admin/user/permission") .".</li><li>If you want to get really fancy, note that books are one of the few content types which allow raw PHP in their <i>body</i>. So you've got lots of geeky possibilities there.</li></ul>";
return t($output);
$output .= strtr("<p>Notes:</p><ul><li>Any comments attached to those relevant posts which you designate as book pages will also be transported into your book. This is a great feature, since much wisdom is shared via comments. Remember that all future comments and edits will automatically be reflected in your book.</li><li>You may wish to edit the title of posts when adding them to your FAQ. This is done on the same page as the <i>Edit book outline</i> button. Clear titles improve navigability enormously.</li><li>Book pages may come from any content type (blog, story, page, etc.). If you are creating a post solely for inclusion in your book, then use the %create link.</li><li>If you don't see the <i>administer</i> link, then you probably have insufficient %permission.</li><li>If you want to get really fancy, note that books are one of the few content types which allow raw PHP in their <i>body</i>. So you've got lots of geeky possibilities there.</li></ul>", 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);
}
?>

View File

@ -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 .= "<p>The <i>collaborative book</i> organises content into a nested hierarchical structure. It is particularly good for manuals,FAQs and the like, allowing you to have chapters, sections, etc.</p>";
function book_help($section = "admin/node/book/help") {
$output = "";
switch ($section) {
case 'admin/node/book/help':
case 'admin/book/help':
case 'admin/help':
$output .= "<p>The <i>collaborative book</i> 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.</p>";
$output .= "<p>A book is simply a collection of nodes that have been linked together. These nodes are usually of type <i>book page</i>, but you can insert nodes of any type into a book outline. Every node in the book has a <i>parent</i> 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 <i>weight</i> that you give them.</p>";
$output .= "<p>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 <i>log message</i> field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is 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.</p>";
$output .= "<p>Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use ". l("permissions", "admin/user/permission") ." to determine who may read and write to them. Only administrators are allowed to create new books, which are really just nodes whose parent is <i>&lt;root&gt;</i>. To include an existing node in your book, click on the \"administer\"-link in that node. At the bottom of this administration page, click on the <i>edit book outline</i> button. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the <i>create book page</i> link.</p>";
$output .= "<p>Administrators may review the hierarchy of their books by clicking on the ". l("collaborative book", "admin/node/book")." link in the adminstration pages. There, nodes may be edited, reorganized, removed from book, and deleted. This behavior may change in the future. When a parent node is deleted, it may leave behind child nodes. These nodes are now <i>orphans</i>. Administrators should periodically ". l("review their books for orphans", "admin/node/book/orphan") ." and reaffiliate those pages as desired. Finally, administrators may also ". l("export their books", "book/print") ." to a single, flat HTML page which is suitable for printing.</p>";
$output .= strtr("<p>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 <i>&lt;root&gt;</i>. To include an existing node in your book, click on the \"administer\"-link in that node. At the bottom of this administration page, click on the <i>edit book outline</i> button. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the %create link.</p>", array("%permissions" => l(t("permissions"), "admin/user/permission"), "%create" => l(t("create book page"), "node/add/book") ));
$output .= strtr("<p>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 <i>orphans</i>. 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.</p>", 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 .= "<h3>Maintaining a FAQ using a collaborative book</h3>";
$output .= "<p>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!</p>";
$output .= "<p>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 <i>create book page</i> in your user box. Give it a thoughtful title, and body. A title like \"Estonia Travel - FAQ\" is nice. You may always edit these fields later. You will probably want to designate <i>&lt;root&gt;</i> as the parent of this page. Leave the <i>log message</i> and <i>type</i> fields blank for now. After you have submitted this book page, you are ready to begin filling up your book with questions that are frequently asked.</p>";
$output .= "<p>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!</p>";
$output .= strtr("<p>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 <i>&lt;root&gt;</i> as the parent of this page. Leave the <i>log message</i> and <i>type</i> fields blank for now. After you have submitted this book page, you are ready to begin filling up your book with questions that are frequently asked.</p>", array("%create" => l(t("create book page"), "node/add/book") ));
$output .= "<p>Whenever you come across a post which you want to include in your FAQ, click on the <i>administer</i> link. Then click on the <i>edit book outline</i> button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a <i>parent</i>. Books are quite flexible. They can have sections like <i>Flying to Estonia</i>, <i>Eating in Estonia</i> and so on. As you get more experienced with the <i>collaborative book</i>, you can reorganize posts in your book so that it stays organized.</p>";
$output .= "<p>Notes:</p><ul><li>Any comments attached to those relevant posts which you designate as book pages will also be transported into your book. This is a great feature, since much wisdom is shared via comments. Remember that all future comments and edits will automatically be reflected in your book.</li><li>You may wish to edit the title of posts when adding them to your FAQ. This is done on the same page as the <i>Edit book outline</i> button. Clear titles improve navigability enormously.</li><li>Book pages may come from any content type (blog, story, page, etc.). If you are creating a post solely for inclusion in your book, then use the <i>Create book page</i> link.</li><li>If you don't see the <i>administer</i> link, then you probably have insufficient ". l("permissions", "admin/user/permission") .".</li><li>If you want to get really fancy, note that books are one of the few content types which allow raw PHP in their <i>body</i>. So you've got lots of geeky possibilities there.</li></ul>";
return t($output);
$output .= strtr("<p>Notes:</p><ul><li>Any comments attached to those relevant posts which you designate as book pages will also be transported into your book. This is a great feature, since much wisdom is shared via comments. Remember that all future comments and edits will automatically be reflected in your book.</li><li>You may wish to edit the title of posts when adding them to your FAQ. This is done on the same page as the <i>Edit book outline</i> button. Clear titles improve navigability enormously.</li><li>Book pages may come from any content type (blog, story, page, etc.). If you are creating a post solely for inclusion in your book, then use the %create link.</li><li>If you don't see the <i>administer</i> link, then you probably have insufficient %permission.</li><li>If you want to get really fancy, note that books are one of the few content types which allow raw PHP in their <i>body</i>. So you've got lots of geeky possibilities there.</li></ul>", 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);
}
?>

View File

@ -1,25 +1,42 @@
<?php
// $Id$
function cloud_help($type = "administrator") {
if ($type == "user") {
$output .= "<p>". t("The cloud monitor tracks or crawls other interesting web sites and displays their latest modification dates. It acts as a link watcher such that you can keep an eye on the other sites in our cloud.") ."</p>";
}
else {
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 .= "<ul>";
$output .= " <li>The site administrator enters names and URLs of the relevant pages on the cloud monitor administration page.</li>";
$output .= " <li>Drupal's cron function, triggers the cloud module to check all the registered web sites for recent changes or updates. (A page is updated when there is a <i>x</i>-byte difference since the last time it checked, where <i>x</i> is a configuration option.)</li>";
$output .= strtr("<li>The site administrator enters names and URLs of the relevant pages on the %cloud-add page.</li>", array("%cloud-add" => l(t("content syndication &raquo; site cloud &raquo; add new site"), "admin/syndication/cloud/add") ));
$output .= "<li>Drupal's cron function, triggers the cloud module to check all the registered web sites for recent changes or updates. (A page is updated when there is an <i>x</i>-byte difference since the last time it checked, where <i>x</i> is a configuration option.)</li>";
$output .= " <li>The module exports both a page and a block that display the registered sites ordered by their last modification date.</li>";
$output .= "</ul>";
break;
case 'cloud':
$output .= "<p>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.</p>";
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 <b>must</b> setup cron support. To get the site cloud block to display you must turn on the <B>Site bloud block</b> 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 <b>must</b> setup cron support. To get the site cloud block to display you must turn on the <a href=\"%block\">Site cloud block</a>. To go to a monitored site, click on the site name, to load and/or update the 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");
}
}

View File

@ -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("<p>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.</p>
function comment_help($section = "admin/comment/help") {
$output = "";
<h3>User control of comment display</h3>
<p>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:</p>
<ul>
<li><b>Threaded </b>-- Comment posts are displayed much like the subject view of an email client: the posts are grouped according to the conversations and subconversations.</li>
<li><b>Flat </b>-- Displays the posts in chronological order, in the order in which they are posted.</li>
<li><b>Expanded </b>-- Displays the title and text for each post.</li>
<li><b>Collapsed</b> -- Displays only the title for each post.</li>
</ul>
<p>When users choose <i>save settings</i>, 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 <i>site configuration &raquo; modules &raquo; comment</i>.</p>
<p>NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).</p>
switch ($section) {
case 'admin/help':
case 'admin/comment/help':
$output .= "<p>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.</p>";
$output .= "<h3>User control of comment display</h3>";
$output .= "<p>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:</p>";
$output .= "<ul>";
$output .= "<li><b>Threaded</b> -- Displays the posts grouped according to conversations and subconversations, much like the subject view of an email client.</li>";
$output .= "<li><b>Flat</b> -- Displays the posts in chronological order, in the order in which they are posted.</li>";
$output .= "<li><b>Expanded</b> -- Displays the title and text for each post.</li>";
$output .= "<li><b>Collapsed</b> -- Displays only the title for each post.</li>";
$output .= "</ul>";
$output .= strtr("<p>When a user chooses <i>save settings</i>, 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.</p>",array("%comment-config" => l(t("site configuration &raquo; modules &raquo; comment"), "admin/system/modules/comment") ));
$output .= "<p>NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).</p>";
<h3>Additional comment configurations</h3>
<p>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 <i>site configuration</i> under <i>Submission settings</i>.</p>
<p>Administrators can control access to various comment module functions through <i>user management &raquo; user permissions</i>. 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.</p>
<p>The following permissions can be enabled for anonymous users, authenticated users, or any other roles that the administrator chooses to define:</p>
<ul>
<li><b>Access comments</b> -- Necessary for users to view comments.</li>
<li><b>Administrate comments</b> -- Gives the user complete control over configuring, editing and deleting all comments on the site. Best reserved for very trusted users.</li>
<li><b>Moderate comments</b> -- Users with this permission can rate comment postings (see more on moderation below).</li>
<li><b>Post comments</b> -- Allows users to post comments into an administrator moderation queue. Administrators then post the comment to the site. </li>
<li><b>Post comments without approval</b> -- Bypasses the administrator moderation queue and comments are posted directly.</li>
</ul>
$output .= "<h3>Additional comment configurations</h3>";
$output .= strtr("<p>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 <i>Submission settings</i>.</p>", array("%site-config" => l(t("site configuration"), "admin/system") ));
$output .= strtr("<p>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.</p>", array("%user-permissions" => l(t("user management &raquo; user permissions"), "admin/user/permission") ));
$output .= "<p>The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:</p>";
$output .= "<ul>";
$output .= "<li><b>Access comments</b> -- Allows users to view comments.</li>";
$output .= "<li><b>Administrate comments</b> -- Allows users complete control over configuring, editing and deleting all comments on the site. Best reserved for <b>very</b> trusted users.</li>";
$output .= "<li><b>Moderate comments</b> -- Allows users to rate comment postings (see more on moderation below).</li>";
$output .= "<li><b>Post comments</b> -- Allows users to post comments into an administrator moderation queue. Administrators then post the comment to the site.</li>";
$output .= "<li><b>Post comments without approval</b> -- Allows users to directly post comments. This bypasses the administrator moderation queue.</li>";
$output .= "</ul>";
<h3>Notification of new comments</h3>
<p>Drupal provides specific features to inform site members when new comments have been posted:</p>
<ul>
<li>On the home page, Drupal displays the total number of comments along with each node. Drupal also tracks comments read by individual site members. Logged in members will see a notice accompanying nodes containing comments which they have not read.</li>
<li>The <i>tracker</i> module displays all recent posts on the site (note that the tracker module is disabled by default). When logged in, members will find a <i>view recent posts </i>in their user information block with a link to the <i>Recent activity</i> page. This page is a useful way to browse new or updated nodes and comments. Content which the user has not yet read is tagged with a red star (this graphic may depend on the current theme). Visit the comment board for any node, and Drupal will display a red <i>new</i> label beside the text of unread comments.</li>
<li>Some administrators may want to <a href=\"http://drupal.org/node/view/68\">download</a>, install and configure the notify module. Users can then request that Drupal send them an email when new comments are posted (the notify module requires that cron.php be configured properly).</li>
</ul>
$output .= "<h3>Notification of new comments</h3>";
$output .= "<p>Drupal provides specific features to inform site members when new comments have been posted:</p>";
$output .= "<ul>";
$output .= "<li>On the home page, Drupal displays the total number of comments attached to each node, and tracks comments read by individual site members. Members which have logged in will see a notice accompanying nodes which contain comments that they have not read.</li>";
$output .= strtr("<li>The <i>tracker</i> module, disabled by default, displays all the site's recent posts. When logged in, members will find a %tracker in their user information block with a link to the %tracker-recent page. This page is a useful way to browse new or updated nodes and comments. Content which the user has not yet read is tagged with a red star (this graphic depends on the current theme). Visit the comment board for any node, and Drupal will display a red <i>new</i> label beside the text of unread comments.</li>",array("%tracker" => l(t("view recent posts"), "tracker"), "%tracker-recent" => l(t("Recent activity"), "tracker") ));
$output .= strtr("<li>Some administrators may want to %download-notify, install and configure the notify module. Users can then request that Drupal send them an email when new comments are posted (the notify module requires that cron.php be configured properly).</li>", array("%download-notify" => l(t("download"), "drupal.org/node/view/68", array("location" => "global")) ));
$output .= "</ul>";
<h3>Comment moderation</h3>
<p>On sites with active commenting from users, the administrator can turn over comment moderation to the community. </p>
<p>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.</p>
<p>To enable moderation, the administrator must grant <i>moderate comments</i> permissions. Then, a number of options in <i>comment management &raquo; comment moderation</i> must be configured.</p>
$output .= "<h3>Comment moderation</h3>";
$output .= "<p>On sites with active commenting from users, the administrator can turn over comment moderation to the community. </p>";
$output .= "<p>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.</p>";
$output .= strtr("<p>To enable moderation, the administrator must grant %permission permissions. Then, a number of options in %comment-moderation must be configured.</p>", array("%permission" => l(t("moderate comments"), "admin/user/permissions"), "%comment-moderation" => l(t("comment management &raquo; comment moderation"), "admin/comment/moderation") ));
<h4>Moderation votes</h4>
<p>The first step is to create moderation labels which allow users to rate a comment. Go to <i>comment management &raquo; comment moderation &raquo; votes</i>. In the <i>vote</i> field, enter the textual labels which users will see when casting their votes. Some examples might be</p>
<ul>
<li>Excellent +3</li>
<li>Insightful +2</li>
<li>Caught My Attention +1</li>
<li>Useful +1</li>
<li>Redundant -1</li>
<li>Flame -3</li>
</ul>
<p>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.</p>
<p>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.</p>
$output .= "<h4>Moderation votes</h4>";
$output .= strtr("<p>The first step is to create moderation labels which allow users to rate a comment. Go to %comment-votes. In the <i>vote</i> field, enter the textual labels which users will see when casting their votes. Some examples are</p>", array("%comment-votes" => l(t("comment management &raquo; comment moderation &raquo; votes"), "admin/comment/moderation/votes") ));
$output .= "<ul>";
$output .= "<li>Excellent +3</li>";
$output .= "<li>Insightful +2</li>";
$output .= "<li>Caught My Attention +1</li>";
$output .= "<li>Useful +1</li>";
$output .= "<li>Redundant -1</li>";
$output .= "<li>Flame -3</li>";
$output .= "</ul>";
$output .= "<p>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.</p>";
$output .= "<p>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.</p>";
<h4>Moderators/vote values matrix</h4>
$output .= "<h4>Moderators/vote values matrix</h4>";
<p> Next go to <i>comment management &raquo; comment moderation &raquo; matrix</i>. 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.</p>
<p>NOTE: Comment ratings are calculated by averaging user votes with the initial rating.</p>
<h4>Creating comment thresholds</h4>
$output .= strtr("<p>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.</p>", array("%comment-matrix" => l(t("comment management &raquo; comment moderation &raquo; matrix"), "admin/comment/moderation/,atrix") ));
$output .= "<p>NOTE: Comment ratings are calculated by averaging user votes with the initial rating.</p>";
$output .= "<h4>Creating comment thresholds</h4>
<p>In <i>comment management &raquo; comment moderation &raquo; thresholds</i>, 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.</p>
<p>When creating the thresholds, note that the <i>Minimum score</i> is asking you for the lowest rating that a comment can have in order to be displayed.</p>
<p>To see a common example of how thresholds work, you might visit <a href=\"http://slashdot.org/\">Slashdot</a> and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.</p>
<h4>Initial comment scores</h4>
<p>Finally, you may want to enter some <i>initial comment scores</i>. In <i>comment management &raquo; initial comment scores </i>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 <b>0</b> as the default.</p>");
return $output;
<p>Finally, you may want to enter some <i>initial comment scores</i>. In <i>comment management &raquo; initial comment scores </i>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 <b>0</b> as the default.</p>";
break;
}
return t($output);
}
function comment_system($field) {
@ -1226,6 +1231,11 @@ function comment_moderation_form($comment) {
}
}
if (user_access("administer comments")) {
$options .= " <option value=\"\">". t("---") ."</option>\n";
$options .= " <option value=\"offline\">". t("unpublish") ."</option>\n";
}
$output .= "<select name=\"moderation[$comment->cid]\">$options</select>\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,17 +1350,6 @@ 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);
/*
** 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))) {
@ -1377,7 +1378,6 @@ function comment_moderate() {
}
}
}
}
function comment_save_settings($mode, $order, $threshold, $comments_per_page) {
global $user;

View File

@ -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("<p>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.</p>
function comment_help($section = "admin/comment/help") {
$output = "";
<h3>User control of comment display</h3>
<p>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:</p>
<ul>
<li><b>Threaded </b>-- Comment posts are displayed much like the subject view of an email client: the posts are grouped according to the conversations and subconversations.</li>
<li><b>Flat </b>-- Displays the posts in chronological order, in the order in which they are posted.</li>
<li><b>Expanded </b>-- Displays the title and text for each post.</li>
<li><b>Collapsed</b> -- Displays only the title for each post.</li>
</ul>
<p>When users choose <i>save settings</i>, 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 <i>site configuration &raquo; modules &raquo; comment</i>.</p>
<p>NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).</p>
switch ($section) {
case 'admin/help':
case 'admin/comment/help':
$output .= "<p>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.</p>";
$output .= "<h3>User control of comment display</h3>";
$output .= "<p>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:</p>";
$output .= "<ul>";
$output .= "<li><b>Threaded</b> -- Displays the posts grouped according to conversations and subconversations, much like the subject view of an email client.</li>";
$output .= "<li><b>Flat</b> -- Displays the posts in chronological order, in the order in which they are posted.</li>";
$output .= "<li><b>Expanded</b> -- Displays the title and text for each post.</li>";
$output .= "<li><b>Collapsed</b> -- Displays only the title for each post.</li>";
$output .= "</ul>";
$output .= strtr("<p>When a user chooses <i>save settings</i>, 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.</p>",array("%comment-config" => l(t("site configuration &raquo; modules &raquo; comment"), "admin/system/modules/comment") ));
$output .= "<p>NOTE: When comment moderation is enabled, users will have another control panel option to control thresholds (see below).</p>";
<h3>Additional comment configurations</h3>
<p>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 <i>site configuration</i> under <i>Submission settings</i>.</p>
<p>Administrators can control access to various comment module functions through <i>user management &raquo; user permissions</i>. 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.</p>
<p>The following permissions can be enabled for anonymous users, authenticated users, or any other roles that the administrator chooses to define:</p>
<ul>
<li><b>Access comments</b> -- Necessary for users to view comments.</li>
<li><b>Administrate comments</b> -- Gives the user complete control over configuring, editing and deleting all comments on the site. Best reserved for very trusted users.</li>
<li><b>Moderate comments</b> -- Users with this permission can rate comment postings (see more on moderation below).</li>
<li><b>Post comments</b> -- Allows users to post comments into an administrator moderation queue. Administrators then post the comment to the site. </li>
<li><b>Post comments without approval</b> -- Bypasses the administrator moderation queue and comments are posted directly.</li>
</ul>
$output .= "<h3>Additional comment configurations</h3>";
$output .= strtr("<p>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 <i>Submission settings</i>.</p>", array("%site-config" => l(t("site configuration"), "admin/system") ));
$output .= strtr("<p>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.</p>", array("%user-permissions" => l(t("user management &raquo; user permissions"), "admin/user/permission") ));
$output .= "<p>The following permissions can be enabled for anonymous users, authenticated users, or any other user roles that the administrator chooses to define:</p>";
$output .= "<ul>";
$output .= "<li><b>Access comments</b> -- Allows users to view comments.</li>";
$output .= "<li><b>Administrate comments</b> -- Allows users complete control over configuring, editing and deleting all comments on the site. Best reserved for <b>very</b> trusted users.</li>";
$output .= "<li><b>Moderate comments</b> -- Allows users to rate comment postings (see more on moderation below).</li>";
$output .= "<li><b>Post comments</b> -- Allows users to post comments into an administrator moderation queue. Administrators then post the comment to the site.</li>";
$output .= "<li><b>Post comments without approval</b> -- Allows users to directly post comments. This bypasses the administrator moderation queue.</li>";
$output .= "</ul>";
<h3>Notification of new comments</h3>
<p>Drupal provides specific features to inform site members when new comments have been posted:</p>
<ul>
<li>On the home page, Drupal displays the total number of comments along with each node. Drupal also tracks comments read by individual site members. Logged in members will see a notice accompanying nodes containing comments which they have not read.</li>
<li>The <i>tracker</i> module displays all recent posts on the site (note that the tracker module is disabled by default). When logged in, members will find a <i>view recent posts </i>in their user information block with a link to the <i>Recent activity</i> page. This page is a useful way to browse new or updated nodes and comments. Content which the user has not yet read is tagged with a red star (this graphic may depend on the current theme). Visit the comment board for any node, and Drupal will display a red <i>new</i> label beside the text of unread comments.</li>
<li>Some administrators may want to <a href=\"http://drupal.org/node/view/68\">download</a>, install and configure the notify module. Users can then request that Drupal send them an email when new comments are posted (the notify module requires that cron.php be configured properly).</li>
</ul>
$output .= "<h3>Notification of new comments</h3>";
$output .= "<p>Drupal provides specific features to inform site members when new comments have been posted:</p>";
$output .= "<ul>";
$output .= "<li>On the home page, Drupal displays the total number of comments attached to each node, and tracks comments read by individual site members. Members which have logged in will see a notice accompanying nodes which contain comments that they have not read.</li>";
$output .= strtr("<li>The <i>tracker</i> module, disabled by default, displays all the site's recent posts. When logged in, members will find a %tracker in their user information block with a link to the %tracker-recent page. This page is a useful way to browse new or updated nodes and comments. Content which the user has not yet read is tagged with a red star (this graphic depends on the current theme). Visit the comment board for any node, and Drupal will display a red <i>new</i> label beside the text of unread comments.</li>",array("%tracker" => l(t("view recent posts"), "tracker"), "%tracker-recent" => l(t("Recent activity"), "tracker") ));
$output .= strtr("<li>Some administrators may want to %download-notify, install and configure the notify module. Users can then request that Drupal send them an email when new comments are posted (the notify module requires that cron.php be configured properly).</li>", array("%download-notify" => l(t("download"), "drupal.org/node/view/68", array("location" => "global")) ));
$output .= "</ul>";
<h3>Comment moderation</h3>
<p>On sites with active commenting from users, the administrator can turn over comment moderation to the community. </p>
<p>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.</p>
<p>To enable moderation, the administrator must grant <i>moderate comments</i> permissions. Then, a number of options in <i>comment management &raquo; comment moderation</i> must be configured.</p>
$output .= "<h3>Comment moderation</h3>";
$output .= "<p>On sites with active commenting from users, the administrator can turn over comment moderation to the community. </p>";
$output .= "<p>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.</p>";
$output .= strtr("<p>To enable moderation, the administrator must grant %permission permissions. Then, a number of options in %comment-moderation must be configured.</p>", array("%permission" => l(t("moderate comments"), "admin/user/permissions"), "%comment-moderation" => l(t("comment management &raquo; comment moderation"), "admin/comment/moderation") ));
<h4>Moderation votes</h4>
<p>The first step is to create moderation labels which allow users to rate a comment. Go to <i>comment management &raquo; comment moderation &raquo; votes</i>. In the <i>vote</i> field, enter the textual labels which users will see when casting their votes. Some examples might be</p>
<ul>
<li>Excellent +3</li>
<li>Insightful +2</li>
<li>Caught My Attention +1</li>
<li>Useful +1</li>
<li>Redundant -1</li>
<li>Flame -3</li>
</ul>
<p>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.</p>
<p>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.</p>
$output .= "<h4>Moderation votes</h4>";
$output .= strtr("<p>The first step is to create moderation labels which allow users to rate a comment. Go to %comment-votes. In the <i>vote</i> field, enter the textual labels which users will see when casting their votes. Some examples are</p>", array("%comment-votes" => l(t("comment management &raquo; comment moderation &raquo; votes"), "admin/comment/moderation/votes") ));
$output .= "<ul>";
$output .= "<li>Excellent +3</li>";
$output .= "<li>Insightful +2</li>";
$output .= "<li>Caught My Attention +1</li>";
$output .= "<li>Useful +1</li>";
$output .= "<li>Redundant -1</li>";
$output .= "<li>Flame -3</li>";
$output .= "</ul>";
$output .= "<p>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.</p>";
$output .= "<p>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.</p>";
<h4>Moderators/vote values matrix</h4>
$output .= "<h4>Moderators/vote values matrix</h4>";
<p> Next go to <i>comment management &raquo; comment moderation &raquo; matrix</i>. 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.</p>
<p>NOTE: Comment ratings are calculated by averaging user votes with the initial rating.</p>
<h4>Creating comment thresholds</h4>
$output .= strtr("<p>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.</p>", array("%comment-matrix" => l(t("comment management &raquo; comment moderation &raquo; matrix"), "admin/comment/moderation/,atrix") ));
$output .= "<p>NOTE: Comment ratings are calculated by averaging user votes with the initial rating.</p>";
$output .= "<h4>Creating comment thresholds</h4>
<p>In <i>comment management &raquo; comment moderation &raquo; thresholds</i>, 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.</p>
<p>When creating the thresholds, note that the <i>Minimum score</i> is asking you for the lowest rating that a comment can have in order to be displayed.</p>
<p>To see a common example of how thresholds work, you might visit <a href=\"http://slashdot.org/\">Slashdot</a> and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.</p>
<h4>Initial comment scores</h4>
<p>Finally, you may want to enter some <i>initial comment scores</i>. In <i>comment management &raquo; initial comment scores </i>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 <b>0</b> as the default.</p>");
return $output;
<p>Finally, you may want to enter some <i>initial comment scores</i>. In <i>comment management &raquo; initial comment scores </i>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 <b>0</b> as the default.</p>";
break;
}
return t($output);
}
function comment_system($field) {
@ -1226,6 +1231,11 @@ function comment_moderation_form($comment) {
}
}
if (user_access("administer comments")) {
$options .= " <option value=\"\">". t("---") ."</option>\n";
$options .= " <option value=\"offline\">". t("unpublish") ."</option>\n";
}
$output .= "<select name=\"moderation[$comment->cid]\">$options</select>\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,17 +1350,6 @@ 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);
/*
** 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))) {
@ -1377,7 +1378,6 @@ function comment_moderate() {
}
}
}
}
function comment_save_settings($mode, $order, $threshold, $comments_per_page) {
global $user;

View File

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

View File

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

View File

@ -9,7 +9,7 @@ function ping_help() {
// for optional modules that ping other sites
// $output .= module_invoke_all("ping_help");
$output .= "<p>The ping feature requires crontab.</p>";
print $output;
return t($output);
}
function ping_system($field){

View File

@ -9,7 +9,7 @@ function ping_help() {
// for optional modules that ping other sites
// $output .= module_invoke_all("ping_help");
$output .= "<p>The ping feature requires crontab.</p>";
print $output;
return t($output);
}
function ping_system($field){