You are here

function theme_ds_multigroup_comma_separated in Display Suite 6.3

Same name and namespace in other branches
  1. 6.2 theme/theme.inc \theme_ds_multigroup_comma_separated()

Theme a multigroup as a comma separated list

Parameters

string $group : The multigroup to theme.

1 string reference to 'theme_ds_multigroup_comma_separated'
_ds_theme in includes/ds.registry.inc
Return theme functions.

File

theme/theme.inc, line 431
Theming functions for ds.

Code

function theme_ds_multigroup_comma_separated($group) {
  $output = '';
  foreach ($group['rows'] as $row) {
    $row_output = '';

    // Set a legend if a field title exists
    $output .= '<div class="' . $row['class'] . '">';
    if (!empty($row['title'])) {
      $row_output = theme('ds_subgroup_label', $row['title']);
    }
    $n = count($row['fields']);
    $count = 1;
    foreach ($row['fields'] as $field) {
      $class = !empty($field['class']) ? ' ' . $field['class'] : '';
      $row_output .= '<span class="field-item ' . $field['key'] . $class . '">';
      if ($field['labelformat'] == 'inline') {
        $row_output .= '<span class="field-label-inline-first">' . $field['title'] . ': </span>';
      }
      $row_output .= $field['view'] . '</span>';
      if ($count != $n) {
        $row_output .= ', ';
      }
      $count++;
    }
    $output .= $row_output;
    $output .= '</div>';
  }
  return $output;
}