| 1 |
<?php
|
| 2 |
|
| 3 |
/*******************************************************************************
|
| 4 |
* Callback Functions, Forms, and Tables
|
| 5 |
******************************************************************************/
|
| 6 |
|
| 7 |
/**
|
| 8 |
* Display the addresses settings overview.
|
| 9 |
*/
|
| 10 |
function uc_addresses_settings_overview() {
|
| 11 |
$summaries = array();
|
| 12 |
$summaries = array_merge($summaries, summarize_child_form_pages('admin/store/settings/addresses/edit', FALSE, TRUE));
|
| 13 |
|
| 14 |
// Theme it all up in a summaries overview.
|
| 15 |
return theme('summary_overview', $summaries);
|
| 16 |
|
| 17 |
}
|
| 18 |
|
| 19 |
function uc_addresses_settings_form() {
|
| 20 |
$form['user'] = array(
|
| 21 |
'#type' => 'fieldset',
|
| 22 |
'#title' => t('User settings'),
|
| 23 |
'#summary callback' => 'summarize_form',
|
| 24 |
'#collapsible' => FALSE,
|
| 25 |
'#collapsed' => FALSE,
|
| 26 |
);
|
| 27 |
$form['user']['uc_addresses_default_billing_address'] = array(
|
| 28 |
'#type' => 'checkbox',
|
| 29 |
'#title' => t('Automatically fill in the billing address with the user\'s default address.'),
|
| 30 |
'#default_value' => variable_get('uc_addresses_default_billing_address', TRUE),
|
| 31 |
'#summary callback' => 'summarize_checkbox',
|
| 32 |
'#summary arguments' => array(
|
| 33 |
t('We will automatically fill in the delivery address with the user\'s default address.'),
|
| 34 |
t('The customer must enter or choose a delivery address.')),
|
| 35 |
);
|
| 36 |
$form['user']['uc_addresses_default_delivery_address'] = array(
|
| 37 |
'#type' => 'checkbox',
|
| 38 |
'#title' => t('Automatically fill in the delivery address with the user\'s default address.'),
|
| 39 |
'#default_value' => variable_get('uc_addresses_default_delivery_address', TRUE),
|
| 40 |
'#summary callback' => 'summarize_checkbox',
|
| 41 |
'#summary arguments' => array(
|
| 42 |
t('We will automatically fill in the billing address with the user\'s default address.'),
|
| 43 |
t('The customer must enter or choose a billing address.')),
|
| 44 |
);
|
| 45 |
$form['user']['uc_addresses_require_address'] = array(
|
| 46 |
'#type' => 'checkbox',
|
| 47 |
'#title' => t('Require that an address be entered during registration'),
|
| 48 |
'#default_value' => variable_get('uc_addresses_require_address', TRUE),
|
| 49 |
'#summary callback' => 'summarize_checkbox',
|
| 50 |
'#summary arguments' => array(
|
| 51 |
t('The customer must enter an address when registering'),
|
| 52 |
t('The customer does not enter an address when registering.')),
|
| 53 |
);
|
| 54 |
|
| 55 |
return system_settings_form($form);
|
| 56 |
}
|