You are here

function warden_add_site in Warden 7

Same name and namespace in other branches
  1. 6 warden.admin.inc \warden_add_site()

Form submission callback.

_state

Parameters

$form:

Throws

Exception

1 string reference to 'warden_add_site'
warden_form in ./warden.admin.inc
Page callback: System settings settings.

File

./warden.admin.inc, line 47
Admin forms for warden

Code

function warden_add_site($form, &$form_state) {
  global $base_url;
  $site_url = $base_url;
  $site_url .= "|" . _warden_get_local_token();
  $site_url_encrypted = warden_get_api()
    ->encrypt($site_url);
  $site_host_path = variable_get('warden_server_host_path', '');
  $url = $site_host_path . '/sites/add?data=' . $site_url_encrypted;
  if (module_exists('overlay') && overlay_get_mode() == 'child') {
    unset($_GET['destination']);
    overlay_close_dialog($url, array(
      'external' => TRUE,
    ));
    $form_state['redirect'] = FALSE;
  }
  else {
    $form_state['redirect'] = $url;
  }
}