You are here

function uc_payments_table in Ubercart 5

Same name and namespace in other branches
  1. 6.2 payment/uc_payment/uc_payment.module \uc_payments_table()
  2. 7.3 payment/uc_payment/uc_payment.module \uc_payments_table()
2 string references to 'uc_payments_table'
theme_uc_payment_by_order_form in payment/uc_payment/uc_payment.module
uc_payment_table_settings in payment/uc_payment/uc_payment.module
Implementation of hook_table_settings().

File

payment/uc_payment/uc_payment.module, line 705

Code

function uc_payments_table($op, $form) {
  switch ($op) {
    case 'fields':
      $fields[] = array(
        'name' => 'received',
        'title' => t('Received'),
        'weight' => 0,
        'enabled' => TRUE,
      );
      $fields[] = array(
        'name' => 'user',
        'title' => t('User'),
        'weight' => 1,
        'enabled' => TRUE,
      );
      $fields[] = array(
        'name' => 'method',
        'title' => t('Method'),
        'weight' => 2,
        'enabled' => TRUE,
      );
      $fields[] = array(
        'name' => 'amount',
        'title' => t('Amount'),
        'weight' => 3,
        'enabled' => TRUE,
      );
      $fields[] = array(
        'name' => 'balance',
        'title' => t('Balance'),
        'weight' => 4,
        'enabled' => TRUE,
      );
      $fields[] = array(
        'name' => 'comment',
        'title' => t('Comment'),
        'weight' => 5,
        'enabled' => TRUE,
      );
      $fields[] = array(
        'name' => 'action',
        'title' => t('Action'),
        'weight' => 6,
        'enabled' => TRUE,
      );
      return $fields;
    case 'data':
      foreach (element_children($form['payments']) as $i) {
        $data['#attributes'][] = array(
          'valign' => 'top',
        );
        $data['received'][] = drupal_render($form['payments'][$i]['received']);
        $data['user'][] = drupal_render($form['payments'][$i]['user']);
        $data['method'][] = drupal_render($form['payments'][$i]['method']);
        $data['amount'][] = drupal_render($form['payments'][$i]['amount']);
        $data['balance'][] = drupal_render($form['payments'][$i]['balance']);
        $data['comment'][] = drupal_render($form['payments'][$i]['comment']);
        $data['action'][] = drupal_render($form['payments'][$i]['action']);
      }
      return $data;
  }
}