You are here

function fivestar_forms in Fivestar 6.2

Same name and namespace in other branches
  1. 5 fivestar.module \fivestar_forms()
  2. 6 fivestar.module \fivestar_forms()

Implementation of hook_forms().

This is necessary when multiple fivestar forms appear on the same page, each requiring a separate form_id, but all using the same underlying callbacks.

File

./fivestar.module, line 643
A simple n-star voting widget, usable in other forms.

Code

function fivestar_forms($form_id, $args) {
  if (strpos($form_id, 'fivestar_form') !== FALSE) {
    if ($form_id == 'fivestar_form_' . $args[0] . '_' . $args[1] . '_' . $args[2]) {
      $forms[$form_id] = array(
        'callback' => 'fivestar_form',
      );
      return $forms;
    }
  }
}