You are here

function rate_rate_templates in Rate 8.2

Same name and namespace in other branches
  1. 6.2 rate.module \rate_rate_templates()
  2. 7 rate.module \rate_rate_templates()

Implements hook_rate_templates().

File

./rate.module, line 497
Hook implementation code for the Rate module.

Code

function rate_rate_templates() {
  $templates = [];
  $templates['custom'] = new stdClass();
  $templates['custom']->value_type = '';
  $templates['custom']->options = [
    [],
  ];
  $templates['custom']->customizable = TRUE;
  $templates['custom']->translate = TRUE;
  $templates['custom']->template_title = t('Custom');
  $templates['thumbsup'] = new stdClass();
  $templates['thumbsup']->value_type = 'points';
  $templates['thumbsup']->options = [
    [
      'value' => 1,
      'label' => 'up',
    ],
  ];
  $templates['thumbsup']->customizable = FALSE;
  $templates['thumbsup']->translate = TRUE;
  $templates['thumbsup']->template_title = t('Thumbs up');
  $templates['thumbsupdown'] = new stdClass();
  $templates['thumbsupdown']->value_type = 'points';
  $templates['thumbsupdown']->options = [
    [
      'value' => 1,
      'label' => 'up',
    ],
    [
      'value' => -1,
      'label' => 'down',
    ],
  ];
  $templates['thumbsupdown']->customizable = FALSE;
  $templates['thumbsupdown']->translate = TRUE;
  $templates['thumbsupdown']->template_title = t('Thumbs up / down');
  $templates['numberupdown'] = new stdClass();
  $templates['numberupdown']->value_type = 'points';
  $templates['numberupdown']->options = [
    [
      'value' => 1,
      'label' => 'up',
    ],
    [
      'value' => -1,
      'label' => 'down',
    ],
  ];
  $templates['numberupdown']->customizable = FALSE;
  $templates['numberupdown']->translate = TRUE;
  $templates['numberupdown']->template_title = t('Number up / down');
  $templates['fivestar'] = new stdClass();
  $templates['fivestar']->value_type = 'percent';
  $templates['fivestar']->options = [
    [
      'value' => 0,
      'label' => '1',
    ],
    [
      'value' => 25,
      'label' => '2',
    ],
    [
      'value' => 50,
      'label' => '3',
    ],
    [
      'value' => 75,
      'label' => '4',
    ],
    [
      'value' => 100,
      'label' => '5',
    ],
  ];
  $templates['fivestar']->customizable = TRUE;
  $templates['fivestar']->translate = FALSE;
  $templates['fivestar']->template_title = t('Fivestar');
  $templates['emotion'] = new stdClass();
  $templates['emotion']->value_type = 'option';
  $templates['emotion']->options = [
    [
      'value' => 1,
      'label' => 'funny',
    ],
    [
      'value' => 2,
      'label' => 'mad',
    ],
    [
      'value' => 3,
      'label' => 'angry',
    ],
  ];
  $templates['emotion']->customizable = TRUE;
  $templates['emotion']->translate = TRUE;
  $templates['emotion']->template_title = t('Emotion');
  $templates['yesno'] = new stdClass();
  $templates['yesno']->value_type = 'option';
  $templates['yesno']->options = [
    [
      'value' => 1,
      'label' => 'yes',
    ],
    [
      'value' => 2,
      'label' => 'no',
    ],
  ];
  $templates['yesno']->customizable = TRUE;
  $templates['yesno']->translate = TRUE;
  $templates['yesno']->template_title = t('Yes / No');
  return $templates;
}