You are here

function noderelationships_get_reference_fields in Node Relationships 6

Get the list of node reference fields for the given type.

3 calls to noderelationships_get_reference_fields()
noderelationships_admin_settings_noderef in ./noderelationships.admin.inc
Node reference extras form.
noderelationships_noderef_page_create in ./noderelationships.pages.inc
Build the create and reference page.
_noderelationships_parent_node_form_alter in ./noderelationships.pages.inc
Alter parent node form to attach extra buttons to node reference fields.

File

./noderelationships.inc, line 302
Common functions for the noderelationships module.

Code

function noderelationships_get_reference_fields($nodetype, $reset = FALSE) {
  static $reference_fields;
  if (!isset($reference_fields)) {
    $reference_fields = array();
  }
  if (!isset($reference_fields[$nodetype]) || $reset) {
    $reference_fields[$nodetype] = array();
    foreach (noderelationships_get_nodereferences($reset) as $field_name => $info) {
      if (isset($info[$nodetype])) {
        $reference_fields[$nodetype][$field_name] = $info[$nodetype];
      }
    }
    ksort($reference_fields[$nodetype]);
  }
  return $reference_fields[$nodetype];
}