You are here

function theme_field_formatter_styles in Styles 6.2

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

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

1 string reference to 'theme_field_formatter_styles'
styles_theme in ./styles.module
Implements hook_theme().

File

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

Code

function theme_field_formatter_styles($element = NULL) {

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