From e98fe741a90344307c498637b7904a405f0ee3cc Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 23 Aug 2003 18:25:35 +0000 Subject: - Updated the node module to take advantage of the new help system. Patch by Michael. --- modules/node/node.module | 106 ++++++++++++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 42 deletions(-) (limited to 'modules/node') diff --git a/modules/node/node.module b/modules/node/node.module index 79ca87943..89daaf53e 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1,45 +1,73 @@ NodesThe 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:
"; - $output .= "
A Title
Up to 128 characters of text that titles the node.
"; - $output .= "
A Teaser
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.
"; - $output .= "
The Body
The main text that comprises your content.
"; - $output .= "
A Type
What kind of node is this? Blog, book, forum, comment, unextended, etc.
"; - $output .= "
An Author
The author's name. It will either be \"anonymous\" or a valid user. You cannot set it to an arbitrary value.
"; - $output .= "
Authored on
The date it was written on.
"; - $output .= "
Changed
The last time this node was changed.
"; - $output .= "
Static on front page
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.
"; - $output .= "
Allow user comments
A node can have comments, which are other nodes. These comments can be written by other users (Read-write), or only by admins (Read-only).
"; - $output .= "
Attributes
A way to sort nodes.
Revisions
Drupal has a revision system so that you can \"roll back\" to an older version of a node if the new version is not what you want.
"; - $output .= "
Promote to front page
To get people to look at the new stuff on your site you can choose to move it to the front page.
"; - $output .= "
In moderation queue
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.
"; - $output .= "
Votes
If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote if will either be Approved, or Dropped (To setup the number of votes needed and the promote and dump scores ". l("click here","admin/system/modules/queue") .".).
"; - $output .= "
Score
The score of the node is gotten by the votes it is given.
"; - $output .= "
Users
The list of users who have voted on a moderated node.
"; - $output .= "
Published
When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.
"; - $output .= "

Now that you know what is in a node, here are some of the types of nodes available.

"; - - if ($mod == "admin") { - foreach (module_list() as $name) { - if (module_hook($name, "node") && $name != "node") { - $output .= "

". t("Node type: %module", array("%module" => module_invoke($name, "node", "name"))). "

"; - $output .= module_invoke($name, "help"); - + $output = ""; + + switch ($section) { + + case 'admin/help': + case 'admin/node/help': + $output .= "

Nodes

"; + $output .= "

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:

"; + $output .= "
A Title
Up to 128 characters of text that titles the node.
"; + $output .= strtr("
A Teaser
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.
", array("%teaser" => l(t("click here"), "admin/system/modules/node") )); + $output .= "
The Body
The main text that comprises your content.
"; + $output .= "
A Type
What kind of node is this? Blog, book, forum, comment, unextended, etc.
"; + $output .= "
An Author
The author's name. It will either be \"anonymous\" or a valid user. You cannot set it to an arbitrary value.
"; + $output .= "
Authored on
The date the node was written.
"; + $output .= "
Changed
The last time this node was changed.
"; + $output .= strtr("
Static on front page
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.
",array("%teaser" => l(t("click here"),"admin/system/modules/node") )); + $output .= "
Allow user comments
A node can have comments. These comments can be written by other users (Read-write), or only by admins (Read-only).
"; + $output .= "
Attributes
A way to sort nodes.
"; + $output .= "
Revisions
Drupal has a revision system so that you can \"roll back\" to an older version of a node if the new version is not what you want.
"; + $output .= "
Promote to front page
To get people to look at the new stuff on your site you can choose to move it to the front page.
"; + $output .= "
In moderation queue
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.
"; + $output .= strtr("
Votes
If you are moderating a node this counts how many votes the node has gotten. Once a node gets a certain number of vote if will either be Approved, or Dropped (To setup the number of votes needed and the promote and dump scores %queue.).
",array("%queue" => l(t("click here"), "admin/system/modules/queue") )); + $output .= "
Score
The score of the node is gotten by the votes it is given.
"; + $output .= "
Users
The list of users who have voted on a moderated node.
"; + $output .= "
Published
When using Drupal's moderation system a node remains unpublished -- unavaliable to non-moderators -- until it is marked Published.
"; + $output .= "

Now that you know what is in a node, here are some of the types of nodes available.

"; + + if ($mod == "admin") { + foreach (module_list() as $name) { + if (module_hook($name, "node") && $name != "node") { + $output .= "

". t("Node type: %module", array("%module" => module_invoke($name, "node", "name"))). "

"; + $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).
Clicking a title views that node, while clicking an author's name edits their user information.
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 *.
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.
comment: Read/write setting for comments.
publish: Is this node publicly viewable, has it been published?
promote: Is this node to be promoted to the front page?
moderate: Does this node need approval before it can be viewed?
static: Is this node always visible on the front page?
revision: 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 @@ the rest of this posting."), "class" => "read-more")); } 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") .").
Clicking a title views that node, while clicking an author's name edits their user information.
Other node-related tasks are available from the menu on the left."); - $help["post-overview"] = t("Click on new or updated posts to see your latest nodes, or approval queue 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 edit node and then change its moderation status to approved.
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 *.
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.
comment: Read/write setting for comments.
publish: Is this node publicly viewable, has it been published?
promote: Is this node to be promoted to the front page?
moderate: Does this node need approval before it can be viewed?
static: Is this node always visible on the front page?
revision: 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; -- cgit v1.2.3