You are here

function format_number_settings_user in Format Number API 6

User settings form.

Parameters

array $edit: The array of form values submitted by the user.

Return value

array A $form array containing the form elements to display.

1 call to format_number_settings_user()
format_number_user in ./format_number.module
Implementation of hook_user().

File

./format_number.settings.inc, line 55
Implement module settings and user settings forms.

Code

function format_number_settings_user(&$edit) {
  $form = array();
  $form['format_number'] = array(
    '#type' => 'fieldset',
    '#title' => t('Number format settings'),
    '#weight' => 7,
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['format_number']['decimal_point'] = array(
    '#type' => 'radios',
    '#title' => t('Decimal point'),
    '#options' => format_number_get_decimal_point_options(),
    '#default_value' => drupal_strlen($edit['decimal_point']) ? $edit['decimal_point'] : variable_get('format_number_decimal_point', '.'),
    '#description' => t('Select the character that will be used as decimal point.'),
  );
  $form['format_number']['thousands_sep'] = array(
    '#type' => 'radios',
    '#title' => t('Thousands separator'),
    '#options' => format_number_get_thousands_separator_options(),
    '#default_value' => drupal_strlen($edit['thousands_sep']) ? $edit['thousands_sep'] : variable_get('format_number_thousands_sep', ','),
    '#description' => t('Select the character that will be used as thousands separator.'),
  );
  return $form;
}