You are here

function lingotek_menu in Lingotek Translation 7.2

Same name and namespace in other branches
  1. 6 lingotek.module \lingotek_menu()
  2. 7.7 lingotek.module \lingotek_menu()
  3. 7.3 lingotek.module \lingotek_menu()
  4. 7.4 lingotek.module \lingotek_menu()
  5. 7.5 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['admin/settings/lingotek'] = array(
    //main menu bar link including module description
    'title' => 'Lingotek',
    'access arguments' => array(
      'administration',
    ),
    'description' => 'The Lingotek module helps you translate and keep your site translated',
    'file' => 'lingotek.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_admin_form',
    ),
  );

  //
  // Enterprise Only Menu Items
  if (LingotekAccount::instance()
    ->isEnterprise()) {
    $items['node/%node/lingotek_pm'] = array(
      'title' => 'Lingotek',
      'access arguments' => array(
        1,
        'pm',
      ),
      'access callback' => 'lingotek_access',
      'file' => 'lingotek.page.inc',
      'page arguments' => array(
        1,
      ),
      'page callback' => 'lingotek_pm',
      'type' => MENU_LOCAL_TASK,
    );
    $items['node/%node/lingotek_dev'] = array(
      'title' => 'Lingotek Developer Tools',
      'access arguments' => array(
        1,
        'dev',
      ),
      'access callback' => 'lingotek_access_dev_tools',
      'description' => 'Developer Tools',
      'file' => 'lingotek.dev.inc',
      'page callback' => 'lingotek_dev_page',
      'page arguments' => array(
        1,
      ),
      'type' => MENU_LOCAL_TASK,
    );
  }
  else {

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

  // Add a link to regional settings
  // Tab:  Settings
  $items['admin/settings/lingotek/settings'] = array(
    'title' => 'Settings',
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
    'access arguments' => array(
      'administration',
    ),
    'description' => 'Community Translation Settings',
    'file' => 'lingotek.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_admin_form',
    ),
  );
  $items[LINGOTEK_BASE_URL . '/settings'] = $items['admin/settings/lingotek/settings'];
  $items[LINGOTEK_BASE_URL . '/cleanup-utility'] = array(
    'title' => 'Lingotek Cleanup Utility',
    'description' => 'This utility helps clean up any node settings that are awry.',
    'access arguments' => array(
      'access lingotek utilities',
    ),
    'file' => 'lingotek.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_form_cleanup_utility',
    ),
    'type' => MENU_NORMAL_ITEM,
  );

  // Content Update Notifications Callback
  $items[LINGOTEK_NOTIFICATIONS_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['admin/settings/lingotek/notifications'] = $items[LINGOTEK_NOTIFICATIONS_URL];

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

  // Gets the Users Current Account Status.
  $items['lingotek/get-account-status'] = array(
    'title' => 'Check the Users Account Status',
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'access content',
    ),
    'description' => 'Check Account Status',
    'file' => 'lingotek.admin.inc',
    'page callback' => 'lingotek_get_account_status',
  );

  // Flushes the Cache
  $items['lingotek/flush-cache'] = array(
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administration',
    ),
    'file' => 'lingotek.admin.inc',
    'page callback' => 'lingotek_flush_cache',
  );
  $items['lingotek/update'] = array(
    'access arguments' => array(
      'pm',
    ),
    'file' => 'lingotek.page.inc',
    'page callback' => 'lingotek_update',
    'type' => MENU_CALLBACK,
  );
  $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,
  );

  // Batch Process Pages ----------------------------------------
  // Sync Process:  Upload documents & Download the Translations
  $items['lingotek/sync'] = array(
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administration',
    ),
    'description' => 'Lingotek Sync Endpoint',
    'file' => 'lingotek.sync.inc',
    'page callback' => 'lingotek_sync',
  );

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

  // START UPLOAD:  Upload documents for the Machine Translation process
  $items['lingotek/upload'] = array(
    'title' => 'Upload Documents For Machine Translation',
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'access content',
    ),
    'file' => 'lingotek.dashboard.inc',
    'page callback' => 'lingotek_dashboard_mt_upload',
  );

  // UPLOAD COMPLETE:  Machine Translation Upload Complete Screen
  $items[LINGOTEK_BASE_URL . '/mt-content-queued'] = array(
    'title' => 'Content Queued for Translation',
    'type' => MENU_CALLBACK,
    'file' => 'lingotek.batch.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_bulk_mt_upload_batch_complete',
    ),
    'access arguments' => array(
      'administration',
    ),
  );

  // START DOWNLOAD: Download documents that have been Machine Translated
  $items['lingotek/download'] = array(
    'title' => 'Download Machine Translated Documents',
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'access content',
    ),
    'file' => 'lingotek.dashboard.inc',
    'page callback' => 'lingotek_dashboard_mt_download',
  );

  // DOWNLOAD COMPLETE: Machine Translation Download Complete Screen
  $items[LINGOTEK_BASE_URL . '/mt-content-downloaded'] = array(
    'title' => 'Download Translated Content',
    'type' => MENU_CALLBACK,
    'file' => 'lingotek.batch.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_bulk_mt_download_batch_complete',
    ),
    'access arguments' => array(
      'administration',
    ),
  );
  $items[LINGOTEK_BASE_URL . '/identify-content'] = array(
    'title' => 'Test',
    'type' => MENU_CALLBACK,
    'weight' => 30,
    'file' => 'lib/Drupal/batch/lingotek.batch.inc',
    'page callback' => 'lingotek_batch_identify_content',
    'access arguments' => array(
      'administration',
    ),
  );

  // 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(
      'administration',
    ),
  );

  // 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(
      'administration',
    ),
  );

  // 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(
      'administration',
    ),
  );
  $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(
      'administration',
    ),
  );
  $items['admin/config/lingotek/project-select'] = array(
    'title' => 'Choose Your Project',
    'description' => 'Select project to use.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_project_select_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administration',
    ),
  );

  // Standard Screens
  $items['admin/config/lingotek/language-settings'] = array(
    'title' => 'Choose Your Languages',
    'description' => 'Manage your Lingotek language settings.',
    'file' => 'lingotek.setup.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'lingotek_setup_language_settings_form',
    ),
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administration',
    ),
  );
  $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(
      'administration',
    ),
  );
  $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(
      'administration',
    ),
  );
  $items['admin/config/lingotek/setup-complete'] = array(
    'title' => 'Setup Complete',
    'description' => 'Your Lingotek 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(
      'administration',
    ),
  );
  $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(
      'administration',
    ),
  );
  return $items;
}