You are here

function entityconnect_eck_entityconnect_child_form_alter in Entity connect 7.2

Implements hook_entityconnect_child_form_alter().

File

modules/entityconnect_eck/entityconnect_eck.module, line 89

Code

function entityconnect_eck_entityconnect_child_form_alter(&$datas) {
  $form =& $datas['form'];
  $form_id = $datas['form_id'];
  if (isset($form['#entity_type']) && isset($form['#bundle'])) {

    // Add support for ECK.
    if ('eck__entity__form_add_' . $form['#entity_type'] . '_' . $form['#bundle'] == $form_id || 'eck__entity__form_edit_' . $form['#entity_type'] . '_' . $form['#bundle'] == $form_id) {
      $form['actions']['cancel']['#weight'] = 10001;
      $form['actions']['submit']['#submit'][] = 'eck__entity__form_submit';

      // @todo I think we don't need #submit any more..?
      $form['#submit'] = array();
    }
  }
}