You are here

function fivestar_menu in Fivestar 6

Same name and namespace in other branches
  1. 5 fivestar.module \fivestar_menu()
  2. 6.2 fivestar.module \fivestar_menu()
  3. 7.2 fivestar.module \fivestar_menu()

Implementation of hook_menu().

Provides a callback url where votes can be submitted by the client-side javascript.

File

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

Code

function fivestar_menu() {
  $items = array();
  $items['admin/settings/fivestar'] = array(
    'title' => 'Fivestar',
    'description' => 'Configure site-wide widgets used for Fivestar rating.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'fivestar_settings',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'fivestar_color.inc',
  );
  $items['fivestar/preview/color'] = array(
    'page callback' => 'fivestar_preview_color',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'fivestar_color.inc',
  );
  $items['fivestar/preview/node'] = array(
    'page callback' => 'fivestar_preview',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer content types',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['fivestar/vote'] = array(
    'page callback' => 'fivestar_vote',
    'access callback' => 'user_access',
    'access arguments' => array(
      'rate content',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}