You are here

function lingotek_menu in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 6 lingotek.module \lingotek_menu()
  2. 7.7 lingotek.module \lingotek_menu()
  3. 7.2 lingotek.module \lingotek_menu()
  4. 7.3 lingotek.module \lingotek_menu()
  5. 7.4 lingotek.module \lingotek_menu()
  6. 7.6 lingotek.module \lingotek_menu()

Implements hook_menu().

File

./lingotek.module, line 37

Code

function lingotek_menu() {
  $items = array();
  $items[LINGOTEK_MENU_MAIN_BASE_URL] = array(
    //main menu bar link including module description
    'title' => 'Translation',
    'access arguments' => array(
      'administer lingotek',
    ),
    'description' => "Translate and keep your site translated using Lingotek.",
    'file' => 'lingotek.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_admin_form',
    ),
  );
  $items['node/%node/lingotek_pm'] = array(
    'title' => 'Translations',
    'access arguments' => array(
      1,
      'manage projects',
    ),
    'access callback' => 'lingotek_access',
    // Enterprise Only Function
    'file' => 'lingotek.page.inc',
    'page arguments' => array(
      1,
    ),
    'page callback' => 'lingotek_pm',
    'weight' => 1,
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%/lingotekworkbench/%'] = array(
    'title' => 'Workbench',
    'access arguments' => array(
      'translation',
    ),
    'file' => 'lingotek.page.inc',
    'page arguments' => array(
      0,
      1,
      3,
    ),
    'page callback' => 'lingotek_workbench_redirect',
    'weight' => 1,
    'type' => MENU_CALLBACK,
  );
  $items['comment/%/lingotekworkbench/%'] = array(
    'title' => 'Workbench',
    'access arguments' => array(
      'translation',
    ),
    'file' => 'lingotek.page.inc',
    'page arguments' => array(
      0,
      1,
      3,
    ),
    'page callback' => 'lingotek_workbench_redirect',
    'weight' => 1,
    'type' => MENU_CALLBACK,
  );
  $items['lingotek/workbench/%/%/%'] = array(
    // lingotek/workbench/entity_type/entity_id/lingotek_locale
    'title' => 'Workbench',
    'access arguments' => array(
      'translation',
    ),
    'file' => 'lingotek.page.inc',
    'page arguments' => array(
      2,
      3,
      4,
    ),
    // entity_type, entity_id, lingotek_locale
    'page callback' => 'lingotek_workbench_redirect',
    'weight' => 1,
    'type' => MENU_CALLBACK,
  );
  $items['lingotek/view/%/%/%'] = array(
    // lingotek/view/entity_type/entity_id/lingotek_locale
    'title' => '',
    'file' => 'lingotek.page.inc',
    'access arguments' => array(
      'access content',
    ),
    'page arguments' => array(
      2,
      3,
      4,
    ),
    'page callback' => 'lingotek_entity_view_redirect',
    'weight' => 1,
    'type' => MENU_CALLBACK,
  );
  $items['lingotek/utility/%'] = array(
    'title' => '',
    'file' => 'lingotek.util.inc',
    'access arguments' => array(
      'administer lingotek',
    ),
    'page arguments' => array(
      2,
    ),
    'page callback' => 'lingotek_utility_router',
    'weight' => 1,
    'type' => MENU_CALLBACK,
  );
  $items['node/%node/lingotek_dev'] = array(
    'title' => 'Lingotek Developer Tools',
    'access callback' => 'lingotek_access_dev_tools',
    // Enterprise Only Function
    'access arguments' => array(
      1,
      'use lingotek developer tools',
    ),
    'description' => 'Developer Tools',
    'file' => 'lingotek.dev.inc',
    'page callback' => 'lingotek_dev_page',
    'page arguments' => array(
      1,
    ),
    'weight' => 2,
    'type' => MENU_LOCAL_TASK,
  );

  // Use the Standard Dashboard Interface
  // Lingotek Dashboard and Settings Tabs
  $items[LINGOTEK_MENU_MAIN_BASE_URL] = array_merge($items[LINGOTEK_MENU_MAIN_BASE_URL], array(
    'file' => 'lingotek.dashboard.inc',
    'page callback' => 'lingotek_dashboard',
    'weight' => 1,
    'type' => MENU_NORMAL_ITEM,
  ));
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/dashboard'] = array(
    'title' => 'Dashboard',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'file' => 'lingotek.dashboard.inc',
    'page callback' => 'lingotek_dashboard',
    'weight' => 1,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items[LINGOTEK_MENU_LANG_BASE_URL . '/dashboard'] = $items[LINGOTEK_MENU_MAIN_BASE_URL . '/dashboard'];
  $items[LINGOTEK_MENU_LANG_BASE_URL] = $items[LINGOTEK_MENU_MAIN_BASE_URL];

  // Add a link to regional settings
  $items[LINGOTEK_MENU_LANG_BASE_URL]['title'] = 'Lingotek Translation';
  $items[LINGOTEK_MENU_MAIN_BASE_URL]['access callback'] = 'lingotek_access_tlmi';

  // Tab:  Settings
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/settings'] = array(
    'title' => 'Settings',
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
    'access arguments' => array(
      'administer lingotek',
    ),
    'description' => 'Community Translation Settings',
    'file' => 'lingotek.admin.inc',
    'page callback' => 'lingotek_admin_configuration_view',
  );
  $items[LINGOTEK_MENU_LANG_BASE_URL . '/settings'] = $items[LINGOTEK_MENU_MAIN_BASE_URL . '/settings'];
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/settings/profile/%'] = array(
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
    'file' => 'lingotek.admin.inc',
    'page callback' => 'lingotek_admin_profile_manage',
    'page arguments' => array(
      5,
    ),
  );

  // Tab: Bulk Management
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/sync'] = array(
    'title' => 'Config',
    'type' => MENU_LOCAL_TASK,
    'weight' => 4,
    'access arguments' => array(
      'administer lingotek',
    ),
    'description' => 'Bulk management of config translations',
    'file' => 'lingotek.sync.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_form_bulk_sync',
    ),
  );
  $items[LINGOTEK_MENU_LANG_BASE_URL . '/manage/sync'] = $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/sync'];

  // Content Update Notifications Callback
  $items[LINGOTEK_NOTIFY_URL] = array(
    'title' => 'Content Translation Notifications',
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'access content',
    ),
    'description' => 'When content translations are ready, this receives the notifications.',
    'file' => 'lingotek.sync.inc',
    'page callback' => 'lingotek_notifications',
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/notifications'] = $items[LINGOTEK_NOTIFY_URL];

  // allow early auto-provision community callback urls to wor
  // Dashboard:  Ajax Command Processor
  $items['lingotek/language'] = array(
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
    'description' => 'Lingotek Command Router',
    'file' => 'lingotek.dashboard.inc',
    'page callback' => 'lingotek_dashboard_command_ajax',
  );

  // Admin Configuration
  $items[LINGOTEK_MENU_LANG_BASE_URL . '/config'] = array(
    'title' => 'Lingotek Configuration Options',
    'description' => 'The configuration options',
    'file' => 'lingotek.admin.inc',
    'page callback' => 'lingotek_admin_configuration_view',
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items['lingotek/sync/comment/%'] = array(
    'access arguments' => array(
      'administer comments',
    ),
    'file' => 'lingotek.page.inc',
    'page callback' => 'page_sync_comment_translations',
    'page arguments' => array(
      3,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['lingotek/mark-phases-complete/%node'] = array(
    'access arguments' => array(
      'access content',
    ),
    'file' => 'includes/lingotek.ajax.inc',
    'page callback' => 'lingotek_page_mark_phases_complete',
    'page arguments' => array(
      2,
    ),
    'type' => MENU_CALLBACK,
  );

  //Tab: Bulk Grid
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage'] = array(
    'title' => 'Manage',
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
    'access arguments' => array(
      'administer lingotek',
    ),
    'description' => 'Bulk grid of content translations',
    'file' => 'lingotek.bulk_grid.inc',
    'page callback' => 'lingotek_manage_callback',
    'page arguments' => array(
      'lingotek_bulk_grid_form',
    ),
  );
  $items[LINGOTEK_MENU_LANG_BASE_URL . '/manage'] = $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage'];
  $entity_types = lingotek_managed_entity_types();
  foreach ($entity_types as $machine_name => $entity_type) {
    $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/' . $machine_name] = array(
      'title' => $entity_type['label'],
      'description' => 'Bulk grid of content translations',
      'type' => $machine_name == 'node' ? MENU_LOCAL_TASK : MENU_LOCAL_TASK,
      'weight' => $machine_name == 'node' ? -9 : -8,
      'access arguments' => array(
        'administer lingotek',
      ),
      'description' => 'Bulk grid of content translations',
      'file' => 'lingotek.bulk_grid.inc',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'lingotek_bulk_grid_form',
      ),
    );
    $items[LINGOTEK_MENU_LANG_BASE_URL . '/manage/' . $machine_name] = $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/' . $machine_name];
  }
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/customize'] = array(
    'access arguments' => array(
      'administer lingotek',
    ),
    'file' => 'lingotek.bulk_grid.inc',
    'page callback' => 'lingotek_grid_customize',
    'page arguments' => array(),
    'type' => MENU_CALLBACK,
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/filters'] = array(
    'access arguments' => array(
      'administer lingotek',
    ),
    'file' => 'lingotek.bulk_grid.inc',
    'page callback' => 'lingotek_filters_popup',
    'page arguments' => array(),
    'type' => MENU_CALLBACK,
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/filters/clear/%'] = array(
    'access arguments' => array(
      'administer lingotek',
    ),
    'file' => 'lingotek.bulk_grid.inc',
    'page callback' => 'lingotek_grid_clear_filters_page',
    'page arguments' => array(
      6,
    ),
    'type' => MENU_CALLBACK,
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/update/%'] = array(
    'access arguments' => array(
      'administer lingotek',
    ),
    'file' => 'lingotek.bulk_grid.inc',
    'page callback' => 'lingotek_grid_update',
    'page arguments' => array(
      5,
    ),
    'type' => MENU_CALLBACK,
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/download-ready/%'] = array(
    'access arguments' => array(
      'administer lingotek',
    ),
    'file' => 'lingotek.bulk_grid.inc',
    'page callback' => 'lingotek_grid_download_ready',
    'page arguments' => array(
      5,
    ),
    'type' => MENU_CALLBACK,
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/upload-edited/%'] = array(
    'access arguments' => array(
      'administer lingotek',
    ),
    'file' => 'lingotek.bulk_grid.inc',
    'page callback' => 'lingotek_grid_upload_edited',
    'page arguments' => array(
      5,
    ),
    'type' => MENU_CALLBACK,
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/edit/%/%'] = array(
    'access arguments' => array(
      'administer lingotek',
    ),
    'file' => 'lingotek.bulk_grid.inc',
    'page callback' => 'lingotek_edit_nodes',
    'page arguments' => array(
      5,
      6,
    ),
    'type' => MENU_CALLBACK,
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/change-workflow/%/%'] = array(
    'access arguments' => array(
      'administer lingotek',
    ),
    'file' => 'lingotek.bulk_grid.inc',
    'page callback' => 'lingotek_change_workflow',
    'page arguments' => array(
      5,
      6,
    ),
    //'page callback' => 'lingotek_popup',

    //'page arguments' => array('get_change_workflow', 5, 6),
    'type' => MENU_CALLBACK,
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/delete/%/%'] = array(
    'access arguments' => array(
      'administer lingotek',
    ),
    'file' => 'lingotek.bulk_grid.inc',
    'page callback' => 'lingotek_popup',
    'page arguments' => array(
      'entity_delete',
      5,
      6,
    ),
    'type' => MENU_CALLBACK,
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/manage/reset/%/%'] = array(
    'access arguments' => array(
      'administer lingotek',
    ),
    'file' => 'lingotek.bulk_grid.inc',
    'page callback' => 'lingotek_popup',
    'page arguments' => array(
      'entity_disassociate',
      5,
      6,
    ),
    'type' => MENU_CALLBACK,
  );

  // Batch Process Pages ----------------------------------------
  // Sync Progress Report
  $items['lingotek/sync/report'] = array(
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
    'description' => 'Lingotek Sync Endpoint',
    'file' => 'lingotek.sync.inc',
    'page callback' => 'lingotek_sync_endpoint',
  );

  // Easy Install Screens ----------------------------------------
  // Setup Path Router
  $items['admin/config/lingotek/setup'] = array(
    'title' => 'Lingotek Setup Path Router',
    'description' => 'Figures out the necessary setup path.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_setup',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );

  // New Account
  $items['admin/config/lingotek/new-account'] = array(
    'title' => 'Create a Lingotek Account',
    'description' => 'Setup a new Lingotek account.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_setup_new_account_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );

  // Current Users
  $items['admin/config/lingotek/account-settings'] = array(
    'title' => 'Lingotek Account Login',
    'description' => 'Manage your Lingotek account settings.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_setup_account_settings_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items['admin/config/lingotek/community-select'] = array(
    'title' => 'Choose Your Community',
    'description' => 'Select a community to use with this site.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_community_select_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items['admin/config/lingotek/project-vault-select'] = array(
    'title' => 'Choose Your Project, Workflow, and TM Vault',
    'description' => 'Select project, workflow, and translation memory vault to use.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_project_vault_select_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items['admin/config/lingotek/node-translation-settings'] = array(
    'title' => 'Enable Content Types',
    'description' => 'Select the nodes and fields you want translated.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_setup_node_translation_settings_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items['admin/config/lingotek/comment-translation-settings'] = array(
    'title' => 'Enable Comment Translation',
    'description' => 'Select any node types you want the comments translated.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_setup_comment_translation_settings_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items['admin/config/lingotek/additional-translation-settings'] = array(
    'title' => 'Enable Additional Translation',
    'description' => 'Select any additional types you want translated.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_setup_additional_translation_settings_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items['admin/config/lingotek/content-type-choose-fields-ajax/%'] = array(
    'title' => 'Content Types Ajax',
    'description' => 'Ajax functionality for content options.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'lingotek_content_type_choose_fields_callback',
    'page arguments' => array(
      4,
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items['admin/config/lingotek/setup-language-switcher'] = array(
    'title' => 'Enable Language Switcher',
    'description' => 'Enable the default language switcher',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_setup_language_switcher_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items['admin/config/lingotek/setup-complete'] = array(
    'title' => 'Setup Complete',
    'description' => 'The Lingotek Translation module has been configured and is now ready to use.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_setup_complete_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items['admin/config/lingotek/node-updates'] = array(
    'title' => 'Lingotek Node Updates',
    'description' => 'Updates your nodes to support multiple languages.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_setup_node_updates_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/disassociate'] = array(
    //'title' => 'Lingotek Disassociate All Content',
    'description' => 'This will disassociate all content from their translation',
    'file' => 'lingotek.admin.inc',
    'page callback' => 'lingotek_disassociate_all_translations',
    'page arguments' => array(),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  $items[LINGOTEK_MENU_MAIN_BASE_URL . '/clearexceptions/%'] = array(
    'description' => 'Remove all one-off profiles',
    'file' => 'lingotek.module',
    'page callback' => 'lingotek_clear_exceptions_modal',
    'page arguments' => array(
      4,
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer lingotek',
    ),
  );
  return $items;
}