function field_test_menu

Implements hook_menu().

File

drupal/core/modules/field/tests/modules/field_test/field_test.module, line 44

Code

function field_test_menu() {
  $items = array();
  $bundles = field_info_bundles('test_entity');
  foreach ($bundles as $bundle_name => $bundle_info) {
    $items['test-entity/add/' . $bundle_name] = array(
      'title' => t('Add %bundle test_entity', array(
        '%bundle' => $bundle_info['label'],
      )),
      'page callback' => 'field_test_entity_add',
      'page arguments' => array(
        2,
      ),
      'access arguments' => array(
        'administer field_test content',
      ),
      'type' => MENU_NORMAL_ITEM,
    );
  }
  $items['test-entity/manage/%field_test_entity_test/edit'] = array(
    'title' => 'Edit test entity',
    'page callback' => 'field_test_entity_edit',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'administer field_test content',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['test-entity/nested/%field_test_entity_test/%field_test_entity_test'] = array(
    'title' => 'Nested entity form',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'field_test_entity_nested_form',
      2,
      3,
    ),
    'access arguments' => array(
      'administer field_test content',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  return $items;
}