Commit 860a5cc3 authored by Dries's avatar Dries

- Removed the $help parameter from the _form hook.  The help, typically
  submission guidelines, should be emmitted using the _help hook.
parent ce42eb41
...@@ -82,6 +82,9 @@ function blog_help($section) { ...@@ -82,6 +82,9 @@ function blog_help($section) {
case 'admin/system/modules/blog': case 'admin/system/modules/blog':
$output .= 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"); $output .= 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");
break; break;
case 'node/add/blog':
$output = variable_get('blog_help', '');
break;
} }
return $output; return $output;
...@@ -159,16 +162,10 @@ function blog_validate(&$node) { ...@@ -159,16 +162,10 @@ function blog_validate(&$node) {
return $error; return $error;
} }
function blog_form(&$node, &$help, &$error) { function blog_form(&$node, &$error) {
global $nid; global $nid;
$iid = $_GET["iid"]; $iid = $_GET["iid"];
/*
** Carry out some explanation or submission guidelines:
*/
$help = variable_get("blog_help", "");
if (empty($node->body)) { if (empty($node->body)) {
/* /*
** If the user clicked a "blog it" link, we load the data from the ** If the user clicked a "blog it" link, we load the data from the
......
...@@ -82,6 +82,9 @@ function blog_help($section) { ...@@ -82,6 +82,9 @@ function blog_help($section) {
case 'admin/system/modules/blog': case 'admin/system/modules/blog':
$output .= 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"); $output .= 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");
break; break;
case 'node/add/blog':
$output = variable_get('blog_help', '');
break;
} }
return $output; return $output;
...@@ -159,16 +162,10 @@ function blog_validate(&$node) { ...@@ -159,16 +162,10 @@ function blog_validate(&$node) {
return $error; return $error;
} }
function blog_form(&$node, &$help, &$error) { function blog_form(&$node, &$error) {
global $nid; global $nid;
$iid = $_GET["iid"]; $iid = $_GET["iid"];
/*
** Carry out some explanation or submission guidelines:
*/
$help = variable_get("blog_help", "");
if (empty($node->body)) { if (empty($node->body)) {
/* /*
** If the user clicked a "blog it" link, we load the data from the ** If the user clicked a "blog it" link, we load the data from the
......
...@@ -180,7 +180,7 @@ function book_validate(&$node) { ...@@ -180,7 +180,7 @@ function book_validate(&$node) {
} }
} }
function book_form(&$node, &$help, &$error) { function book_form(&$node, &$error) {
global $user; global $user;
$op = $_POST["op"]; $op = $_POST["op"];
...@@ -200,13 +200,6 @@ function book_form(&$node, &$help, &$error) { ...@@ -200,13 +200,6 @@ function book_form(&$node, &$help, &$error) {
} }
} }
else { else {
/*
** Carry out some explanation or submission guidelines:
*/
$help = book_node("description");
/* /*
** If a regular user updates a book page, we create a new revision ** If a regular user updates a book page, we create a new revision
** authored by that user: ** authored by that user:
...@@ -906,7 +899,6 @@ function book_help($section = "admin/help#book") { ...@@ -906,7 +899,6 @@ function book_help($section = "admin/help#book") {
case 'admin/node/book/orphan': case 'admin/node/book/orphan':
$output = t("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."); $output = t("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; break;
} }
return $output; return $output;
......
...@@ -180,7 +180,7 @@ function book_validate(&$node) { ...@@ -180,7 +180,7 @@ function book_validate(&$node) {
} }
} }
function book_form(&$node, &$help, &$error) { function book_form(&$node, &$error) {
global $user; global $user;
$op = $_POST["op"]; $op = $_POST["op"];
...@@ -200,13 +200,6 @@ function book_form(&$node, &$help, &$error) { ...@@ -200,13 +200,6 @@ function book_form(&$node, &$help, &$error) {
} }
} }
else { else {
/*
** Carry out some explanation or submission guidelines:
*/
$help = book_node("description");
/* /*
** If a regular user updates a book page, we create a new revision ** If a regular user updates a book page, we create a new revision
** authored by that user: ** authored by that user:
...@@ -906,7 +899,6 @@ function book_help($section = "admin/help#book") { ...@@ -906,7 +899,6 @@ function book_help($section = "admin/help#book") {
case 'admin/node/book/orphan': case 'admin/node/book/orphan':
$output = t("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."); $output = t("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; break;
} }
return $output; return $output;
......
...@@ -181,7 +181,7 @@ function forum_validate(&$node) { ...@@ -181,7 +181,7 @@ function forum_validate(&$node) {
} }
} }
function forum_form(&$node, &$help, &$error) { function forum_form(&$node, &$error) {
if ($node->tid) { if ($node->tid) {
// editing // editing
$tid = $node->tid; $tid = $node->tid;
...@@ -191,9 +191,6 @@ function forum_form(&$node, &$help, &$error) { ...@@ -191,9 +191,6 @@ function forum_form(&$node, &$help, &$error) {
$tid = arg(3); $tid = arg(3);
} }
// outputs the compose guidelines
$help = variable_get("forum_help", "");
$output .= _taxonomy_term_select(t("Forum"), "tid", $tid, variable_get("forum_nav_vocabulary", ""), "", 0, "", variable_get("forum_containers", array())); $output .= _taxonomy_term_select(t("Forum"), "tid", $tid, variable_get("forum_nav_vocabulary", ""), "", 0, "", variable_get("forum_containers", array()));
if ($node->nid) { if ($node->nid) {
...@@ -693,6 +690,9 @@ function forum_help($section = "admin/help#forum") { ...@@ -693,6 +690,9 @@ function forum_help($section = "admin/help#forum") {
case 'admin/system/modules/forum': case 'admin/system/modules/forum':
$output = _forum_message_taxonomy(); $output = _forum_message_taxonomy();
break; break;
case 'node/add/forum':
$output = variable_get('forum_help', '');
break;
} }
return $output; return $output;
......
...@@ -181,7 +181,7 @@ function forum_validate(&$node) { ...@@ -181,7 +181,7 @@ function forum_validate(&$node) {
} }
} }
function forum_form(&$node, &$help, &$error) { function forum_form(&$node, &$error) {
if ($node->tid) { if ($node->tid) {
// editing // editing
$tid = $node->tid; $tid = $node->tid;
...@@ -191,9 +191,6 @@ function forum_form(&$node, &$help, &$error) { ...@@ -191,9 +191,6 @@ function forum_form(&$node, &$help, &$error) {
$tid = arg(3); $tid = arg(3);
} }
// outputs the compose guidelines
$help = variable_get("forum_help", "");
$output .= _taxonomy_term_select(t("Forum"), "tid", $tid, variable_get("forum_nav_vocabulary", ""), "", 0, "", variable_get("forum_containers", array())); $output .= _taxonomy_term_select(t("Forum"), "tid", $tid, variable_get("forum_nav_vocabulary", ""), "", 0, "", variable_get("forum_containers", array()));
if ($node->nid) { if ($node->nid) {
...@@ -693,6 +690,9 @@ function forum_help($section = "admin/help#forum") { ...@@ -693,6 +690,9 @@ function forum_help($section = "admin/help#forum") {
case 'admin/system/modules/forum': case 'admin/system/modules/forum':
$output = _forum_message_taxonomy(); $output = _forum_message_taxonomy();
break; break;
case 'node/add/forum':
$output = variable_get('forum_help', '');
break;
} }
return $output; return $output;
......
...@@ -1092,20 +1092,12 @@ function node_form($edit, $error = NULL) { ...@@ -1092,20 +1092,12 @@ function node_form($edit, $error = NULL) {
// $error and $param must be passed by reference. // $error and $param must be passed by reference.
$function = $edit->type ."_form"; $function = $edit->type ."_form";
if (function_exists($function)) { if (function_exists($function)) {
$form .= $function($edit, $help, $error, $param); $form .= $function($edit, $error, $param);
} }
// Append extra node form: // Append extra node form:
$form .= implode("", node_invoke_nodeapi($edit, "form post", $error)); $form .= implode("", node_invoke_nodeapi($edit, "form post", $error));
/*
** Add the help text:
*/
if ($help) {
$output .= "<p>$help</p>";
}
$output .= "<div class=\"node-form\">"; $output .= "<div class=\"node-form\">";
/* /*
......
...@@ -1092,20 +1092,12 @@ function node_form($edit, $error = NULL) { ...@@ -1092,20 +1092,12 @@ function node_form($edit, $error = NULL) {
// $error and $param must be passed by reference. // $error and $param must be passed by reference.
$function = $edit->type ."_form"; $function = $edit->type ."_form";
if (function_exists($function)) { if (function_exists($function)) {
$form .= $function($edit, $help, $error, $param); $form .= $function($edit, $error, $param);
} }
// Append extra node form: // Append extra node form:
$form .= implode("", node_invoke_nodeapi($edit, "form post", $error)); $form .= implode("", node_invoke_nodeapi($edit, "form post", $error));
/*
** Add the help text:
*/
if ($help) {
$output .= "<p>$help</p>";
}
$output .= "<div class=\"node-form\">"; $output .= "<div class=\"node-form\">";
/* /*
......
...@@ -123,7 +123,7 @@ function page_view($node, $main = 0, $page = 0) { ...@@ -123,7 +123,7 @@ function page_view($node, $main = 0, $page = 0) {
return theme("node", $node, $main, $page); return theme("node", $node, $main, $page);
} }
function page_form(&$node, &$help, &$error) { function page_form(&$node, &$error) {
if (function_exists("taxonomy_node_form")) { if (function_exists("taxonomy_node_form")) {
$output .= implode("", taxonomy_node_form("page", $node)); $output .= implode("", taxonomy_node_form("page", $node));
} }
......
...@@ -123,7 +123,7 @@ function page_view($node, $main = 0, $page = 0) { ...@@ -123,7 +123,7 @@ function page_view($node, $main = 0, $page = 0) {
return theme("node", $node, $main, $page); return theme("node", $node, $main, $page);
} }
function page_form(&$node, &$help, &$error) { function page_form(&$node, &$error) {
if (function_exists("taxonomy_node_form")) { if (function_exists("taxonomy_node_form")) {
$output .= implode("", taxonomy_node_form("page", $node)); $output .= implode("", taxonomy_node_form("page", $node));
} }
......
...@@ -16,6 +16,9 @@ function story_help($section = "admin/help#story") { ...@@ -16,6 +16,9 @@ function story_help($section = "admin/help#story") {
$output .= "In <a href=\"%story-config\">administer &raquo; configuration &raquo; modules &raquo; story</a> you can set up an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trivially short stories."; $output .= "In <a href=\"%story-config\">administer &raquo; configuration &raquo; modules &raquo; story</a> you can set up an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trivially short stories.";
$output = t($output, array("%story-config" => url("admin/system/modules/story"))); $output = t($output, array("%story-config" => url("admin/system/modules/story")));
break; break;
case 'node/add/story':
$output = variable_get('story_help', '');
break;
} }
return $output; return $output;
...@@ -73,13 +76,7 @@ function story_validate(&$node) { ...@@ -73,13 +76,7 @@ function story_validate(&$node) {
return $error; return $error;
} }
function story_form(&$node, &$help, &$error) { function story_form(&$node, &$error) {
/*
** Carry out some explanation or submission guidelines:
*/
$help = variable_get("story_help", "");
if (function_exists("taxonomy_node_form")) { if (function_exists("taxonomy_node_form")) {
$output .= implode("", taxonomy_node_form("story", $node)); $output .= implode("", taxonomy_node_form("story", $node));
......
...@@ -16,6 +16,9 @@ function story_help($section = "admin/help#story") { ...@@ -16,6 +16,9 @@ function story_help($section = "admin/help#story") {
$output .= "In <a href=\"%story-config\">administer &raquo; configuration &raquo; modules &raquo; story</a> you can set up an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trivially short stories."; $output .= "In <a href=\"%story-config\">administer &raquo; configuration &raquo; modules &raquo; story</a> you can set up an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trivially short stories.";
$output = t($output, array("%story-config" => url("admin/system/modules/story"))); $output = t($output, array("%story-config" => url("admin/system/modules/story")));
break; break;
case 'node/add/story':
$output = variable_get('story_help', '');
break;
} }
return $output; return $output;
...@@ -73,13 +76,7 @@ function story_validate(&$node) { ...@@ -73,13 +76,7 @@ function story_validate(&$node) {
return $error; return $error;
} }
function story_form(&$node, &$help, &$error) { function story_form(&$node, &$error) {
/*
** Carry out some explanation or submission guidelines:
*/
$help = variable_get("story_help", "");
if (function_exists("taxonomy_node_form")) { if (function_exists("taxonomy_node_form")) {
$output .= implode("", taxonomy_node_form("story", $node)); $output .= implode("", taxonomy_node_form("story", $node));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment