You are here

function abjs_test_delete_confirm_form in A/B Test JS 7

Returns confirmation form for deleting a test.

1 string reference to 'abjs_test_delete_confirm_form'
abjs_menu in ./abjs.module
Implements hook_menu().

File

./abjs.admin.inc, line 537
Admin forms to view/add/edit/delete tests, conditions, experiences.

Code

function abjs_test_delete_confirm_form($form, &$form_state, $tid) {
  $form = array();
  $test_result = db_query('SELECT name FROM {abjs_test} WHERE tid = :tid', array(
    ':tid' => $tid,
  ));
  if (!empty($test_result)) {
    $form['tid'] = array(
      '#type' => 'value',
      '#value' => $tid,
    );
    $test = $test_result
      ->fetchObject();
    $form['name'] = array(
      '#type' => 'value',
      '#value' => $test->name,
    );
    return confirm_form($form, t('Are you sure you want to delete this test: %name?', array(
      '%name' => $test->name,
    )), 'admin/config/user-interface/abjs/tests', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
  }
  return $form;
}