You are here

function theme_uc_payment_method_table in Ubercart 7.3

Same name and namespace in other branches
  1. 5 payment/uc_payment/uc_payment.module \theme_uc_payment_method_table()
  2. 6.2 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 74
Payment administration menu items.

Code

function theme_uc_payment_method_table($variables) {
  $form = $variables['form'];
  drupal_add_tabledrag('uc-payment-methods', 'order', 'sibling', 'uc-payment-method-weight');
  $header = array(
    t('Payment method'),
    t('List position'),
    t('Operations'),
  );
  $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]['settings']),
    );
    $rows[] = array(
      'data' => $row,
      'class' => array(
        'draggable',
      ),
    );
  }
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'uc-payment-methods',
    ),
    'empty' => t('No payment methods are available. Modules providing payment methods must first be enabled on the !modules administration page under the "Ubercart - payment" fieldset.', array(
      '!modules' => l(t('Modules'), 'admin/modules'),
    )),
  ));
}