You are here

function theme_pay_activity_list in Pay 6

Same name and namespace in other branches
  1. 7 theme/pay.theme.inc \theme_pay_activity_list()

Theme function for default money format.

1 theme call to theme_pay_activity_list()
template_preprocess_pay_transaction in theme/pay.theme.inc
A preprocess function for theme('pay_transaction').

File

theme/pay.theme.inc, line 171
Theme hooks and callbacks for the Payment API.

Code

function theme_pay_activity_list($activity_list) {
  $hdrs = array(
    t('Date'),
    t('User'),
    t('Method'),
    t('Total'),
    t('Balance'),
    t('Comment'),
  );
  $rows = array();
  foreach ($activity_list as $activity) {
    $account = $activity
      ->user();
    $currency = $activity
      ->pay_transaction()->currency;
    if ($activity->result) {
      $comment = t('Success');
    }
    else {
      $comment = t('Failed');
    }
    $row = array(
      format_date($activity->timestamp, 'small'),
      $account->uid ? l($account->name, 'user/' . $account->uid) : '-',
      $activity
        ->pay_method()
        ->title(),
      theme('pay_money', $activity->total, $currency),
      theme('pay_money', $activity
        ->balance(), $currency),
      $comment,
    );
    $rows[] = $row;
  }
  return theme('table', $hdrs, $rows);
}