You are here

function nodehierarchy_node_can_be_child_of in Node Hierarchy 7.4

Same name and namespace in other branches
  1. 5 nodehierarchy.module \nodehierarchy_node_can_be_child_of()
  2. 6.3 nodehierarchy.module \nodehierarchy_node_can_be_child_of()
  3. 6 nodehierarchy.module \nodehierarchy_node_can_be_child_of()
  4. 6.2 nodehierarchy.module \nodehierarchy_node_can_be_child_of()
  5. 7.2 nodehierarchy.module \nodehierarchy_node_can_be_child_of()

Determine if a given node can be a child of another given node.

Parameters

$parent: The potentential parent node (can be null for any node).

$child: The potential child node (can be null for any node).

Return value

Boolean. Whether second node can be a child of the first.

File

./nodehierarchy.admin.inc, line 726
Admin functions for Node Hierarchy

Code

function nodehierarchy_node_can_be_child_of($parent = NULL, $child = NULL) {
  return in_array($child->type, nodehierarchy_get_allowed_child_types($parent->type));
}