You are here

function synonyms_menu in Synonyms 7

Implements hook_menu().

File

./synonyms.module, line 11
Provide synonyms feature for Drupal entities.

Code

function synonyms_menu() {
  $items = array();
  $items['admin/structure/synonyms'] = array(
    'title' => 'Synonyms',
    'description' => 'Manage synonyms settings for all entity types.',
    'page callback' => 'synonyms_settings_overview',
    'access arguments' => array(
      'administer synonyms',
    ),
    'file' => 'synonyms.pages.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/structure/synonyms/%synonyms_entity_type/%synonyms_bundle'] = array(
    'title' => 'Synonyms settings',
    'title callback' => 'synonyms_settings_title',
    'title arguments' => array(
      3,
      4,
    ),
    'description' => 'Manage synonyms settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'synonyms_settings_form',
      3,
      4,
    ),
    'access arguments' => array(
      'administer synonyms',
    ),
    'load arguments' => array(
      3,
    ),
    'file' => 'synonyms.pages.inc',
  );
  if (module_exists('taxonomy')) {
    $items['synonyms/autocomplete-taxonomy-term/%/%/%'] = array(
      'title' => 'Autocomplete Synonyms',
      'page callback' => 'synonyms_autocomplete_taxonomy_term',
      'page arguments' => array(
        2,
        3,
        4,
      ),
      'access arguments' => array(
        'access content',
      ),
      'file' => 'synonyms.pages.inc',
      'type' => MENU_CALLBACK,
    );
  }
  $items['synonyms/autocomplete-entity/%/%/%'] = array(
    'title' => 'Autocomplete Synonyms',
    'page callback' => 'synonyms_autocomplete_entity',
    'page arguments' => array(
      2,
      3,
      4,
    ),
    'access callback' => 'entityreference_autocomplete_access_callback',
    'access arguments' => array(
      'tags',
      2,
      3,
      4,
    ),
    'file' => 'synonyms.pages.inc',
    'type' => MENU_CALLBACK,
  );
  return $items;
}