You are here

function theme_rate_button in Rate 6.2

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

Theme rate button.

Parameters

string $text:

string $href:

string $class:

Return value

string

6 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_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.
rate_preprocess_rate_template_yesno in ./rate.module
Preprocess function for the yesno template.

... See full list

File

./rate.module, line 1155
Rate module

Code

function theme_rate_button($text, $href, $class = NULL) {
  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) . '">' . check_plain($text) . '</a>';
  }
}