Implements hook_menu().
function entity_test_menu() {
$items = array();
foreach (entity_test_entity_types() as $entity_type) {
$items[$entity_type . '/add'] = array(
'title' => 'Add an @type',
'title arguments' => array(
'@type' => $entity_type,
),
'page callback' => 'entity_test_add',
'page arguments' => array(
$entity_type,
),
'access arguments' => array(
'administer entity_test content',
),
'type' => MENU_NORMAL_ITEM,
);
$items[$entity_type . '/manage/%' . $entity_type] = array(
'title' => 'Edit @type',
'title arguments' => array(
'@type' => $entity_type,
),
'page callback' => 'entity_test_edit',
'page arguments' => array(
2,
),
'access arguments' => array(
'administer entity_test content',
),
'type' => MENU_NORMAL_ITEM,
);
$items[$entity_type . '/manage/%' . $entity_type . '/edit'] = array(
'title' => 'Edit',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
}
return $items;
}