definition['float'] = TRUE; } function option_definition() { $options = parent::option_definition(); $options['appearance'] = ''; return $options; } function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); $appearances = module_invoke_all('votingapi_views_formatters', $this); $options = array('' => t('Default appearance')); $options += $appearances; if (count($options) > 1) { $form['appearance'] = array( '#type' => 'select', '#title' => t('Appearance'), '#options' => $options, '#default_value' => $this->options['appearance'], '#weight' => -5, ); } } function render($values) { $value = $values->{$this->field_alias}; $function = $this->options['appearance']; if (!empty($function) && function_exists($function)) { return $function($value, $this, $values); } else { return parent::render($values); } } }