You are here

function relation_ui_menu in Relation 7

Implements hook_menu().

File

./relation_ui.module, line 11
Provide administration interface for relation type bundles.

Code

function relation_ui_menu() {
  $items['relation/%relation'] = array(
    'title callback' => 'relation_ui_page_title',
    'title arguments' => array(
      1,
    ),
    'access arguments' => array(
      'access relations',
    ),
    'page callback' => 'relation_ui_page',
    'page arguments' => array(
      1,
    ),
  );
  $items['relation/%relation/view'] = array(
    'title' => 'View',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['relation/%relation/edit'] = array(
    'title' => 'Edit',
    'access arguments' => array(
      'edit relations',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'relation_ui_edit_form',
      1,
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['relation/%relation/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'relation_ui_delete_confirm',
      1,
    ),
    'access arguments' => array(
      'delete relations',
    ),
    'weight' => 10,
    'type' => MENU_LOCAL_TASK,
  );
  if (module_exists('devel')) {
    $items['relation/%relation/devel'] = array(
      'title' => 'Devel',
      'page callback' => 'devel_load_object',
      'page arguments' => array(
        'relation',
        1,
      ),
      'access arguments' => array(
        'access devel information',
      ),
      'type' => MENU_LOCAL_TASK,
      'file path' => drupal_get_path('module', 'devel') . '/',
      'file' => 'devel.pages.inc',
      'weight' => 100,
    );
  }
  $items['admin/structure/relation'] = array(
    'title' => 'Relation types',
    'access arguments' => array(
      'administer relation types',
    ),
    'page callback' => 'relation_ui_type_list',
    'description' => 'Manage relation types, including relation properties (directionality, transitivity etc), available bundles, and fields.',
  );
  $items['admin/structure/relation/list'] = array(
    'title' => 'List',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/structure/relation/add'] = array(
    'title' => 'Add relation type',
    'access arguments' => array(
      'administer relation types',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'relation_ui_type_form',
    ),
    'type' => MENU_LOCAL_ACTION,
    'description' => 'Add new relation types.',
  );
  $items['admin/structure/relation/import'] = array(
    'title' => 'Import relation type',
    'access arguments' => array(
      'use relation import',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'relation_ui_type_import',
    ),
    'type' => MENU_LOCAL_ACTION,
    'description' => 'Import existing relation types.',
  );
  $items['admin/structure/relation/manage/%relation_type'] = array(
    'title' => 'Edit relation type',
    'title callback' => 'relation_ui_type_page_title',
    'title arguments' => array(
      4,
    ),
    'access arguments' => array(
      'administer relation types',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'relation_ui_type_form',
      4,
    ),
    'description' => 'Edit an existing relation type, including relation properties (directionality, transitivity etc), available bundles, and fields.',
  );
  $items['admin/structure/relation/manage/%relation_type/edit'] = array(
    'title' => 'Edit',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/structure/relation/manage/%relation_type/delete'] = array(
    'title' => 'Delete',
    'page arguments' => array(
      'relation_ui_type_delete_confirm',
      4,
    ),
    'access arguments' => array(
      'administer relation types',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 20,
    'description' => 'Delete an existing relation type.',
  );
  if (module_exists('ctools')) {
    $items['admin/structure/relation/manage/%relation_type/export'] = array(
      'title' => 'Export',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'relation_export_relation_type',
        4,
      ),
      'access arguments' => array(
        'export relation types',
      ),
      'type' => MENU_LOCAL_TASK,
      'file' => 'relation.ctools.inc',
      'weight' => 10,
    );
  }
  $items['admin/config/development/generate/relation'] = array(
    'title' => 'Generate relations',
    'access arguments' => array(
      'administer relation types',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'relation_ui_generate_form',
    ),
    'description' => 'Generate relations for testing.',
  );

  // Relations listing.
  $items['admin/content/relation'] = array(
    'title' => 'Relations',
    'file' => 'relation_ui.module',
    'page callback' => 'relation_ui_admin_content',
    'access arguments' => array(
      'administer relations',
    ),
    'description' => 'View, edit and delete all the available relations on your site.',
    'type' => MENU_LOCAL_TASK,
  );
  $items['relation/endpoints_type/autocomplete'] = array(
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer relations',
    ),
    'file' => 'relation_ui.module',
    'page callback' => 'relation_ui_endpoints_type_autocomplete',
  );
  return $items;
}