You are here

public function DisqusController::closeWindow in Disqus 8

Menu callback; Automatically closes the window after the user logs in.

Return value

array A render array containing the confirmation message and link that closes overlay window.

1 string reference to 'DisqusController::closeWindow'
disqus.routing.yml in ./disqus.routing.yml
disqus.routing.yml

File

src/Controller/DisqusController.php, line 19

Class

DisqusController
Defines the controller for closing window.

Namespace

Drupal\disqus\Controller

Code

public function closeWindow() {
  $build = [];
  $build['#markup'] = $this
    ->t('Thank you for logging in. Please close this window, or <a href="@clickhere">click here</a> to continue.', [
    '@clickhere' => 'javascript:window.close();',
  ]);
  $build['#attached']['html_head'][] = [
    [
      '#tag' => 'script',
      '#value' => 'window.close();',
    ],
    'disqus_js',
  ];
  return $build;
}