You are here

function environment_token_values in Environment 6

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

Implementation of hook_token_values().

File

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

Code

function environment_token_values($type, $object = NULL, $options = array()) {
  $values = array();
  if ($type == 'global') {
    foreach (environment_workflow_load() as $name => $workflow) {
      $state = environment_current($name, NULL, TRUE);
      $values['environment_' . $name] = $state['name'];
      $values['environment_' . $name . '-label'] = $state['label'];
    }
  }
  return $values;
}