You are here

function theme_styles_field_formatter in Styles 7.2

Same name and namespace in other branches
  1. 7 styles.module \theme_styles_field_formatter()

@file styles.theme.inc Theme and preprocess functions for the Styles project.

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

themes/styles.theme.inc, line 8
styles.theme.inc Theme and preprocess functions for the Styles project.

Code

function theme_styles_field_formatter($variables) {
  $formatter = $variables['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;
}