You are here

function uc_roles_token_values in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_roles/uc_roles.module \uc_roles_token_values()

Implementation of hook_token_values().

File

uc_roles/uc_roles.module, line 413
Grants roles upon accepted payment of products

Code

function uc_roles_token_values($type, $object = NULL) {
  switch ($type) {
    case 'uc_roles':
      $values['role-expiration-long'] = format_date($object->expiration, 'large');
      $values['role-expiration-medium'] = format_date($object->expiration, 'medium');
      $values['role-expiration-short'] = format_date($object->expiration, 'small');
      $values['role-name'] = check_plain(_get_role_name($object->rid));
      break;
  }
  return $values;
}