function reviews_menu in Reviews 7
Implements hook_menu().
File
- ./
reviews.module, line 53 - This file defines all the necessary hooks and functions to create a system for enabling and authoring content reviews on a per content type basis.
Code
function reviews_menu() {
$items = array();
$items['admin/content/reviews'] = array(
'title' => 'Reviews',
'description' => t('Administer node reviews.'),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'reviews_list',
),
'access arguments' => array(
'moderate reviews',
),
'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
'file' => 'includes/reviews.admin.inc',
);
$items['admin/content/reviews/list'] = array(
'title' => 'List Reviews',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/content/reviews/moderate'] = array(
'title' => 'Moderate Reviews',
'description' => t('Moderate reviews left by users.'),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'reviews_moderation',
),
'access arguments' => array(
'moderate reviews',
),
'type' => MENU_LOCAL_TASK,
'file' => 'includes/reviews.admin.inc',
);
$items['admin/content/reviews/approve/%'] = array(
'title' => 'Approve Review',
'page callback' => 'reviews_approve_review',
'page arguments' => array(
4,
),
'access arguments' => array(
'moderate reviews',
),
'type' => MENU_CALLBACK,
'file' => 'includes/reviews.admin.inc',
);
$items['admin/config/content/reviews'] = array(
'title' => 'Reviews',
'description' => 'Administer reviews.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'reviews_settings',
),
'access arguments' => array(
'administer reviews',
),
'type' => MENU_NORMAL_ITEM,
'file' => 'includes/reviews.admin.inc',
);
$items['node/%reviews_enabled/reviews'] = array(
'title callback' => 'reviews_get_title',
'title arguments' => array(
1,
),
'page callback' => 'reviews_get_reviews',
'page arguments' => array(
1,
),
'access arguments' => array(
'read reviews',
),
'file' => 'includes/reviews.pages.inc',
'type' => MENU_LOCAL_TASK,
);
$items['node/%reviews_enabled/add-review'] = array(
'title' => 'Add Review',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'reviews_add_review',
1,
),
'access arguments' => array(
'add reviews',
),
'file' => 'includes/reviews.pages.inc',
'type' => variable_get('reviews_link_type', 'tab') == 'tab' ? MENU_LOCAL_TASK : MENU_CALLBACK,
);
$items['node/%/edit-review/%'] = array(
'title' => 'Edit Review',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'reviews_edit_review',
1,
3,
),
'access callback' => 'reviews_has_edit_permission',
'file' => 'includes/reviews.pages.inc',
'type' => MENU_CALLBACK,
);
return $items;
}