Skip to content
Snippets Groups Projects
Commit 3921bda1 authored by dasRicardo's avatar dasRicardo
Browse files

try to integrate display suite extrafields

parent 75cf9f06
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,7 @@ function _extrafield_views_integration_get_all_entity_types() {
}
}
}
$test = ds_get_fields('node');
return $entity_types;
}
......@@ -63,16 +64,26 @@ function _extrafield_views_integration_get_all_entity_types() {
* Reference for the extra fields array.
*/
function _extrafield_views_integration_get_extra_fields_for_entity_type($entity_type, $bundles, &$extra_fields) {
$callback = '';
foreach ($bundles as $bundle) {
$temp_fields = field_info_extra_fields($entity_type, $bundle, 'display');
if (!empty($temp_fields)) {
foreach ($temp_fields as $field_name => $temp_field) {
if (isset($temp_field['callback']) && function_exists($temp_field['callback'])) {
$callback = $temp_field['callback'];
}
else {
$callback = 'extrafield_' . $entity_type . '_' . $bundle . '_' . $field_name;
if(!function_exists($callback)) {
$callback = '';
}
}
if(!empty($callback)) {
$extra_fields[$field_name] = array(
'entity_type' => $entity_type,
'label' => $temp_field['label'],
'description' => $temp_field['description'],
'callback' => $temp_field['callback'],
'callback' => $callback,
);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment