You are here

function _custom_formatters_tokens_list in Custom Formatters 6

2 calls to _custom_formatters_tokens_list()
theme_custom_formatters_token_tree in ./custom_formatters.admin.inc
Provide a 'tree' display of nested tokens.
_custom_formatters_token_replace in ./custom_formatters.module

File

./custom_formatters.module, line 480
Contains core functions for the Custom Formatters module.

Code

function _custom_formatters_tokens_list($field) {
  token_include();
  $tokens_list = array(
    'custom_formatters',
  );
  $fields = _content_field_types();

  // Give modules a chance to alter fields.
  drupal_alter('custom_formatters_fields', $fields);
  $module = $fields[$field]['module'];

  // Build list of modules with supported tokens.
  if (function_exists("{$module}_token_list")) {
    $tokens_list[] = $module;
  }

  // Invoke hook_custom_formatters_field_tokens().
  $tokens_list = array_merge($tokens_list, module_invoke_all("custom_formatters_{$field}_tokens"));
  return array_unique($tokens_list);
}