You are here

function wf_crm_change_widget in Webform CiviCRM Integration 7.3

Same name and namespace in other branches
  1. 7.5 includes/wf_crm_admin_component.inc \wf_crm_change_widget()
  2. 7.4 includes/wf_crm_admin_component.inc \wf_crm_change_widget()

Drupal FAPI form submit callback Alter a webform component type.

1 string reference to 'wf_crm_change_widget'
_wf_crm_component_form_alter in ./webform_civicrm_admin.inc
Alter back-end webform component edit forms. Called by hook_form_alter() whenever editing a webform component.

File

./webform_civicrm_admin.inc, line 1485

Code

function wf_crm_change_widget($form, &$form_state) {
  unset($_SESSION['messages']['status']);
  drupal_set_message(t('Click "Save component" to change this field to %type (or go back to cancel). Test your form to ensure that the new widget works with this CiviCRM field.', array(
    '%type' => $form['widget']['widget']['#options'][$form_state['values']['widget']['widget']],
  )));
  drupal_goto($_GET['q'], array(
    'query' => array(
      'type' => $form_state['values']['widget']['widget'],
    ),
  ));
}