You are here

function locale_menu in Drupal 6

Same name and namespace in other branches
  1. 4 modules/locale.module \locale_menu()
  2. 5 modules/locale/locale.module \locale_menu()
  3. 7 modules/locale/locale.module \locale_menu()

Implementation of hook_menu().

Locale module only provides administrative menu items, so all menu items are invoked through locale_inc_callback().

File

modules/locale/locale.module, line 72
Add language handling functionality and enables the translation of the user interface to languages other than English.

Code

function locale_menu() {

  // Manage languages
  $items['admin/settings/language'] = array(
    'title' => 'Languages',
    'description' => 'Configure languages for content and the user interface.',
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'drupal_get_form',
      'locale_languages_overview_form',
    ),
    'access arguments' => array(
      'administer languages',
    ),
  );
  $items['admin/settings/language/overview'] = array(
    'title' => 'List',
    'weight' => 0,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/settings/language/add'] = array(
    'title' => 'Add language',
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'locale_languages_add_screen',
    ),
    // two forms concatenated
    'access arguments' => array(
      'administer languages',
    ),
    'weight' => 5,
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/settings/language/configure'] = array(
    'title' => 'Configure',
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'drupal_get_form',
      'locale_languages_configure_form',
    ),
    'access arguments' => array(
      'administer languages',
    ),
    'weight' => 10,
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/settings/language/edit/%'] = array(
    'title' => 'Edit language',
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'drupal_get_form',
      'locale_languages_edit_form',
      4,
    ),
    'access arguments' => array(
      'administer languages',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/settings/language/delete/%'] = array(
    'title' => 'Confirm',
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'drupal_get_form',
      'locale_languages_delete_form',
      4,
    ),
    'access arguments' => array(
      'administer languages',
    ),
    'type' => MENU_CALLBACK,
  );

  // Translation functionality
  $items['admin/build/translate'] = array(
    'title' => 'Translate interface',
    'description' => 'Translate the built in interface and optionally other text.',
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'locale_translate_overview_screen',
    ),
    // not a form, just a table
    'access arguments' => array(
      'translate interface',
    ),
  );
  $items['admin/build/translate/overview'] = array(
    'title' => 'Overview',
    'weight' => 0,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/build/translate/search'] = array(
    'title' => 'Search',
    'weight' => 10,
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'locale_translate_seek_screen',
    ),
    // search results and form concatenated
    'access arguments' => array(
      'translate interface',
    ),
  );
  $items['admin/build/translate/import'] = array(
    'title' => 'Import',
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'drupal_get_form',
      'locale_translate_import_form',
    ),
    'access arguments' => array(
      'translate interface',
    ),
    'weight' => 20,
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/build/translate/export'] = array(
    'title' => 'Export',
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'locale_translate_export_screen',
    ),
    // possibly multiple forms concatenated
    'access arguments' => array(
      'translate interface',
    ),
    'weight' => 30,
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/build/translate/edit/%'] = array(
    'title' => 'Edit string',
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'drupal_get_form',
      'locale_translate_edit_form',
      4,
    ),
    'access arguments' => array(
      'translate interface',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/build/translate/delete/%'] = array(
    'title' => 'Delete string',
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'locale_translate_delete_page',
      4,
    ),
    'access arguments' => array(
      'translate interface',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}