function nodequeue_menu in Nodequeue 7.3
Same name and namespace in other branches
- 5.2 nodequeue.module \nodequeue_menu()
- 5 nodequeue.module \nodequeue_menu()
- 6.2 nodequeue.module \nodequeue_menu()
- 7.2 nodequeue.module \nodequeue_menu()
Implements hook_menu().
File
- ./
nodequeue.module, line 58 - Maintains queues of nodes in arbitrary order.
Code
function nodequeue_menu() {
$items = array();
$admin_access = array(
'administer nodequeue',
);
// administrative items
$items['admin/structure/nodequeue'] = array(
'title' => 'Nodequeues',
'page callback' => 'nodequeue_view_queues',
'access callback' => '_nodequeue_access_admin_or_manipulate',
'description' => 'Create and maintain simple nodequeues.',
'file' => 'includes/nodequeue.admin.inc',
'type' => MENU_NORMAL_ITEM,
);
$items['admin/structure/nodequeue/list'] = array(
'title' => 'List',
'page callback' => 'nodequeue_view_queues',
'access callback' => '_nodequeue_access_admin_or_manipulate',
'file' => 'includes/nodequeue.admin.inc',
'weight' => -1,
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/structure/nodequeue/settings'] = array(
'title' => 'Settings',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'nodequeue_admin_settings',
),
'access arguments' => $admin_access,
'file' => 'includes/nodequeue.admin.inc',
'type' => MENU_LOCAL_TASK,
);
$items['nodequeue/autocomplete'] = array(
'title' => 'Autocomplete',
'page callback' => 'nodequeue_autocomplete',
'access callback' => '_nodequeue_access_admin_or_manipulate',
'file' => 'includes/nodequeue.admin.inc',
'type' => MENU_CALLBACK,
);
$info = nodequeue_api_info();
foreach ($info as $key => $data) {
$items['admin/structure/nodequeue/add/' . $key] = array(
'title' => 'Add @type',
'title arguments' => array(
'@type' => strtolower($data['title']),
),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'nodequeue_edit_queue_form',
$key,
),
'access arguments' => $admin_access,
'file' => 'includes/nodequeue.admin.inc',
'type' => MENU_LOCAL_ACTION,
);
}
$items['node/%node/nodequeue'] = array(
'title' => '@tab',
'title arguments' => array(
'@tab' => variable_get('nodequeue_tab_name', 'Nodequeue'),
),
'page callback' => 'nodequeue_node_tab',
'page arguments' => array(
1,
),
'access callback' => 'nodequeue_node_tab_access',
'access arguments' => array(
1,
),
'file' => 'includes/nodequeue.admin.inc',
'weight' => 5,
'type' => MENU_LOCAL_TASK,
);
// Administrative items for an individual queue.
$items['admin/structure/nodequeue/%nodequeue'] = array(
'page callback' => 'nodequeue_admin_view',
'page arguments' => array(
3,
),
'access callback' => 'nodequeue_queue_access',
'access arguments' => array(
3,
),
'file' => 'includes/nodequeue.admin.inc',
'type' => MENU_CALLBACK,
);
$items['admin/structure/nodequeue/%nodequeue/view'] = array(
'title' => 'View',
'page callback' => 'nodequeue_admin_view',
'page arguments' => array(
3,
),
'access callback' => 'nodequeue_queue_access',
'access arguments' => array(
3,
),
'file' => 'includes/nodequeue.admin.inc',
'weight' => -10,
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items['admin/structure/nodequeue/%nodequeue/view/%subqueue'] = array(
'title' => 'View',
'page callback' => 'nodequeue_admin_view',
'page arguments' => array(
3,
5,
),
'access callback' => 'nodequeue_queue_access',
'access arguments' => array(
3,
5,
),
'file' => 'includes/nodequeue.admin.inc',
'weight' => -10,
'tab parent' => 'admin/structure/nodequeue/%',
'type' => MENU_CALLBACK,
);
// Actual administrative items.
$items['admin/structure/nodequeue/%nodequeue/edit'] = array(
'title' => 'Edit queue',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'nodequeue_edit_queue_form',
3,
),
'access arguments' => $admin_access,
'file' => 'includes/nodequeue.admin.inc',
'type' => MENU_LOCAL_TASK,
);
$items['admin/structure/nodequeue/%nodequeue/delete'] = array(
'title' => 'Delete',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'nodequeue_admin_delete',
3,
),
'access arguments' => $admin_access,
'file' => 'includes/nodequeue.admin.inc',
'weight' => 5,
'type' => MENU_CALLBACK,
);
$items['nodequeue/%nodequeue/add-node/%subqueue/%node'] = array(
'page callback' => 'nodequeue_admin_add_node',
'page arguments' => array(
1,
3,
4,
),
'access callback' => 'nodequeue_node_and_queue_access',
'access arguments' => array(
4,
1,
3,
),
'file' => 'includes/nodequeue.admin.inc',
'type' => MENU_CALLBACK,
);
$items['nodequeue/%nodequeue/remove-node/%subqueue/%node'] = array(
'page callback' => 'nodequeue_admin_remove_node',
'page arguments' => array(
1,
3,
4,
),
'access callback' => 'nodequeue_node_and_queue_access',
'access arguments' => array(
4,
1,
3,
),
'file' => 'includes/nodequeue.admin.inc',
'type' => MENU_CALLBACK,
);
$items["admin/structure/nodequeue/%nodequeue/clear/%subqueue"] = array(
'title' => 'Clear',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'nodequeue_clear_confirm',
3,
5,
),
'access callback' => 'nodequeue_queue_access',
'access arguments' => array(
3,
5,
),
'file' => 'includes/nodequeue.admin.inc',
'type' => MENU_CALLBACK,
);
return $items;
}