You are here

function theme_fivestar_static_element in Fivestar 7.2

Same name and namespace in other branches
  1. 5 fivestar.module \theme_fivestar_static_element()
  2. 6.2 fivestar.module \theme_fivestar_static_element()
  3. 6 fivestar.module \theme_fivestar_static_element()

Display a static fivestar value as stars with a title and description.

2 theme calls to theme_fivestar_static_element()
fivestar_expand in ./fivestar.module
Process callback for fivestar_element -- see fivestar_element()
theme_fivestar_formatter_default in includes/fivestar.theme.inc
Theme function for 'default' fivestar field formatter.

File

includes/fivestar.theme.inc, line 323
Provides the theming functions for fivestar.

Code

function theme_fivestar_static_element($variables) {
  $output = '';
  if (isset($variables['is_form']) && !$variables['is_form']) {
    $output .= '<div class="fivestar-static-item">';
  }
  else {
    $output .= '<div class="fivestar-static-form-item">';
  }
  $element = array(
    '#type' => 'item',
    '#title' => $variables['title'],
    '#description' => $variables['description'],
    '#children' => $variables['star_display'],
  );
  $output .= theme('form_element', array(
    'element' => $element,
  ));
  $output .= '</div>';
  return $output;
}