function multi_node_add_menu in Multi Node Add 6
Same name and namespace in other branches
- 7 multi_node_add.module \multi_node_add_menu()
Implementation of hook_menu().
File
- ./
multi_node_add.module, line 13 - This module allows to create multiple nodes using one page, one form submission. Uses AJAX.
Code
function multi_node_add_menu() {
$items = array();
$items['multi_node_add'] = array(
'title' => 'Create multiple nodes',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'multi_node_add_page',
),
'access callback' => '_node_add_access',
);
foreach (node_get_types('types', NULL, TRUE) as $type) {
$type_url_str = str_replace('_', '-', $type->type);
$items['multi_node_add/' . $type_url_str] = array(
'title' => drupal_ucfirst($type->name),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'multi_node_add_page',
1,
),
'access callback' => 'node_access',
'access arguments' => array(
'create',
$type->type,
),
'description' => $type->description,
'type' => MENU_LOCAL_TASK,
);
$items['multi_node_add/frame/' . $type_url_str] = array(
'type' => MENU_CALLBACK,
'access callback' => 'node_access',
'access arguments' => array(
'create',
$type->type,
),
'page callback' => 'multi_node_add_frame_page',
);
$items['multi_node_add/status/' . $type_url_str . '/%node'] = array(
'type' => MENU_CALLBACK,
'access callback' => 'node_access',
'access arguments' => array(
'create',
$type->type,
),
'page callback' => 'multi_node_add_frame_status',
'page arguments' => array(
3,
),
);
}
return $items;
}