You are here

function field_test_menu in SimpleTest 7

Implement hook_menu().

File

tests/field_test.module, line 26

Code

function field_test_menu() {
  $items = array();
  $bundles = field_info_bundles('test_entity');
  foreach ($bundles as $bundle_name => $bundle_info) {
    $bundle_url_str = str_replace('_', '-', $bundle_name);
    $items['test-entity/add/' . $bundle_url_str] = 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/%field_test_entity_test/edit'] = array(
    'title' => 'Edit test entity',
    'page callback' => 'field_test_entity_edit',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'administer field_test content',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  return $items;
}