function cs_node_load
2.x tripal_stock.module | cs_node_load($nid) |
3.x tripal_stock.module | cs_node_load($nid) |
1.x tripal_stock.module | cs_node_load($nid) |
Implements Menu wildcard_load hook
Allows the node ID of a chado stock to be dynamically pulled from the path. The node is loaded from this node ID and supplied to the page as an arguement. This is an example of dynamic argument replacement using wildcards in the path.
Parameters
$nid: The node ID passed in from the path
Return value
The node object with the passed in nid
Related topics
File
- tripal_stock/
tripal_stock.module, line 140 - Basic functionality for stocks
Code
function cs_node_load($nid) {
if (is_numeric($nid)) {
$node = node_load($nid);
if ($node->type == 'chado_stock') {
return $node;
}
}
return FALSE;
}