You are here

function environment_switch_confirm in Environment 6

Same name and namespace in other branches
  1. 7 environment.admin.inc \environment_switch_confirm()

Environment switch form callback.

Parameters

$environment: The environment being switched to.

1 string reference to 'environment_switch_confirm'
environment_menu in ./environment.module
Implementation of hook_menu().

File

./environment.admin.inc, line 88
Settings for Environment module

Code

function environment_switch_confirm(&$form_state, $environment) {
  if (empty($environment)) {
    drupal_set_message(t('Invalid environment "%environment". You cannot switch to an undefined environment.', array(
      '%environment' => $environment,
    )), 'warning');
    drupal_goto('admin/settings/environment');
  }
  return confirm_form(array(
    'environment' => array(
      '#type' => 'hidden',
      '#value' => $environment,
    ),
  ), t('Are you sure you want to switch the current environment?'), 'admin/settings/environment', t('This action switches the current environment to "%env". This kind of change is as risky as updating your site. This action cannot be undone.', array(
    '%env' => $environment,
  )), t('Switch environment'), t('Cancel'));
}