You are here

function nodeconnect_child_node_form_alter in Node Connect 7

Alters are child create form.

We add a value field to hold the parent build_cache_id and then we add a cancel button that run nodeconnect_child_form_cancel and we add a new submit nodeconect_child_form_submit

1 call to nodeconnect_child_node_form_alter()
nodeconnect_form_node_form_alter in ./nodeconnect.module
Implements hook_form_node_form_alter()

File

./nodeconnect.form.inc, line 102
handles all form alters and submit functions for nodeconnect

Code

function nodeconnect_child_node_form_alter(&$form, &$form_state, $form_id, $cache_id, $cache) {
  $form['parent_build_cache_id'] = array(
    '#type' => 'value',
    '#value' => $cache_id,
  );
  $form['actions']['cancel'] = array(
    '#type' => 'submit',
    '#value' => t('Cancel'),
    '#submit' => array(
      'nodeconnect_include_form',
      'nodeconnect_child_form_cancel',
    ),
    '#parent_build_cache_id' => $cache_id,
    '#limit_validation_errors' => array(),
    '#weight' => 20,
  );
  $form['actions']['submit']['#submit'][] = 'nodeconnect_include_form';
  $form['actions']['submit']['#submit'][] = 'nodeconnect_child_form_submit';
}