You are here

function fieldgroup_content_generate in Custom Formatters 6

File

includes/fieldgroup.inc, line 87
Fieldgroup module integration.

Code

function fieldgroup_content_generate($node, $field) {
  $item = array();
  foreach (fieldgroup_groups($node['type']) as $group) {
    if ($group['group_type'] == 'standard') {
      foreach ($group['fields'] as $field) {
        if (function_exists($function = "{$field['widget_module']}_content_generate")) {
          $item[$field['field_name']][0] = $function($node, content_fields($field['field_name']));
          $element = array(
            '#node' => $node,
            '#item' => $item[$field['field_name']],
          );
          $item[$field['field_name']][0]['view'] = theme("{$field['widget_module']}_formatter_default", $element);
        }
      }
    }
  }
  return $item;
}