You are here

function mass_contact_admin_settings_body in Mass Contact 6

Same name and namespace in other branches
  1. 7 mass_contact.admin.inc \mass_contact_admin_settings_body()

Message body administration settings form.

Parameters

form_state: A keyed array containing the current state of the form.

Return value

An associative array that defines the form to be built.

1 string reference to 'mass_contact_admin_settings_body'
mass_contact_menu in ./mass_contact.module
Implementation of hook_menu().

File

./mass_contact.module, line 901
This is the main code file for the Mass Contact module. This module enables users to contact multiple users through selected roles.

Code

function mass_contact_admin_settings_body($form_state) {

  ////////////////////////////////////////////////////////////

  // Supplemental texts that are prepended and/or appended to every message.
  $form['mass_contact_supplemental_texts'] = array(
    '#type' => 'fieldset',
    '#title' => t('Supplemental message body texts'),
    '#description' => t('You may specify additional text to insert before and/or after the message text of every mass e-mail that is sent.'),
  );
  if (module_exists('token')) {
    $form['mass_contact_supplemental_texts']['mass_contact_message_prefix']['mass_contact_message_prefix'] = array(
      '#type' => 'textarea',
      '#title' => t('Text to be prepended to all messages'),
      '#default_value' => variable_get('mass_contact_message_prefix', t('[user-name] has sent you a group e-mail from [site-name].')),
      '#description' => t('The text you specify above will be added to all e-mails sent out. The text will be placed before the message text entered in by the sender.'),
    );
    $form['mass_contact_supplemental_texts']['mass_contact_message_prefix']['format'] = filter_form(variable_get('mass_contact_prefix_format', FILTER_FORMAT_DEFAULT), NULL, array(
      'mass_contact_prefix_format',
    ));
    $form['mass_contact_supplemental_texts']['mass_contact_message_suffix']['mass_contact_message_suffix'] = array(
      '#type' => 'textarea',
      '#title' => t('Text to be appended to all messages'),
      '#default_value' => variable_get('mass_contact_message_suffix', t('')),
      '#description' => t('The text you specify above will be added to all e-mails sent out. The text will be placed after the message text entered in by the sender.'),
    );
    $form['mass_contact_supplemental_texts']['mass_contact_message_suffix']['format'] = filter_form(variable_get('mass_contact_suffix_format', FILTER_FORMAT_DEFAULT), NULL, array(
      'mass_contact_suffix_format',
    ));
    $form['mass_contact_supplemental_texts']['mass_contact_replacement_tokens'] = array(
      '#type' => 'fieldset',
      '#title' => t('Replacement tokens'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#description' => t('You may use any of the following replacements tokens for use in the prefix and/or suffix texts above.'),
    );
    $form['mass_contact_supplemental_texts']['mass_contact_replacement_tokens']['token_help'] = array(
      '#value' => theme('token_help', 'global'),
    );
  }
  else {
    $form['mass_contact_supplemental_texts']['mass_contact_message_prefix'] = array(
      '#type' => 'textarea',
      '#title' => t('Text to be prepended to all messages'),
      '#default_value' => variable_get('mass_contact_message_prefix', t('You were sent a group e-mail from !site.', array(
        '!site' => url(NULL, array(
          'absolute' => TRUE,
        )),
      ))),
      '#description' => t('The text you specify above will be added to all e-mails sent out. The text will be placed before the message text entered in by the sender.'),
    );
    $form['mass_contact_supplemental_texts']['mass_contact_prefix_format'] = filter_form(variable_get('mass_contact_prefix_format', FILTER_FORMAT_DEFAULT), NULL, array(
      'mass_contact_prefix_format',
    ));
    $form['mass_contact_supplemental_texts']['mass_contact_message_suffix'] = array(
      '#type' => 'textarea',
      '#title' => t('Text to be appended to all messages'),
      '#default_value' => variable_get('mass_contact_message_suffix', t('')),
      '#description' => t('The text you specify above will be added to all e-mails sent out. The text will be placed after the message text entered in by the sender.'),
    );
    $form['mass_contact_supplemental_texts']['mass_contact_suffix_format'] = filter_form(variable_get('mass_contact_suffix_format', FILTER_FORMAT_DEFAULT), NULL, array(
      'mass_contact_suffix_format',
    ));
  }

  ////////////////////////////////////////////////////////////

  // HTML options.
  $form['mass_contact_html_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('HTML Settings'),
  );
  $form['mass_contact_html_settings']['mass_contact_html_d'] = array(
    '#type' => 'checkbox',
    '#title' => t('Send as HTML by default.'),
    '#default_value' => variable_get('mass_contact_html_d', 1),
  );
  $form['mass_contact_html_settings']['mass_contact_html_d_override'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow sender to override HTML setting.'),
    '#default_value' => variable_get('mass_contact_html_d_override', 1),
  );
  $form['mass_contact_html_settings']['mass_contact_html_format'] = filter_form(variable_get('mass_contact_html_format', FILTER_FORMAT_DEFAULT), NULL, array(
    'mass_contact_html_format',
  ));
  $form['mass_contact_html_settings']['mass_contact_html_format_override'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow sender to override input filter setting.'),
    '#default_value' => variable_get('mass_contact_html_format_override', 0),
  );
  $form['mass_contact_html_settings']['mass_contact_check_markup'] = array(
    '#type' => 'checkbox',
    '#title' => t('Check HTML markup.'),
    '#default_value' => variable_get('mass_contact_check_markup', 1),
    '#description' => t('Runs the body text through an HTML markup checker. Disabling this is not recommeneded, however, if your messages are not coming through as they should, this may fix it.'),
  );

  ////////////////////////////////////////////////////////////

  // Attachment options.
  $form['mass_contact_number_of_attachments'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of attachments'),
    '#default_value' => variable_get('mass_contact_number_of_attachments', '3'),
    '#size' => 10,
    '#description' => t("The number of attachments to allow on the contact form. The maximum number of allowed uploads may be limited by PHP. If necessary, check your system's PHP php.ini file for a max_file_uploads directive to change."),
  );
  $form['mass_contact_attachment_location'] = array(
    '#type' => 'textfield',
    '#title' => t('Attachment location'),
    '#default_value' => variable_get('mass_contact_attachment_location', file_directory_path() . '/mass_contact_attachments'),
    '#description' => t('If a copy of the message is saved as a node, this is the file path where to save the attachment so it can be viewed later.'),
  );
  return system_settings_form($form);
}