function uc_store_format_settings_form in Ubercart 5
Same name and namespace in other branches
- 6.2 uc_store/uc_store.admin.inc \uc_store_format_settings_form()
1 string reference to 'uc_store_format_settings_form'
- uc_store_menu in uc_store/
uc_store.module - Implementation of hook_menu().
File
- uc_store/
uc_store.module, line 1452 - Contains global Ubercart functions and store administration functionality.
Code
function uc_store_format_settings_form() {
$form['currency'] = array(
'#type' => 'fieldset',
'#title' => t('Currency format'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['currency']['uc_currency_code'] = array(
'#type' => 'textfield',
'#title' => t('Default currency'),
'#description' => t('While not used directly in formatting, the currency code is used by other modules as the primary currency for your site. Enter here your three character <a href="!url">ISO 4217</a> currency code.', array(
'!url' => 'http://en.wikipedia.org/wiki/ISO_4217#Active_codes',
)),
'#default_value' => variable_get('uc_currency_code', 'USD'),
'#maxlength' => 3,
'#size' => 5,
);
$form['currency']['example'] = array(
'#type' => 'textfield',
'#title' => t('Current format'),
'#value' => uc_currency_format(1000.1234),
'#disabled' => TRUE,
'#size' => 10,
);
$form['currency']['uc_currency_sign'] = uc_textfield(t('Currency Sign'), variable_get('uc_currency_sign', '$'), FALSE, NULL, 10, 10);
$form['currency']['uc_sign_after_amount'] = array(
'#type' => 'checkbox',
'#title' => t('Display currency sign after amount.'),
'#default_value' => variable_get('uc_sign_after_amount', FALSE),
);
$form['currency']['uc_currency_thou'] = uc_textfield(t('Thousands Marker'), variable_get('uc_currency_thou', ','), FALSE, NULL, 10, 10);
$form['currency']['uc_currency_dec'] = uc_textfield(t('Decimal Marker'), variable_get('uc_currency_dec', '.'), FALSE, NULL, 10, 10);
$form['currency']['uc_currency_prec'] = array(
'#type' => 'select',
'#title' => t('Number of decimal places'),
'#options' => drupal_map_assoc(array(
0,
1,
2,
)),
'#default_value' => variable_get('uc_currency_prec', 2),
);
$form['weight'] = array(
'#type' => 'fieldset',
'#title' => t('Weight format'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['weight']['instructions'] = array(
'#value' => '<div>' . t('Supply a format string for each unit. !value represents the weight value.') . '</div>',
);
$units = array(
'lb' => t('Pounds'),
'oz' => t('Ounces'),
'kg' => t('Kilograms'),
'g' => t('Grams'),
);
$form['weight']['uc_weight_unit'] = array(
'#type' => 'select',
'#title' => t('Default unit of measurement'),
'#default_value' => variable_get('uc_weight_unit', 'lb'),
'#options' => $units,
);
foreach ($units as $unit => $name) {
$form['weight']['uc_weight_format_' . $unit] = array(
'#type' => 'textfield',
'#title' => t('@unit format string', array(
'@unit' => $name,
)),
'#default_value' => variable_get('uc_weight_format_' . $unit, '!value ' . $unit),
);
}
$form['length'] = array(
'#type' => 'fieldset',
'#title' => t('Length format'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['length']['instructions'] = array(
'#value' => '<div>' . t('Supply a format string for each unit. !value represents the weight value.') . '</div>',
);
$units = array(
'in' => t('Inches'),
'ft' => t('Feet'),
'cm' => t('Centimeters'),
'mm' => t('Millimeters'),
);
$form['length']['uc_length_unit'] = array(
'#type' => 'select',
'#title' => t('Default unit of measurement'),
'#default_value' => variable_get('uc_length_unit', 'in'),
'#options' => $units,
);
foreach ($units as $unit => $name) {
$form['length']['uc_length_format_' . $unit] = array(
'#type' => 'textfield',
'#title' => t('@unit format string', array(
'@unit' => $name,
)),
'#default_value' => variable_get('uc_store_length_format_' . $unit, '!value ' . $unit),
);
}
$form['date'] = array(
'#type' => 'fieldset',
'#title' => t('Date format'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['date']['instructions'] = array(
'#value' => '<div>' . t('Supply a format string using !link syntax.', array(
'!link' => l(t('PHP date'), 'http://www.php.net/date'),
)) . '</div>',
);
$form['date']['uc_date_format_default'] = array(
'#type' => 'textfield',
'#title' => t('Default format string'),
'#default_value' => variable_get('uc_date_format_default', 'm/d/Y'),
);
return system_settings_form($form);
}