function fivestar_menu in Fivestar 5
Same name and namespace in other branches
- 6.2 fivestar.module \fivestar_menu()
- 6 fivestar.module \fivestar_menu()
- 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 28 - A simple n-star voting widget, usable in other forms.
Code
function fivestar_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'admin/settings/fivestar',
'title' => t('Fivestar'),
'description' => t('Configure site-wide widgets used for Fivestar rating.'),
'callback' => 'drupal_get_form',
'callback arguments' => array(
'fivestar_settings',
),
'type' => MENU_NORMAL_ITEM,
'access' => user_access('administer site configuration'),
);
$items[] = array(
'path' => 'fivestar/preview/color',
'callback' => 'fivestar_preview_color',
'type' => MENU_CALLBACK,
'access' => user_access('administer site configuration'),
);
$items[] = array(
'path' => 'fivestar/preview/node',
'callback' => 'fivestar_preview',
'type' => MENU_CALLBACK,
'access' => user_access('administer content types'),
);
$items[] = array(
'path' => 'fivestar/vote',
'callback' => 'fivestar_vote',
'type' => MENU_CALLBACK,
'access' => user_access('rate content'),
);
}
return $items;
}