You are here

function l10n_client_menu in Localization client 6.2

Same name and namespace in other branches
  1. 5 l10n_client.module \l10n_client_menu()
  2. 6 l10n_client.module \l10n_client_menu()
  3. 7 l10n_client.module \l10n_client_menu()

Implementation of hook_menu().

File

./l10n_client.module, line 16
Localization client. Provides on-page translation editing.

Code

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

  // AJAX callback path for strings.
  $items['l10n_client/save'] = array(
    'title' => 'Save string',
    'page callback' => 'l10n_client_save_string',
    'access callback' => 'l10n_client_access',
    'type' => MENU_CALLBACK,
  );

  // Helper pages to group all translated/untranslated strings.
  $items['locale'] = array(
    'title' => 'Translate strings',
    'page callback' => 'l10n_client_translate_page',
    'access callback' => 'l10n_client_access',
  );
  $items['locale/untranslated'] = array(
    'title' => 'Untranslated',
    'page arguments' => array(
      'untranslated',
    ),
    'access callback' => 'l10n_client_access',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['locale/translated'] = array(
    'title' => 'Translated',
    'page arguments' => array(
      'translated',
    ),
    'access callback' => 'l10n_client_access',
    'type' => MENU_LOCAL_TASK,
    'weight' => 10,
  );

  // Direct copy of the Configure tab from locale module to
  // make space for the "Localization sharing" tab below.
  $items['admin/settings/language/configure/language'] = array(
    'title' => 'Language negotiation',
    'page callback' => 'locale_inc_callback',
    'page arguments' => array(
      'drupal_get_form',
      'locale_languages_configure_form',
    ),
    'access arguments' => array(
      'administer languages',
    ),
    'weight' => -10,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/settings/language/configure/l10n_client'] = array(
    'title' => 'Localization sharing',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'l10n_client_settings_form',
    ),
    'access arguments' => array(
      'administer languages',
    ),
    'weight' => 5,
    'type' => MENU_LOCAL_TASK,
    'file' => 'l10n_client.admin.inc',
  );
  return $items;
}