You are here

function party_settings_primary_fields_form in Party 8.2

Settings form for choosing where primary fields are pulled from.

1 string reference to 'party_settings_primary_fields_form'
party_menu in ./party.module
Implements hook_menu().

File

./party.admin.inc, line 198
Admin page callback file for the party module.

Code

function party_settings_primary_fields_form($form, &$form_state) {
  $primary_fields = variable_get('party_primary_fields', array());
  $form['intro'] = array(
    '#markup' => t('Primary fields allow you to store key information quickly and accessibly for use in bulk and automated operations. For each type, select where you want to pull this information from.'),
  );
  $form['email'] = array(
    '#title' => t('Email'),
    '#description' => t('The primary email used for things like bulk operations and mailing lists.'),
    '#type' => 'select',
    '#options' => party_find_fields_of_types('varchar'),
    '#default_value' => isset($primary_fields['email']) ? $primary_fields['email'] : NULL,
  );
  array_unshift($form['email']['#options'], t('- No primary email -'));
  $form['email2'] = array(
    '#title' => t('Email 2'),
    '#description' => t('A fallback for the primary email used for things like bulk operations and mailing lists.'),
    '#type' => 'select',
    '#options' => party_find_fields_of_types('varchar'),
    '#default_value' => isset($primary_fields['email2']) ? $primary_fields['email2'] : NULL,
  );
  array_unshift($form['email']['#options'], t('- No primary email -'));
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}