You are here

function theme_styles_field_formatter in Styles 7

Same name and namespace in other branches
  1. 7.2 themes/styles.theme.inc \theme_styles_field_formatter()

The formatter theme callback.

1 string reference to 'theme_styles_field_formatter'
styles_field_formatter_info in ./styles.module
Implements hook_field_formatter_info().
1 theme call to theme_styles_field_formatter()
styles_field_formatter_view in ./styles.module
Implements hook_field_formatter_view().

File

./styles.module, line 80
Bundles similar display formatters together.

Code

function theme_styles_field_formatter($variables) {
  $element = $variables['element'];
  $formatter = $element['#formatter'];
  $variables['object'] = (object) $variables['object'];
  $output = '';
  if (preg_match('@^styles_(.*?)_(.*?)$@i', $formatter, $matches)) {
    $variables['field_type'] = $field_type = $matches[1];
    $variables['style_name'] = $style_name = $matches[2];
    $output = theme('styles', $variables);
  }
  return $output;
}