You are here

function search_by_page_delete_confirm in Search by Page 8

Same name and namespace in other branches
  1. 6 search_by_page.module \search_by_page_delete_confirm()
  2. 7 search_by_page.module \search_by_page_delete_confirm()

Returns a form confirming deletion of an environment.

See also

search_by_page_delete_confirm_submit()

1 string reference to 'search_by_page_delete_confirm'
search_by_page_menu in ./search_by_page.module
Implements hook_menu().

File

./search_by_page.module, line 1301
Main module file for Drupal module Search by Page.

Code

function search_by_page_delete_confirm($form, $form_state, $envid) {
  $envname = search_by_page_setting_get('environment_name', $envid, t('new'));
  if (\Drupal::moduleHandler()
    ->moduleExists('i18n_string')) {
    $envname = i18n_string_translate('search_by_page:environment:name' . $envid, $envname);
  }
  $form = [
    'envid' => [
      '#type' => 'value',
      '#value' => $envid,
    ],
  ];
  $output = confirm_form($form, t('Are you sure you want to delete environment %env?', [
    '%env' => $envname,
  ]), 'admin/config/search/search_by_page');
  return $output;
}