You are here

function theme_rate_button in Rate 7

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

Theme rate button.

Parameters

array $variables:

Return value

string

8 theme calls to theme_rate_button()
rate_preprocess_rate_template_emotion in ./rate.module
Preprocess function for the emotion template.
rate_preprocess_rate_template_fivestar in ./rate.module
Preprocess function for the fivestar template.
rate_preprocess_rate_template_number_up_down in ./rate.module
Preprocess function for the number_up_down template.
rate_preprocess_rate_template_thumbs_up in ./rate.module
Preprocess function for the thumbs_up_down template.
rate_preprocess_rate_template_thumbs_up_down in ./rate.module
Preprocess function for the thumbs_up_down template.

... See full list

File

./rate.module, line 1405
Rate module

Code

function theme_rate_button($variables) {
  $text = $variables['text'];
  $href = $variables['href'];
  $class = $variables['class'];
  static $id = 0;
  $id++;
  $classes = 'rate-button';
  if ($class) {
    $classes .= ' ' . $class;
  }
  if (empty($href)) {

    // Widget is disabled or closed.
    return '<span class="' . $classes . '" id="rate-button-' . $id . '">' . check_plain($text) . '</span>';
  }
  else {
    return '<a class="' . $classes . '" id="rate-button-' . $id . '" rel="nofollow" href="' . htmlentities($href) . '" title="' . check_plain($text) . '">' . check_plain($text) . '</a>';
  }
}