You are here

function environment_token_list in Environment 6

Same name and namespace in other branches
  1. 7 environment.module \environment_token_list()

Implementation of hook_token_list().

File

plugins/environment.token.inc, line 11
Token provider integration for Environment module.

Code

function environment_token_list($type = 'all') {
  $tokens = array();
  if ($type == 'all' || $type == 'global') {
    foreach (environment_workflow_load() as $name => $workflow) {
      $tokens['global']['environment_' . $name] = t('The current environment state for @title workflow.', array(
        '@title' => $workflow['label'],
      ));
      $tokens['global']['environment_' . $name . '-label'] = t('The human-readable version of the current environment state for @title workflow.', array(
        '@title' => $workflow['label'],
      ));
    }
  }
  return $tokens;
}