You are here

function webform_civicrm_form_alter in Webform CiviCRM Integration 6

Same name and namespace in other branches
  1. 8.5 webform_civicrm.module \webform_civicrm_form_alter()
  2. 6.2 webform_civicrm.module \webform_civicrm_form_alter()
  3. 7.5 webform_civicrm.module \webform_civicrm_form_alter()
  4. 7 webform_civicrm.module \webform_civicrm_form_alter()
  5. 7.2 webform_civicrm.module \webform_civicrm_form_alter()
  6. 7.3 webform_civicrm.module \webform_civicrm_form_alter()
  7. 7.4 webform_civicrm.module \webform_civicrm_form_alter()

Implementation of hook_form_alter().

File

./webform_civicrm.module, line 41
Webform CiviCRM Integration Module: Links webform submissions to contacts in a CiviCRM database. @author Coleman Watts

Code

function webform_civicrm_form_alter(&$form, $form_state, $form_id) {

  // Alter back-end webform component edit forms
  if ($form_id == 'webform_component_edit_form') {
    require_once 'webform_civicrm_forms.inc';
    _webform_civicrm_webform_component_form_alter($form);
  }
  elseif (strpos($form_id, 'webform_client_form_') !== FALSE) {
    if (!empty($form['#node']->webform_civicrm) && arg(2) != 'done' && arg(2) != 'webform') {
      require_once 'webform_civicrm_forms.inc';
      _webform_civicrm_webform_frontend_form_alter($form);
    }
  }
}