You are here

function _noderelationships_parent_node_form_scanner in Node Relationships 6

Form pre-render callback for parent node.

1 call to _noderelationships_parent_node_form_scanner()
_noderelationships_parent_node_form_scanner_proxy in ./noderelationships.module
Proxy function to invoke node form after_build and pre_render callbacks, because the file where the real handler is implemented might not be included yet when the form is processed and invokes the callback.

File

./noderelationships.pages.inc, line 631
Implementation of user land pages.

Code

function _noderelationships_parent_node_form_scanner($form) {
  static $processed;
  $field_settings =& $form['#noderelationships'];
  if (!isset($processed)) {
    $processed = TRUE;

    // Enable the Modal Frame API for the parent window.
    modalframe_parent_js();

    // Send javascript and stylesheets to the page.
    $module_path = drupal_get_path('module', 'noderelationships');
    drupal_add_css($module_path . '/css/noderelationships.node_form.css');
    drupal_add_js($module_path . '/js/node_form.js');
    $js_settings = array(
      'fieldSettings' => $field_settings,
      'viewUrl' => url('node/nid'),
      'editUrl' => url('node/nid/edit'),
    );
    drupal_add_js(array(
      'nodeRelationships' => $js_settings,
    ), 'setting');
  }

  // Scan the form recursively to append CSS classes to node reference fields.
  _noderelationships_parent_node_form_scanner_recursive($form, $field_settings);
  return $form;
}