theme_fivestar_widget

5 fivestar.module theme_fivestar_widget($form)
6 fivestar.module theme_fivestar_widget($form)

Theme an entire fivestar widget, including the submit button and the normal fivestar widget themed in the theme_fivestar() function.

File

contributions/fivestar/fivestar.module, line 1035
A simple n-star voting widget, usable in other forms.

Code

<?php
function theme_fivestar_widget($form) {
  // Only print out the summary if text is being displayed or using rollover text.
  if (empty($form['vote']['#description']) && strpos($form['vote']['#prefix'], 'fivestar-labels-hover') === FALSE) {
    unset($form['vote']['#description']);
  }

  $class = 'fivestar-form';
  $class .= '-' . (isset($form['vote']['#tag']) ? $form['vote']['#tag'] : 'vote');
  $class .= '-' . (isset($form['content_id']['#value']) ? $form['content_id']['#value'] : 0);

  $output  = '';
  $output .= '<div class="' . $class . ' clear-block">';
  $output .= drupal_render($form);
  $output .= '</div>';
  return $output;
}
?>