You are here

function _crm_core_data_import_attach_elements_add_more_button in CRM Core 7

Attach add more button to entity bundle fieldset.

Parameters

array $form: Main form.

array $form_state: Main form state.

string $key: Key of fieldset.

string $html_id: HTML id for fieldset wrapper.

1 call to _crm_core_data_import_attach_elements_add_more_button()
_crm_core_data_import_attach_fields_form in modules/crm_core_data_import/crm_core_data_import.admin.inc
Entity fields and bundles.

File

modules/crm_core_data_import/crm_core_data_import.admin.inc, line 878
Configuration pages for CRM Core Data Import.

Code

function _crm_core_data_import_attach_elements_add_more_button(&$form, &$form_state, $key, $html_id) {
  $form['mapping'][$key]['add_more'] = array(
    '#type' => 'button',
    '#default_value' => t('Add Another Field'),
    '#name' => $html_id . '-button',
    '#ajax' => array(
      'callback' => '_crm_core_data_import_add_another_field_callback',
      'method' => 'replace',
      'wrapper' => $html_id . '-wrapper',
    ),
  );
}