You are here

function fivestar_forms in Fivestar 5

Same name and namespace in other branches
  1. 6.2 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 960
A simple n-star voting widget, usable in other forms.

Code

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