You are here

function rate_preprocess_rate_template_thumbs_up in Rate 7

Same name and namespace in other branches
  1. 6.2 rate.module \rate_preprocess_rate_template_thumbs_up()

Preprocess function for the thumbs_up_down template.

File

./rate.module, line 1353
Rate module

Code

function rate_preprocess_rate_template_thumbs_up(&$variables) {
  extract($variables);
  $variables['up_button'] = theme('rate_button', array(
    'text' => $links[0]['text'],
    'href' => $links[0]['href'],
    'class' => 'rate-thumbs-up-btn-up',
  ));
  $info = array();
  if ($mode == RATE_CLOSED) {
    $info[] = t('Voting is closed.');
  }
  if ($mode != RATE_COMPACT && $mode != RATE_COMPACT_DISABLED) {
    if (isset($results['user_vote'])) {
      $info[] = format_plural($results['count'], 'Only you voted.', '@count users have voted, including you.');
    }
    else {
      $info[] = format_plural($results['count'], '@count user has voted.', '@count users have voted.');
    }
  }
  $variables['info'] = implode(' ', $info);
}