Commit e98fe741 authored by Dries's avatar Dries

- Updated the node module to take advantage of the new help system. Patch by

  Michael.
parent 6a5ce3ca
<?php
// $Id$
function node_help() {
function node_help($section = "admin/node/help") {
global $mod;
$output .= "<h3>Nodes</h3>The core of the Drupal system is the node. All of the contents of the system are placed in nodes, or extensions of nodes. ";
$output .= "A base node contains:<dl>";
$output .= "<dt>A Title</dt><dd>Up to 128 characters of text that titles the node.</dd>";
$output .= "<dt>A Teaser</dt><dd>A small block of text that is meant to get you interested in the rest of node. Drupal automatically pulls a small amount of the body of the node to make the teaser (To configure how long the teaser will be ". l("click here","admin/system/modules/node") ."). The teaser can be changed if you don't like what Drupal grabs.</dd>";
$output .= "<dt>The Body</dt><dd>The main text that comprises your content.</dd>";
$output .= "<dt>A Type</dt><dd>What kind of node is this? Blog, book, forum, comment, unextended, etc.</dd>";
$output .= "<dt>An Author</dt><dd>The author's name. It will either be \"anonymous\" or a valid user. You <i>cannot</i> set it to an arbitrary value.</dd>";
$output .= "<dt>Authored on</dt><dd>The date it was written on.</dd>";
$output .= "<dt>Changed</dt><dd>The last time this node was changed.</dd>";
$output .= "<dt>Static on front page</dt><dd>The front page is configured to show the teasers from only a few of the total nodes you have on your site (To configure how many teasers ". l("click here","admin/system/modules/node") ."), but if you think a node is important enough that you want it to stay on the front page enable this.</dd>";
$output .= "<dt>Allow user comments</dt><dd>A node can have comments, which are other nodes. These comments can be written by other users (Read-write), or only by admins (Read-only).</dd>";
$output .= "<dt>Attributes</dt><dd>A way to sort nodes.</dd><dt>Revisions</dt><dd>Drupal has a revision system so that you can \"roll back\" to an older version of a node if the new version is not what you want.</dd>";
$output .= "<dt>Promote to front page</dt><dd>To get people to look at the new stuff on your site you can choose to move it to the front page.</dd>";
$output .= "<dt>In moderation queue</dt><dd>Drupal has a moderation system. If it is active, a node is in one of three states: approved and published, approved and unpublished, and awaiting approval. If you are moderating a node it should be in the moderation queue.</dd>";
$output .= "<dt>Votes</dt><dd>If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote if will either be Approved, or Dropped (To setup the number of votes needed and the promote and dump scores ". l("click here","admin/system/modules/queue") .".)</a>.</dd>";
$output .= "<dt>Score</dt><dd>The score of the node is gotten by the votes it is given.</dd>";
$output .= "<dt>Users</dt><dd>The list of users who have voted on a moderated node.</dd>";
$output .= "<dt>Published</dt><dd>When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.</dd></dl>";
$output .= "<p>Now that you know what is in a node, here are some of the types of nodes available.</p>";
if ($mod == "admin") {
foreach (module_list() as $name) {
if (module_hook($name, "node") && $name != "node") {
$output .= "<h3>". t("Node type: %module", array("%module" => module_invoke($name, "node", "name"))). "</h3>";
$output .= module_invoke($name, "help");
$output = "";
switch ($section) {
case 'admin/help':
case 'admin/node/help':
$output .= "<h3>Nodes</h3>";
$output .= "<p>The core of the Drupal system is the node. All of the contents of the system are placed in nodes, or extensions of nodes.";
$output .= "A base node contains:<dl>";
$output .= "<dt>A Title</dt><dd>Up to 128 characters of text that titles the node.</dd>";
$output .= strtr("<dt>A Teaser</dt><dd>A small block of text that is meant to get you interested in the rest of node. Drupal will automatically pull a small amount of the body of the node to make the teaser (To configure how long the teaser will be %teaser). The teaser can be changed if you don't like what Drupal grabs.</dd>", array("%teaser" => l(t("click here"), "admin/system/modules/node") ));
$output .= "<dt>The Body</dt><dd>The main text that comprises your content.</dd>";
$output .= "<dt>A Type</dt><dd>What kind of node is this? Blog, book, forum, comment, unextended, etc.</dd>";
$output .= "<dt>An Author</dt><dd>The author's name. It will either be \"anonymous\" or a valid user. You <i>cannot</i> set it to an arbitrary value.</dd>";
$output .= "<dt>Authored on</dt><dd>The date the node was written.</dd>";
$output .= "<dt>Changed</dt><dd>The last time this node was changed.</dd>";
$output .= strtr("<dt>Static on front page</dt><dd>The front page is configured to show the teasers from only a few of the total nodes you have on your site (To configure how many teasers %teaser), but if you think a node is important enough that you want it to stay on the front page enable this.</dd>",array("%teaser" => l(t("click here"),"admin/system/modules/node") ));
$output .= "<dt>Allow user comments</dt><dd>A node can have comments. These comments can be written by other users (Read-write), or only by admins (Read-only).</dd>";
$output .= "<dt>Attributes</dt><dd>A way to sort nodes.</dd>";
$output .= "<dt>Revisions</dt><dd>Drupal has a revision system so that you can \"roll back\" to an older version of a node if the new version is not what you want.</dd>";
$output .= "<dt>Promote to front page</dt><dd>To get people to look at the new stuff on your site you can choose to move it to the front page.</dd>";
$output .= "<dt>In moderation queue</dt><dd>Drupal has a moderation system. If it is active, a node is in one of three states: approved and published, approved and unpublished, and awaiting approval. If you are moderating a node it should be in the moderation queue.</dd>";
$output .= strtr("<dt>Votes</dt><dd>If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote if will either be Approved, or Dropped (To setup the number of votes needed and the promote and dump scores %queue.)</a>.</dd>",array("%queue" => l(t("click here"), "admin/system/modules/queue") ));
$output .= "<dt>Score</dt><dd>The score of the node is gotten by the votes it is given.</dd>";
$output .= "<dt>Users</dt><dd>The list of users who have voted on a moderated node.</dd>";
$output .= "<dt>Published</dt><dd>When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.</dd></dl>";
$output .= "<p>Now that you know what is in a node, here are some of the types of nodes available.</p>";
if ($mod == "admin") {
foreach (module_list() as $name) {
if (module_hook($name, "node") && $name != "node") {
$output .= "<h3>". t("Node type: %module", array("%module" => module_invoke($name, "node", "name"))). "</h3>";
$output .= module_invoke($name, "node", "description");
}
}
}
}
break;
case 'admin/system/modules':
$output = "The core that allows content to be submitted to the site.";
break;
case 'admin/system/modules/node':
$output = "Settings for the core of Drupal. Almost everything is a node so these settings will affect most of the site.";
break;
case 'admin/node':
$output = strtr("Below is a list of all of the nodes in your site. Other forms of content are listed elsewhere (e.g. %comment).<br />Clicking a title views that node, while clicking an author's name edits their user information.<br />Other node-related tasks are available from the menu on the left.",array("%comments" => l(t("comments"), "admin/comment") ));
break;
case 'admin/node/search':
$output = "Enter a simple pattern to search for a post. This can include the wildcard character *.<br />For example, a search for \"br*\" might return \"bread bakers\", \"our daily bread\" and \"brenda\".";
break;
case 'admin/node/settings':
$output = "This pages lets you set the defaults used during creation of nodes for all the different node types.<br /><b>comment:</b> Read/write setting for comments.<br /><b>publish:</b> Is this node publicly viewable, has it been published?<br /><b>promote:</b> Is this node to be promoted to the front page?<br /><b>moderate:</b> Does this node need approval before it can be viewed?<br /><b>static:</b> Is this node always visible on the front page?<br /><b>revision:</b> Will this node go into the revision system allowing multiple versions to be saved?";
break;
}
return t($output);
}
function node_system($field){
$system["description"] = t("The core that allows content to be submitted to the site.");
$system["admin_help"] = t("Settings for the core of Drupal. Almost everything is a node so these settings will affect most of the site.");
return $system[$field];
$output = "";
if ($field == "description") {$output = node_help("admin/system/modules"); }
else if ($field == "admin-help") {$output = node_help("admin/system/modules/node");};
return $output;
}
/*
......@@ -541,18 +569,12 @@ function node_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && user_access("administer nodes")) {
$help["overview"] = t("Below is a list of all of the nodes in your site. Other forms of content are listed elsewhere (e.g. ". l("comments", "admin/comment") .").<br />Clicking a title views that node, while clicking an author's name edits their user information.<br />Other node-related tasks are available from the menu on the left.");
$help["post-overview"] = t("Click on <a href=\"%nup\">new or updated posts</a> to see your latest nodes, or <a href=\"%queue\">approval queue</a> to approve new messages.", array("%nup" => url("admin/node/nodes/0"), "%queue" => url("admin/node/nodes/1")));
$help["new-update"] = t("Below is a list of the latest nodes in your site. Clicking a title views that node, while clicking an author's name edits their user information.");
$help["queue"] = t("Below is a list of the node in your site that await approval. To approve a node click on <b>edit node</b> and then change its moderation status to <b>approved</b>.<br />Clicking a title views that node, while clicking an author's name edits their user information.");
$help["search"] = t("Enter a simple pattern to search for a post. This can include the wildcard character *.<br />For example, a search for \"br*\" might return \"bread bakers\", \"our daily bread\" and \"brenda\".");
$help["setting"] = t("This pages lets you set the defaults used during creation of nodes for all the different node types.<br /><b>comment:</b> Read/write setting for comments.<br /><b>publish:</b> Is this node publicly viewable, has it been published?<br /><b>promote:</b> Is this node to be promoted to the front page?<br /><b>moderate:</b> Does this node need approval before it can be viewed?<br /><b>static:</b> Is this node always visible on the front page?<br /><b>revision:</b> Will this node go into the revision system allowing multiple versions to be saved?");
menu("admin/node", "content management", "node_admin", $help["overview"]);
menu("admin/node/search", "search posts", "node_admin", $help["search"], 8);
menu("admin/node", "content management", "node_admin", node_help("admin/node"));
menu("admin/node/search", "search posts", "node_admin", node_help("admin/node/search"), 8);
menu("admin/node/help", "help", "node_help", NULL, 9);
menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
menu("admin/node/settings", "content settings", "node_admin", $help["setting"], 8);
menu("admin/node/settings", "content settings", "node_admin", node_help("admin/node/settings"), 8);
}
return $links;
......
<?php
// $Id$
function node_help() {
function node_help($section = "admin/node/help") {
global $mod;
$output .= "<h3>Nodes</h3>The core of the Drupal system is the node. All of the contents of the system are placed in nodes, or extensions of nodes. ";
$output .= "A base node contains:<dl>";
$output .= "<dt>A Title</dt><dd>Up to 128 characters of text that titles the node.</dd>";
$output .= "<dt>A Teaser</dt><dd>A small block of text that is meant to get you interested in the rest of node. Drupal automatically pulls a small amount of the body of the node to make the teaser (To configure how long the teaser will be ". l("click here","admin/system/modules/node") ."). The teaser can be changed if you don't like what Drupal grabs.</dd>";
$output .= "<dt>The Body</dt><dd>The main text that comprises your content.</dd>";
$output .= "<dt>A Type</dt><dd>What kind of node is this? Blog, book, forum, comment, unextended, etc.</dd>";
$output .= "<dt>An Author</dt><dd>The author's name. It will either be \"anonymous\" or a valid user. You <i>cannot</i> set it to an arbitrary value.</dd>";
$output .= "<dt>Authored on</dt><dd>The date it was written on.</dd>";
$output .= "<dt>Changed</dt><dd>The last time this node was changed.</dd>";
$output .= "<dt>Static on front page</dt><dd>The front page is configured to show the teasers from only a few of the total nodes you have on your site (To configure how many teasers ". l("click here","admin/system/modules/node") ."), but if you think a node is important enough that you want it to stay on the front page enable this.</dd>";
$output .= "<dt>Allow user comments</dt><dd>A node can have comments, which are other nodes. These comments can be written by other users (Read-write), or only by admins (Read-only).</dd>";
$output .= "<dt>Attributes</dt><dd>A way to sort nodes.</dd><dt>Revisions</dt><dd>Drupal has a revision system so that you can \"roll back\" to an older version of a node if the new version is not what you want.</dd>";
$output .= "<dt>Promote to front page</dt><dd>To get people to look at the new stuff on your site you can choose to move it to the front page.</dd>";
$output .= "<dt>In moderation queue</dt><dd>Drupal has a moderation system. If it is active, a node is in one of three states: approved and published, approved and unpublished, and awaiting approval. If you are moderating a node it should be in the moderation queue.</dd>";
$output .= "<dt>Votes</dt><dd>If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote if will either be Approved, or Dropped (To setup the number of votes needed and the promote and dump scores ". l("click here","admin/system/modules/queue") .".)</a>.</dd>";
$output .= "<dt>Score</dt><dd>The score of the node is gotten by the votes it is given.</dd>";
$output .= "<dt>Users</dt><dd>The list of users who have voted on a moderated node.</dd>";
$output .= "<dt>Published</dt><dd>When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.</dd></dl>";
$output .= "<p>Now that you know what is in a node, here are some of the types of nodes available.</p>";
if ($mod == "admin") {
foreach (module_list() as $name) {
if (module_hook($name, "node") && $name != "node") {
$output .= "<h3>". t("Node type: %module", array("%module" => module_invoke($name, "node", "name"))). "</h3>";
$output .= module_invoke($name, "help");
$output = "";
switch ($section) {
case 'admin/help':
case 'admin/node/help':
$output .= "<h3>Nodes</h3>";
$output .= "<p>The core of the Drupal system is the node. All of the contents of the system are placed in nodes, or extensions of nodes.";
$output .= "A base node contains:<dl>";
$output .= "<dt>A Title</dt><dd>Up to 128 characters of text that titles the node.</dd>";
$output .= strtr("<dt>A Teaser</dt><dd>A small block of text that is meant to get you interested in the rest of node. Drupal will automatically pull a small amount of the body of the node to make the teaser (To configure how long the teaser will be %teaser). The teaser can be changed if you don't like what Drupal grabs.</dd>", array("%teaser" => l(t("click here"), "admin/system/modules/node") ));
$output .= "<dt>The Body</dt><dd>The main text that comprises your content.</dd>";
$output .= "<dt>A Type</dt><dd>What kind of node is this? Blog, book, forum, comment, unextended, etc.</dd>";
$output .= "<dt>An Author</dt><dd>The author's name. It will either be \"anonymous\" or a valid user. You <i>cannot</i> set it to an arbitrary value.</dd>";
$output .= "<dt>Authored on</dt><dd>The date the node was written.</dd>";
$output .= "<dt>Changed</dt><dd>The last time this node was changed.</dd>";
$output .= strtr("<dt>Static on front page</dt><dd>The front page is configured to show the teasers from only a few of the total nodes you have on your site (To configure how many teasers %teaser), but if you think a node is important enough that you want it to stay on the front page enable this.</dd>",array("%teaser" => l(t("click here"),"admin/system/modules/node") ));
$output .= "<dt>Allow user comments</dt><dd>A node can have comments. These comments can be written by other users (Read-write), or only by admins (Read-only).</dd>";
$output .= "<dt>Attributes</dt><dd>A way to sort nodes.</dd>";
$output .= "<dt>Revisions</dt><dd>Drupal has a revision system so that you can \"roll back\" to an older version of a node if the new version is not what you want.</dd>";
$output .= "<dt>Promote to front page</dt><dd>To get people to look at the new stuff on your site you can choose to move it to the front page.</dd>";
$output .= "<dt>In moderation queue</dt><dd>Drupal has a moderation system. If it is active, a node is in one of three states: approved and published, approved and unpublished, and awaiting approval. If you are moderating a node it should be in the moderation queue.</dd>";
$output .= strtr("<dt>Votes</dt><dd>If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote if will either be Approved, or Dropped (To setup the number of votes needed and the promote and dump scores %queue.)</a>.</dd>",array("%queue" => l(t("click here"), "admin/system/modules/queue") ));
$output .= "<dt>Score</dt><dd>The score of the node is gotten by the votes it is given.</dd>";
$output .= "<dt>Users</dt><dd>The list of users who have voted on a moderated node.</dd>";
$output .= "<dt>Published</dt><dd>When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.</dd></dl>";
$output .= "<p>Now that you know what is in a node, here are some of the types of nodes available.</p>";
if ($mod == "admin") {
foreach (module_list() as $name) {
if (module_hook($name, "node") && $name != "node") {
$output .= "<h3>". t("Node type: %module", array("%module" => module_invoke($name, "node", "name"))). "</h3>";
$output .= module_invoke($name, "node", "description");
}
}
}
}
break;
case 'admin/system/modules':
$output = "The core that allows content to be submitted to the site.";
break;
case 'admin/system/modules/node':
$output = "Settings for the core of Drupal. Almost everything is a node so these settings will affect most of the site.";
break;
case 'admin/node':
$output = strtr("Below is a list of all of the nodes in your site. Other forms of content are listed elsewhere (e.g. %comment).<br />Clicking a title views that node, while clicking an author's name edits their user information.<br />Other node-related tasks are available from the menu on the left.",array("%comments" => l(t("comments"), "admin/comment") ));
break;
case 'admin/node/search':
$output = "Enter a simple pattern to search for a post. This can include the wildcard character *.<br />For example, a search for \"br*\" might return \"bread bakers\", \"our daily bread\" and \"brenda\".";
break;
case 'admin/node/settings':
$output = "This pages lets you set the defaults used during creation of nodes for all the different node types.<br /><b>comment:</b> Read/write setting for comments.<br /><b>publish:</b> Is this node publicly viewable, has it been published?<br /><b>promote:</b> Is this node to be promoted to the front page?<br /><b>moderate:</b> Does this node need approval before it can be viewed?<br /><b>static:</b> Is this node always visible on the front page?<br /><b>revision:</b> Will this node go into the revision system allowing multiple versions to be saved?";
break;
}
return t($output);
}
function node_system($field){
$system["description"] = t("The core that allows content to be submitted to the site.");
$system["admin_help"] = t("Settings for the core of Drupal. Almost everything is a node so these settings will affect most of the site.");
return $system[$field];
$output = "";
if ($field == "description") {$output = node_help("admin/system/modules"); }
else if ($field == "admin-help") {$output = node_help("admin/system/modules/node");};
return $output;
}
/*
......@@ -541,18 +569,12 @@ function node_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && user_access("administer nodes")) {
$help["overview"] = t("Below is a list of all of the nodes in your site. Other forms of content are listed elsewhere (e.g. ". l("comments", "admin/comment") .").<br />Clicking a title views that node, while clicking an author's name edits their user information.<br />Other node-related tasks are available from the menu on the left.");
$help["post-overview"] = t("Click on <a href=\"%nup\">new or updated posts</a> to see your latest nodes, or <a href=\"%queue\">approval queue</a> to approve new messages.", array("%nup" => url("admin/node/nodes/0"), "%queue" => url("admin/node/nodes/1")));
$help["new-update"] = t("Below is a list of the latest nodes in your site. Clicking a title views that node, while clicking an author's name edits their user information.");
$help["queue"] = t("Below is a list of the node in your site that await approval. To approve a node click on <b>edit node</b> and then change its moderation status to <b>approved</b>.<br />Clicking a title views that node, while clicking an author's name edits their user information.");
$help["search"] = t("Enter a simple pattern to search for a post. This can include the wildcard character *.<br />For example, a search for \"br*\" might return \"bread bakers\", \"our daily bread\" and \"brenda\".");
$help["setting"] = t("This pages lets you set the defaults used during creation of nodes for all the different node types.<br /><b>comment:</b> Read/write setting for comments.<br /><b>publish:</b> Is this node publicly viewable, has it been published?<br /><b>promote:</b> Is this node to be promoted to the front page?<br /><b>moderate:</b> Does this node need approval before it can be viewed?<br /><b>static:</b> Is this node always visible on the front page?<br /><b>revision:</b> Will this node go into the revision system allowing multiple versions to be saved?");
menu("admin/node", "content management", "node_admin", $help["overview"]);
menu("admin/node/search", "search posts", "node_admin", $help["search"], 8);
menu("admin/node", "content management", "node_admin", node_help("admin/node"));
menu("admin/node/search", "search posts", "node_admin", node_help("admin/node/search"), 8);
menu("admin/node/help", "help", "node_help", NULL, 9);
menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
menu("admin/node/settings", "content settings", "node_admin", $help["setting"], 8);
menu("admin/node/settings", "content settings", "node_admin", node_help("admin/node/settings"), 8);
}
return $links;
......
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