You are here

function theme_tax_rate_admin_overview in Commerce Core 7

Builds an overview of a tax rate for display to an administrator.

Parameters

$variables: An array of variables used to generate the display; by default includes the tax rate key with a value of the tax rate array.

1 theme call to theme_tax_rate_admin_overview()
commerce_tax_ui_overview in modules/tax/includes/commerce_tax_ui.admin.inc
Displays an overview of Tax UI defined tax rates.

File

modules/tax/includes/commerce_tax_ui.admin.inc, line 74
Administrative callbacks and form builder functions for the Tax UI module.

Code

function theme_tax_rate_admin_overview($variables) {
  $tax_rate = $variables['tax_rate'];

  // Build the description as an array so we can skip the actual tax rate
  // description if it isn't set and just include the rate.
  $description = array();
  if (!empty($tax_rate['description'])) {
    $description[] = filter_xss_admin($tax_rate['description']);
  }
  $description[] = t('Rate: @rate', array(
    '@rate' => $tax_rate['rate'],
  ), array(
    'context' => 'tax rate',
  ));

  // Build the actual output.
  $output = check_plain($tax_rate['title']);
  $output .= ' <small>' . t('(Machine name: @type)', array(
    '@type' => $tax_rate['name'],
  )) . '</small>';
  $output .= '<div class="description">' . implode('<br />', $description) . '</div>';
  return $output;
}