You are here

function hook_rate_templates in Rate 6.2

Same name and namespace in other branches
  1. 8.2 rate.api.php \hook_rate_templates()
  2. 7 rate.hooks.inc \hook_rate_templates()

Define templates for rate widgets.

Return value

array

1 function implements hook_rate_templates()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

rate_rate_templates in ./rate.module
Implements hook_rate_templates().
3 invocations of hook_rate_templates()
rate_choose_template_form in ./rate.admin.inc
Form for choosing a template before the user goes to the add widget form.
_rate_get_template in ./rate.module
Get a template object by name.
_rate_update_templates_data in ./rate.install
Update css and js attributes in the widget objects.

File

./rate.hooks.inc, line 8

Code

function hook_rate_templates() {
  $templates = array();
  $templates['thumbs_up'] = new stdClass();
  $templates['thumbs_up']->value_type = 'points';
  $templates['thumbs_up']->options = array(
    array(
      1,
      'up',
    ),
  );
  $templates['thumbs_up_down'] = new stdClass();
  $templates['thumbs_up_down']->value_type = 'points';
  $templates['thumbs_up_down']->options = array(
    array(
      1,
      'up',
    ),
    array(
      -1,
      'down',
    ),
  );
  $templates['fivestar'] = new stdClass();
  $templates['fivestar']->value_type = 'percent';
  $templates['fivestar']->options = array(
    array(
      0,
      '*',
    ),
    array(
      25,
      '**',
    ),
    array(
      50,
      '***',
    ),
    array(
      75,
      '****',
    ),
    array(
      100,
      '*****',
    ),
  );
  return $templates;
}