function emfield_implement_types in Embedded Media Field 6.3
Same name and namespace in other branches
- 5 emfield.module \emfield_implement_types()
- 6 emfield.module \emfield_implement_types()
- 6.2 emfield.module \emfield_implement_types()
This returns a list of content types that are implemented by emfield.
2 calls to emfield_implement_types()
File
- deprecated/
emfield-deprecated.inc, line 122 - Functionality to be deprecated from earlier versions of Embedded Media Field.
Code
function emfield_implement_types($cached = TRUE) {
static $types;
if (!isset($types) || !$cached) {
// If it's a cachable request, try to load a cached value.
if ($cached && ($cache = cache_get('emfield_implement_types', 'cache'))) {
$types = $cache->data;
}
else {
$system_types = _content_type_info();
$content_types = $system_types['content types'];
$field_types = $system_types['field types'];
// The array that will store type/field information for provider import.
$types = array();
$modules = array();
foreach (module_implements('emfield_info', TRUE) as $module) {
$modules[$module] = $module;
}
// Settings per content type for the module.
foreach ($content_types as $content_type => $type) {
// Determine which content types implement this module.
foreach ($type['fields'] as $field_type => $field) {
// If this field type is defined by this module, then include it here.
if (!empty($modules[$field_types[$field['type']]['module']])) {
// Settings per content type per module.
$module = $modules[$field_types[$field['type']]['module']];
$types[$module][$content_type][$field_type] = $field;
}
}
}
}
}
cache_set('emfield_implement_types', $types, 'cache', CACHE_PERMANENT);
return $types;
}