You are here

function rate_preprocess_rate_template_yesno in Rate 6.2

Same name and namespace in other branches
  1. 7 rate.module \rate_preprocess_rate_template_yesno()

Preprocess function for the yesno template.

File

./rate.module, line 1124
Rate module

Code

function rate_preprocess_rate_template_yesno(&$variables) {
  extract($variables);
  $buttons = array();
  foreach ($links as $link) {
    $button = theme('rate_button', $link['text'], $link['href'], 'rate-yesno-btn');
    $button .= $link['votes'];
    $buttons[] = $button;
  }
  $variables['buttons'] = $buttons;
  $info = array();
  if ($mode == RATE_CLOSED) {
    $info[] = t('Voting is closed.');
  }
  if ($mode != RATE_COMPACT && $mode != RATE_COMPACT_DISABLED) {
    if ($results['user_vote']) {
      $info[] = t('You voted \'@option\'.', array(
        '@option' => t($results['user_vote']),
      ));
    }
  }
  $variables['info'] = implode(' ', $info);
}