You are here

function _fivestar_custom_widget_settings in Fivestar 7.2

Generate the $settings parameter to be passed to fivestar_custom_widget().

@params

Return value

settings Array. @see fivestar_custom_widget().

1 call to _fivestar_custom_widget_settings()
fivestar_field_formatter_view in includes/fivestar.field.inc
Implements hook_field_formatter_view().

File

includes/fivestar.field.inc, line 666
Provides CCK integration for fivestar module.

Code

function _fivestar_custom_widget_settings($entity_type, $instance, $display, $id, $tag, $widget) {
  $settings = $display['settings'];
  $settings = array(
    'stars' => !empty($instance['settings']['stars']) ? $instance['settings']['stars'] : 5,
    'allow_clear' => !empty($instance['settings']['allow_clear']) ? $instance['settings']['allow_clear'] : 0,
    'allow_revote' => !empty($instance['settings']['allow_revote']) ? $instance['settings']['allow_revote'] : 0,
    'allow_ownvote' => !empty($instance['settings']['allow_ownvote']) ? $instance['settings']['allow_ownvote'] : 0,
    'style' => $settings['style'],
    'text' => $settings['text'],
    'content_type' => $entity_type,
    'content_id' => $id,
    'tag' => $tag,
    'autosubmit' => TRUE,
    'title' => FALSE,
    'labels_enable' => FALSE,
    'labels' => array(),
    'widget' => $widget,
    'description' => $instance['description'],
  );
  return $settings;
}