You are here

function uc_extra_fields_pane_token_list in Extra Fields Checkout Pane 6

Same name and namespace in other branches
  1. 6.2 uc_extra_fields_pane.module \uc_extra_fields_pane_token_list()

Implementation of hook_token_list().

File

./uc_extra_fields_pane.module, line 737

Code

function uc_extra_fields_pane_token_list($type = 'all') {
  $tokens = array();
  if ($type == 'order' || $type == 'ubercart' || $type == 'all') {
    $results = db_query("select field_db_name,field_name from {uc_extra_fields}");
    while ($result = db_fetch_array($results)) {
      $tokens['order']['extra-billing-' . str_replace('ucxf_', '', $result['field_db_name'])] = t(variable_get('uc_extra_fields_pane_billing_pane_title', 'Additional billing information')) . ': ' . t($result['field_name']);
      $tokens['order']['extra-shipping-' . str_replace('ucxf_', '', $result['field_db_name'])] = t(variable_get('uc_extra_fields_pane_delivery_pane_title', 'Additional delivery information')) . ': ' . t($result['field_name']);
    }
  }
  return $tokens;
}