You are here

function sms_track_settings_form in SMS Framework 7

Same name and namespace in other branches
  1. 6.2 modules/sms_track/sms_track.admin.inc \sms_track_settings_form()
  2. 6 modules/sms_track/sms_track.admin.inc \sms_track_settings_form()

Admin settings form.

Form builder for sms_track settings form.

Return value

Drupal form array.

See also

sms_track_settings_form_submit()

1 string reference to 'sms_track_settings_form'
sms_track_menu in modules/sms_track/sms_track.module
Implements hook_menu().

File

modules/sms_track/sms_track.admin.inc, line 22
Message tracking module: Admin settings form functions.

Code

function sms_track_settings_form() {

  // Archive section.
  $form['archive'] = array(
    '#type' => 'fieldset',
    '#title' => 'Message archiving',
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['archive']['archive_dir'] = array(
    '#type' => 'select',
    '#title' => 'Archive mode',
    '#default_value' => variable_get('sms_track_archive_dir', SMS_DIR_NONE),
    '#options' => array(
      SMS_DIR_NONE => 'No archiving [default]',
      SMS_DIR_OUT => 'Record outgoing messages only',
      SMS_DIR_IN => 'Record incoming messages only',
      SMS_DIR_ALL => 'Record both outgoing and incoming messages',
    ),
    '#description' => t('Note that this will revert to the default option when the SMS Tracking module is disabled.'),
  );
  $form['archive']['archive_max_age_days'] = array(
    '#type' => 'textfield',
    '#title' => 'Purge messages after n days',
    '#size' => 3,
    '#maxlength' => 3,
    '#default_value' => variable_get('sms_track_archive_max_age_days', 0),
    '#description' => 'Set to 0 (zero) to disable archive purge. This will only work if you have cron configured correctly.',
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}