You are here

function system_status_add_site in System Status 8

Same name and namespace in other branches
  1. 6.2 system_status.admin.inc \system_status_add_site()
1 string reference to 'system_status_add_site'
SystemStatusSettingsForm::buildForm in src/Form/SystemStatusSettingsForm.php
Form constructor.

File

./system_status.module, line 71
Drupal system status

Code

function system_status_add_site($form, &$form_state) {
  global $base_url;
  $config = \Drupal::config('system_status.settings');
  $siteUrl = urlencode($base_url);
  $siteUrl .= "|" . $config
    ->get('system_status_token');
  $siteUrl .= "|" . $config
    ->get('system_status_encrypt_token');
  $url = "https://www.drupalstatus.org/addsite?op=addSite&siteUrl={$siteUrl}";
  if (Drupal::moduleHandler()
    ->moduleExists('overlay') && overlay_get_mode() == 'child') {
    unset($_GET['destination']);
    overlay_close_dialog($url, array(
      'external' => TRUE,
    ));
    $form_state['redirect'] = FALSE;
  }
  else {
    $form_state['redirect'] = $url;
  }
}