Skip navigation
Help

theme_uc_payment_method_table

6 uc_payment.admin.inc theme_uc_payment_method_table($form)
7 uc_payment.admin.inc theme_uc_payment_method_table($variables)

Themes the table that displays available payment methods.

See also

uc_payment_methods_form()

Related topics

File

ubercart/payment/uc_payment/uc_payment.admin.inc, line 75
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'))),
  ));
}