You are here

function commerce_payment_handler_field_status::render in Commerce Core 7

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

modules/payment/includes/views/handlers/commerce_payment_handler_field_status.inc, line 34

Class

commerce_payment_handler_field_status
Field handler for the payment transaction status.

Code

function render($values) {
  $status = $this
    ->get_value($values);
  $transaction_status = commerce_payment_transaction_status_load($status);
  if (!$transaction_status) {
    return '?';
  }
  $variables = array(
    'transaction_status' => $transaction_status,
  );
  switch ($this->options['display_style']) {
    case 'icon':
      return theme('commerce_payment_transaction_status_icon', $variables);
    case 'title':
      return theme('commerce_payment_transaction_status_text', $variables + array(
        'text' => $this
          ->sanitize_value($transaction_status['title']),
      ));
    case 'raw':
      return theme('commerce_payment_transaction_status_text', $variables + array(
        'text' => $this
          ->sanitize_value($transaction_status['status']),
      ));
  }
}