summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2011-11-23 09:31:39 (GMT)
committer Gábor Hojtsy2011-11-23 09:31:39 (GMT)
commit815227745a4659a1212c95a861a8275928de6523 (patch)
tree71c65dcf3bc796d3d1b8b54ec365ac38a8073fe7
parentcd674840b2e977bd58e3d3464a7600f8fa2c7ed5 (diff)
Issue #338402 by rocket_nova, jhodgdon: improve documentation on node_get_types()
-rw-r--r--modules/node/node.module25
1 files changed, 16 insertions, 9 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 299dfc1..0de03ff 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -397,23 +397,30 @@ function node_teaser($body, $format = NULL, $size = NULL) {
}
/**
- * Builds a list of available node types, and returns all of part of this list
- * in the specified format.
+ * Builds a list of available node types, and returns all or part of this list.
*
* @param $op
- * The format in which to return the list. When this is set to 'type',
- * 'module', or 'name', only the specified node type is returned. When set to
- * 'types' or 'names', all node types are returned.
+ * The format in which to return the list: 'type', 'types', 'module', 'name',
+ * or 'names'. See return value section below for details.
* @param $node
- * A node object, array, or string that indicates the node type to return.
- * Leave at default value (NULL) to return a list of all node types.
+ * A node object, an array representation of a node object, or a node type
+ * name string. See return value section below for details.
* @param $reset
* Whether or not to reset this function's internal cache (defaults to
* FALSE).
*
* @return
- * Either an array of all available node types, or a single node type, in a
- * variable format. Returns FALSE if the node type is not found.
+ * If $node is supplied and it doesn't correspond to a known node type,
+ * or if $op is 'type', 'name', or 'module' and $node is not given, the
+ * function returns FALSE. Otherwise, the return value depends on the
+ * value of $op:
+ * - 'types': An array of all available node type objects, keyed by machine
+ * name.
+ * - 'type': The single node type object indicated by $node.
+ * - 'names': An array of the display names of all available node types,
+ * keyed by machine name and sorted by display name.
+ * - 'name': The single node type display name indicated by $node.
+ * - 'module': The name of the node type module indicated by $node.
*/
function node_get_types($op = 'types', $node = NULL, $reset = FALSE) {
static $_node_types, $_node_names;