You are here

function name_menu in Name Field 7

Same name and namespace in other branches
  1. 6 name.module \name_menu()

Implements hook_menu().

File

./name.module, line 66
Defines an API for displaying and inputing names.

Code

function name_menu() {
  $items = array();

  // Provides autocomplete functionality for name widgets.
  $items['name/autocomplete/%/%'] = array(
    'title' => 'Name autocomplete',
    'page callback' => 'name_autocomplete',
    'page arguments' => array(
      2,
      3,
    ),
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'name.admin.inc',
  );

  // Admin menu items.
  $items['admin/config/content/name'] = array(
    'title' => 'Name field',
    'page callback' => 'name_list_custom_formats',
    'description' => 'Configure, edit and maintain names and name custom formats.',
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'name.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/config/content/name/formats'] = array(
    'title' => 'Name formats',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/config/content/name/add'] = array(
    'title' => 'Add name format',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'name_custom_formats_form',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'name.admin.inc',
    'type' => MENU_LOCAL_ACTION,
  );
  $items['admin/config/content/name/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'name_admin_settings_form',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'name.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 10,
  );
  $items['admin/config/content/name/%'] = array(
    'title' => 'Edit custom format',
    'page callback' => 'name_custom_format_edit',
    'page arguments' => array(
      4,
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'name.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/content/name/%/delete'] = array(
    'title' => 'Delete custom name format',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'name_custom_format_delete_form',
      4,
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'name.admin.inc',
    'type' => MENU_CALLBACK,
  );
  return $items;
}