You are here

protected function LingotekDashboardController::getDashboardInfo in Lingotek Translation 3.2.x

Same name and namespace in other branches
  1. 8 src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::getDashboardInfo()
  2. 8.2 src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::getDashboardInfo()
  3. 4.0.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::getDashboardInfo()
  4. 3.0.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::getDashboardInfo()
  5. 3.1.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::getDashboardInfo()
  6. 3.3.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::getDashboardInfo()
  7. 3.4.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::getDashboardInfo()
  8. 3.5.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::getDashboardInfo()
  9. 3.6.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::getDashboardInfo()
  10. 3.7.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::getDashboardInfo()
  11. 3.8.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::getDashboardInfo()
1 call to LingotekDashboardController::getDashboardInfo()
LingotekDashboardController::dashboardPage in src/Controller/LingotekDashboardController.php
Presents a dashboard overview page of translation status through Lingotek.

File

src/Controller/LingotekDashboardController.php, line 261

Class

LingotekDashboardController
Returns responses for lingotek module setup routes.

Namespace

Drupal\lingotek\Controller

Code

protected function getDashboardInfo() {
  global $base_url, $base_root;
  $config = $this->configFactory
    ->get('lingotek.settings');
  return [
    "community_id" => $config
      ->get('default.community'),
    "external_id" => $config
      ->get('account.login_id'),
    "vault_id" => $config
      ->get('default.vault'),
    "workflow_id" => $config
      ->get('default.workflow'),
    "project_id" => $config
      ->get('default.project'),
    "first_name" => 'Drupal User',
    "last_name" => '',
    "email" => $config
      ->get('account.login_id'),
    // CMS data that will be used for building the dashboard with JS.
    "cms_site_id" => $base_url,
    "cms_site_key" => $base_url,
    "cms_site_name" => 'Drupal Site',
    "cms_type" => 'Drupal',
    "cms_version" => 'VERSION HERE',
    "cms_tag" => 'CMS TAG HERE',
    // FIX: should be the currently selected locale
    "locale" => "en_US",
    "module_version" => '1.x',
    "endpoint_url" => $this->urlGenerator
      ->generateFromRoute('lingotek.dashboard_endpoint'),
  ];
}