You are here

function theme_uc_payment_method_table in Ubercart 6.2

Same name and namespace in other branches
  1. 5 payment/uc_payment/uc_payment.module \theme_uc_payment_method_table()
  2. 7.3 payment/uc_payment/uc_payment.admin.inc \theme_uc_payment_method_table()

Themes the table that displays available payment methods.

See also

uc_payment_methods_form()

1 theme call to theme_uc_payment_method_table()
uc_payment_methods_form in payment/uc_payment/uc_payment.admin.inc
Displays an overview of the available payment methods.

File

payment/uc_payment/uc_payment.admin.inc, line 156
Payment administration menu items.

Code

function theme_uc_payment_method_table($form) {
  drupal_add_tabledrag('uc-payment-methods', 'order', 'sibling', 'uc-payment-method-weight');
  $header = array(
    t('Payment method'),
    t('List position'),
    t('Default gateway'),
  );
  $rows = array();
  foreach (element_children($form) as $method) {
    $row = array(
      drupal_render($form[$method]['uc_payment_method_' . $method . '_checkout']),
      drupal_render($form[$method]['uc_payment_method_' . $method . '_weight']),
      drupal_render($form[$method]['uc_payment_' . $method . '_gateway']),
    );
    $rows[] = array(
      'data' => $row,
      'class' => 'draggable',
    );
  }
  return theme('table', $header, $rows, array(
    'id' => 'uc-payment-methods',
  ));
}