You are here

function password_policy_token_info in Password Policy 7.2

Implements hook_token_info().

File

./password_policy.module, line 441
Enforces password policies.

Code

function password_policy_token_info() {
  $type = array(
    'name' => t('Password Expiration Date'),
    'description' => t('Tokens related to expired passwords.'),
    'needs-data' => 'password_expiration_date',
  );
  $formats = module_invoke_all('date_format_types');
  foreach ($formats as $name => $title) {
    $format[$name] = array(
      'name' => t('Expire Date @title Format', array(
        '@title' => $title,
      )),
      'description' => t('The Date the Password Expires in the @title Format.', array(
        '@title' => $title,
      )),
    );
  }
  $format['interval'] = array(
    'name' => t('Expire Date interval'),
    'description' => t('The Date the Password Expires in x days format'),
  );
  return array(
    'types' => array(
      'password_expiration_date' => $type,
    ),
    'tokens' => array(
      'password_expiration_date' => $format,
    ),
  );
}