locale_menu

Versions
4.6 – 5
locale_menu($may_cache)
6 – 7
locale_menu()

Implementation of hook_menu().

Code

modules/locale.module, line 54

<?php
function locale_menu($may_cache) {
  $items = array();
  $access = user_access('administer locales');

  if ($may_cache) {
    // Main admin menu item
    $items[] = array('path' => 'admin/locale',
      'title' => t('localization'),
      'callback' => 'locale_admin_manage',
      'access' => $access);

    // Top level tabs
    $items[] = array('path' => 'admin/locale/language',
      'title' => t('manage languages'),
      'access' => $access,
      'weight' => -10,
      'type' => MENU_DEFAULT_LOCAL_TASK);
    $items[] = array('path' => 'admin/locale/string/search',
      'title' => t('manage strings'),
      'callback' => 'locale_string_search',
      'access' => $access,
      'weight' => 10,
      'type' => MENU_LOCAL_TASK);

    // Manage languages subtabs
    $items[] = array('path' => 'admin/locale/language/overview',
      'title' => t('list'),
      'callback' => 'locale_admin_manage',
      'access' => $access,
      'weight' => 0,
      'type' => MENU_DEFAULT_LOCAL_TASK);
    $items[] = array('path' => 'admin/locale/language/add',
      'title' => t('add language'),
      'callback' => 'locale_admin_manage_add',
      'access' => $access,
      'weight' => 5,
      'type' => MENU_LOCAL_TASK);
    $items[] = array('path' => 'admin/locale/language/import',
      'title' => t('import'),
      'callback' => 'locale_admin_import',
      'access' => $access,
      'weight' => 10,
      'type' => MENU_LOCAL_TASK);
    $items[] = array('path' => 'admin/locale/language/export',
      'title' => t('export'),
      'callback' => 'locale_admin_export',
      'access' => $access,
      'weight' => 20,
      'type' => MENU_LOCAL_TASK);

    // Language related callbacks
    $items[] = array('path' => 'admin/locale/language/delete',
      'title' => t('confirm'),
      'callback' => 'locale_admin_manage_delete_form',
      'access' => $access,
      'type' => MENU_CALLBACK);
  }
  else {
    if (is_numeric(arg(4))) {
      // String related callbacks
      $items[] = array('path' => 'admin/locale/string/edit/'. arg(4),
        'title' => t('edit string'),
        'callback' => 'locale_admin_string_edit',
        'callback arguments' => arg(4),
        'access' => $access,
        'type' => MENU_CALLBACK);
      $items[] = array('path' => 'admin/locale/string/delete/'. arg(4),
        'title' => t('delete string'),
        'callback' => 'locale_admin_string_delete',
        'callback arguments' => arg(4),
        'access' => $access,
        'type' => MENU_CALLBACK);
    }
  }

  return $items;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.