You are here

function uc_ajax_admin_form in Ubercart 7.3

Administration form for uc_ajax.

Parameters

$target_form: The form for which ajax behaviors are to be administered. Currently only 'checkout' is supported.

1 string reference to 'uc_ajax_admin_form'
uc_ajax_admin_menu in uc_ajax_admin/uc_ajax_admin.module
Implements hook_menu().

File

uc_ajax_admin/uc_ajax_admin.module, line 43
Configures Ajax behaviours on the Ubercart checkout page.

Code

function uc_ajax_admin_form($form, &$form_state, $target_form = 'checkout') {
  module_load_include('inc', 'uc_store', 'includes/uc_ajax_attach');
  switch ($target_form) {
    case 'checkout':
      $triggers = _uc_ajax_admin_checkout_trigger_options(_uc_ajax_admin_build_checkout_form());
      $panes = _uc_checkout_pane_list();
      $wrappers = array();
      foreach ($panes as $id => $pane) {
        $wrappers["{$id}-pane"] = _uc_checkout_pane_data($id, 'title');
      }
      break;
    default:
      drupal_not_found();
  }
  $form['#uc_ajax_target'] = $target_form;
  $form['#uc_ajax_config'] = variable_get('uc_ajax_' . $target_form, _uc_ajax_defaults($target_form));
  $form['table'] = tapir_get_table('uc_ajax_admin_table', $triggers, $wrappers, $form['#uc_ajax_config']);
  $form['actions'] = array(
    '#type' => 'actions',
    'submit' => array(
      '#type' => 'submit',
      '#value' => t('Submit'),
    ),
  );
  return $form;
}