You are here

function theme_custom_formatters_content_multigroup in Custom Formatters 6

File

includes/content_multigroup.inc, line 58
Provides Custom Formatters integration with the Content Multigroup module.

Code

function theme_custom_formatters_content_multigroup($element) {
  $output = '';
  foreach (element_children($element) as $child) {
    $items = array();
    foreach (element_children($element[$child]) as $field) {
      $delta = $element[$child][$field]['field']['items'][1]['#item']['#delta'];
      $items[$field] = $element[$child][$field]['field']['items'][1]['#item'];
      $items[$field]['view'] = theme($element[$child][$field]['field']['items'][1]['#theme'], $element[$child][$field]['field']['items'][1]);
      unset($items[$field]['#delta']);
    }
    $items['#delta'] = $delta;
    $element[$child] = array(
      '#node' => $element['#node'],
      '#item' => $items,
      '#formatter' => $element['#formatter'],
    );
    $output .= theme('custom_formatters_formatter', $element[$child]);
  }
  return $output;
}