You are here

function content_token_list in Content Construction Kit (CCK) 6.2

Same name and namespace in other branches
  1. 6.3 includes/content.token.inc \content_token_list()
  2. 6 includes/content.token.inc \content_token_list()

File

includes/content.token.inc, line 56
Implementation of hook_content_build_modes (on behalf of token.module)

Code

function content_token_list($type = 'all') {
  if ($type == 'node' || $type == 'all') {
    $list = array();
    $field_types = _content_field_types();
    foreach (content_fields() as $field) {
      $sub_list = array();
      $function = $field_types[$field['type']]['module'] . '_token_list';
      if (function_exists($function)) {
        $sub_list = $function('field');
        foreach ($sub_list as $category => $token_list) {
          foreach ($token_list as $token => $description) {
            $list['CCK ' . $category][$field['field_name'] . '-' . $token] = $description;
          }
        }
      }
    }
    return $list;
  }
}