You are here

function theme_double_field in Double Field 7

Same name and namespace in other branches
  1. 7.2 double_field.module \theme_double_field()

Implements hook_theme().

1 theme call to theme_double_field()
double_field_field_formatter_view in ./double_field.module
Implements hook_field_formatter_view().

File

./double_field.module, line 350
Defines double text field type.

Code

function theme_double_field($vars) {
  $element = $vars['element'];
  $attributes = drupal_attributes(array(
    'class' => array(
      'double-field',
      $element['#display']['type'] == 'double_field_block' ? 'clearfix' : 'container-inline',
    ),
  ));
  $output = '<div' . $attributes . '>';
  $output .= '<div class="double-field-first">' . $element['#display']['settings']['first']['prefix'] . check_plain($element['#item']['first']) . $element['#display']['settings']['first']['suffix'] . '</div>';
  $output .= '<div class="double-field-second">' . $element['#display']['settings']['second']['prefix'] . check_plain($element['#item']['second']) . $element['#display']['settings']['second']['suffix'] . '</div>';
  $output .= '</div>';
  return $output;
}