1 contact.module contact_form_user_admin_settings_alter(&$form, &$form_state)

Implements hook_form_FORM_ID_alter().

Add the default personal contact setting on the user settings page.

See also

user_admin_settings()

File

core/modules/contact/contact.module, line 338
Enables the use of personal and site-wide contact forms.

Code

function contact_form_user_admin_settings_alter(&$form, &$form_state) {
  $config = config('contact.settings');

  $form['contact'] = array(
    '#type' => 'fieldset',
    '#title' => t('Contact settings'),
    '#weight' => 0,
    '#config' => 'contact.settings',
  );
  $form['contact']['contact_default_status'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable the personal contact form by default for new users.'),
    '#description' => t('Changing this setting will not affect existing users.'),
    '#default_value' => $config->get('contact_default_status'),
  );
}