function ctools_token_content_type_content_types
Return all field content types available.
1 call to ctools_token_content_type_content_types()
- ctools_token_content_type_content_type in plugins/
content_types/ token/ token.inc - Just one subtype.
File
-
plugins/
content_types/ token/ token.inc, line 34
Code
function ctools_token_content_type_content_types() {
// This will hold all the properties.
$types =& drupal_static(__FUNCTION__);
if (isset($types)) {
return $types;
}
$types = array();
$info = token_info();
foreach ($info['tokens'] as $entity_type => $tokens) {
$category = t('@entity (tokens)', array(
'@entity' => ucfirst($entity_type),
));
$context = new ctools_context_required(t(ucfirst($entity_type)), $entity_type);
foreach ($tokens as $name => $token) {
if (!empty($token['name'])) {
$token += array(
'description' => '',
);
$types[$entity_type . ':' . $name] = array(
'category' => $category,
'icon' => 'icon_token.png',
'title' => $token['name'],
'description' => $token['description'],
'required context' => $context,
);
}
}
}
return $types;
}