You are here

function uc_store_display_settings_form in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_store/uc_store.module \uc_store_display_settings_form()

Settings for how miscellaneous store components are displayed.

1 string reference to 'uc_store_display_settings_form'
uc_store_menu in uc_store/uc_store.module
Implements hook_menu().

File

uc_store/uc_store.admin.inc, line 679
Store administration menu items.

Code

function uc_store_display_settings_form() {
  $display_options = array(
    1 => t('Dashboard with collapsed submenu links'),
    2 => t('Dashboard with expanded submenu links'),
    3 => t('Dashboard with no submenu links'),
    4 => t('Normal Drupal submenu listing'),
  );
  $form['uc_store_admin_page_display'] = array(
    '#type' => 'radios',
    '#title' => t('Display type for the main store administration page'),
    '#description' => t('Some options are better suited for different themes, so feel free to try them all out!'),
    '#options' => $display_options,
    '#summary' => t('Store admin page is displaying: <br />@display', array(
      '@display' => $display_options[variable_get('uc_store_admin_page_display', 1)],
    )),
    '#default_value' => variable_get('uc_store_admin_page_display', 1),
  );
  $address_options = array(
    'billing' => t('Billing address'),
    'shipping' => t('Shipping address'),
  );
  $desc = t('Select the address to be used on customer lists and summaries.');
  $form['uc_customer_list_address'] = array(
    '#type' => 'radios',
    '#title' => t('Primary customer address'),
    '#description' => $desc,
    '#options' => $address_options,
    '#summary' => t("Customer's %billing is being used in lists.", array(
      '%billing' => $address_options[variable_get('uc_customer_list_address', 'billing')],
    )),
    '#default_value' => variable_get('uc_customer_list_address', 'billing'),
  );
  $options = array_merge(array(
    t('Randomly select a message from the list below.'),
  ), _store_footer_options());

  // format the message nicely for the user
  switch (variable_get('uc_footer_message', 0)) {
    case 'none':
      $user_footer = 'no message.';
      break;
    case 0:
      $user_footer = 'a random message.';
      break;
    default:
      $user_footer = '"' . $options[variable_get('uc_footer_message', 0)] . '"';
      break;
  }
  $form['uc_footer_message'] = array(
    '#type' => 'radios',
    '#title' => t('Footer message for store pages'),
    '#options' => $options,
    '#summary' => t('Footer using !footer', array(
      '!footer' => $user_footer,
    )),
    '#default_value' => variable_get('uc_footer_message', 0),
  );
  return system_settings_form($form);
}