function entity_test_menu

Implements hook_menu().

File

drupal/core/modules/system/tests/modules/entity_test/entity_test.module, line 205
Test module for the entity API providing several entity types for testing.

Code

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;
}