You are here

function template_preprocess_pay_transaction in Pay 7

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

A preprocess function for theme('pay_transaction').

The $variables array initially contains the following arguments:

File

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

Code

function template_preprocess_pay_transaction(&$variables) {
  $pay_transaction = $variables['pay_transaction'];
  $variables['pay_form'] = pay_form_load($pay_transaction->pfid);
  $variables['date'] = format_date($pay_transaction->created, 'short');
  $variables['user'] = user_load($pay_transaction->uid);
  $variables['notes'] = $pay_transaction
    ->notes();
  $variables['id'] = $pay_transaction->pxid;
  if ($actions = $pay_transaction
    ->available_actions()) {
    $links = array();
    foreach ($actions as $name => $info) {
      $href = 'pay/transaction/' . $pay_transaction->pxid . '/' . $name;
      $links[$name] = array(
        'href' => $href,
        'title' => t($info['title']),
      );
    }
    $variables['actions'] = theme_links($links, array(
      'class' => 'pay-transaction-links',
    ));
  }
  if ($activity = $pay_transaction
    ->activity()) {
    $variables['activity'] = theme('pay_activity_list', array(
      'activity' => $activity,
    ));
  }
}