public function LingotekDashboardController::dashboardPage in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::dashboardPage()
- 4.0.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::dashboardPage()
- 3.0.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::dashboardPage()
- 3.1.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::dashboardPage()
- 3.2.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::dashboardPage()
- 3.3.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::dashboardPage()
- 3.4.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::dashboardPage()
- 3.5.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::dashboardPage()
- 3.6.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::dashboardPage()
- 3.7.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::dashboardPage()
- 3.8.x src/Controller/LingotekDashboardController.php \Drupal\lingotek\Controller\LingotekDashboardController::dashboardPage()
Presents a dashboard overview page of translation status through Lingotek.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The page request.
Return value
array The dashboard form, or a redirect to the connect page.
1 string reference to 'LingotekDashboardController::dashboardPage'
File
- src/
Controller/ LingotekDashboardController.php, line 106
Class
- LingotekDashboardController
- Returns responses for lingotek module setup routes.
Namespace
Drupal\lingotek\ControllerCode
public function dashboardPage(Request $request) {
if ($redirect = $this
->checkSetup()) {
return $redirect;
}
$cms_data = $this
->getDashboardInfo();
$build = [];
$this
->moduleHandler()
->loadInclude('locale', 'install');
$requirements = locale_requirements('runtime');
$build['#attached']['library'][] = 'lingotek/lingotek.dashboard';
$build['#attached']['drupalSettings']['lingotek']['cms_data'] = $cms_data;
$build['#title'] = $this
->t('Dashboard');
$build['ltk-dashboard'] = [
'#type' => 'container',
'#attributes' => [
'ltk-dashboard' => '',
'ng-app' => 'LingotekApp',
'style' => 'margin-top: -15px;',
],
];
if (isset($requirements['locale_translation']) && isset($requirements['locale_translation']['description'])) {
drupal_set_message($requirements['locale_translation']['description'], 'warning');
}
return $build;
}