You are here

function htaccess_confirm_form in Htaccess 7.2

Admin htaccess confirm form

1 string reference to 'htaccess_confirm_form'
htaccess_menu in ./htaccess.module
Implementation of hook_menu()

File

./htaccess.admin.inc, line 231
Administration pages.

Code

function htaccess_confirm_form($form, $form_state, $action, $id) {
  $htaccess_data = db_select('htaccess', 'h')
    ->fields('h')
    ->condition('id', array(
    ':id' => $id,
  ), 'IN')
    ->execute()
    ->fetchAssoc();
  $profile_name = $htaccess_data['name'];
  $profile_id = $id;
  $form['action'] = array(
    '#type' => 'value',
    '#value' => $action,
  );
  $form['profile_id'] = array(
    '#type' => 'value',
    '#value' => $profile_id,
  );
  switch ($action) {
    case 'deploy':
      $confirm_form = confirm_form($form, t('Are you sure you want to deploy the htaccess profile %profile_name?', array(
        '%profile_name' => $profile_name,
      )), 'admin/config/system/htaccess/deployment', t('The htaccess %profile_name will be deployed.', array(
        '%profile_name' => $profile_name,
      )), t('Deploy'), t('Cancel'));
      break;
    case 'delete':
      $confirm_form = confirm_form($form, t('Are you sure you want to delete the htaccess profile %profile_name?', array(
        '%profile_name' => $profile_name,
      )), 'admin/config/system/htaccess/deployment', t('The htaccess %profile_name will be deleted. This action cannot be undone.', array(
        '%profile_name' => $profile_name,
      )), t('Delete'), t('Cancel'));
      break;
  }
  return $confirm_form;
}