You are here

function uc_cart_checkout_panes_form in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_cart/uc_cart.module \uc_cart_checkout_panes_form()

Settings for panes on the checkout page.

1 string reference to 'uc_cart_checkout_panes_form'
uc_cart_menu in uc_cart/uc_cart.module
Implements hook_menu().

File

uc_cart/uc_cart.admin.inc, line 416
Cart administration menu items.

Code

function uc_cart_checkout_panes_form() {
  $panes = _checkout_pane_list();
  $form['panes'] = array(
    '#theme' => 'uc_pane_sort_table',
    '#pane_prefix' => 'uc_pane',
    '#summary callback' => '_uc_cart_panes_summarize',
    '#summary arguments' => array(
      $panes,
    ),
    '#draggable' => 'uc-checkout-pane-weight',
  );
  foreach ($panes as $pane) {
    $form['panes'][$pane['id']]['uc_pane_' . $pane['id'] . '_enabled'] = array(
      '#type' => 'checkbox',
      '#title' => $pane['title'],
      '#default_value' => variable_get('uc_pane_' . $pane['id'] . '_enabled', TRUE),
    );
    $form['panes'][$pane['id']]['uc_pane_' . $pane['id'] . '_weight'] = array(
      '#type' => 'weight',
      '#default_value' => variable_get('uc_pane_' . $pane['id'] . '_weight', $pane['weight']),
      '#attributes' => array(
        'class' => 'uc-checkout-pane-weight',
      ),
    );
    $form['panes'][$pane['id']]['#weight'] = variable_get('uc_pane_' . $pane['id'] . '_weight', $pane['weight']);
    $null = NULL;
    $pane_settings = $pane['callback']('settings', $null, NULL);
    if (is_array($pane_settings)) {
      $form['pane_' . $pane['id']] = array(
        '#type' => 'fieldset',
        '#summary callback' => 'summarize_null',
        '#title' => t('!pane settings', array(
          '!pane' => $pane['title'],
        )),
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
      );
      $form['pane_' . $pane['id']] = array_merge($form['pane_' . $pane['id']], $pane_settings);
    }
  }
  return system_settings_form($form);
}