function webform_civicrm_form_alter in Webform CiviCRM Integration 7.3
Same name and namespace in other branches
- 8.5 webform_civicrm.module \webform_civicrm_form_alter()
- 6.2 webform_civicrm.module \webform_civicrm_form_alter()
- 6 webform_civicrm.module \webform_civicrm_form_alter()
- 7.5 webform_civicrm.module \webform_civicrm_form_alter()
- 7 webform_civicrm.module \webform_civicrm_form_alter()
- 7.2 webform_civicrm.module \webform_civicrm_form_alter()
- 7.4 webform_civicrm.module \webform_civicrm_form_alter()
Implements hook_form_alter().
File
- ./
webform_civicrm.module, line 58 - 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' && substr($form['form_key']['#default_value'], 0, 7) == 'civicrm') {
module_load_include('inc', 'webform_civicrm', 'webform_civicrm_admin');
_wf_crm_component_form_alter($form, $form_state);
}
elseif (strpos($form_id, 'webform_client_form_') !== FALSE && !empty($form['#node']->webform_civicrm)) {
module_load_include('inc', 'webform_civicrm', 'webform_civicrm_forms');
_wf_crm_frontend_form_alter($form, $form_state);
}
elseif ($form_id == 'webform_components_form') {
$form['#theme'] = array(
'webform_civicrm_components_form',
);
}
}