You are here

function theme_fivestar_formatter_default in Fivestar 6

Same name and namespace in other branches
  1. 8 includes/fivestar.theme.inc \theme_fivestar_formatter_default()
  2. 6.2 includes/fivestar.field.inc \theme_fivestar_formatter_default()
  3. 7.2 includes/fivestar.theme.inc \theme_fivestar_formatter_default()

Theme function for 'default' fivestar field formatter.

File

./fivestar_field.inc, line 263
Provides CCK integration for fivestar module

Code

function theme_fivestar_formatter_default($element) {
  if (!isset($element['#item']['rating'])) {
    $element['#item']['rating'] = 0;
  }
  if (empty($element['#item']['stars'])) {
    $element['#item']['stars'] = 5;
  }
  return theme('fivestar_static', $element['#item']['rating'], $element['#item']['stars']);
}