You are here

function tracking_code_delete_form in Tracking Code 7

Form for deleting codeblocks (admin/structure/tracking_code/%/delete).

Parameters

(int) $delta: the array index of the codeblock to edit

Return value

array a renderable Form API array or 404

1 string reference to 'tracking_code_delete_form'
tracking_code_menu in ./tracking_code.module
Implements hook_menu().

File

./tracking_code.admin.inc, line 317
admin page callbacks and form handlers for the tracking code module

Code

function tracking_code_delete_form($form, &$form_state, $delta) {
  $snippet = _tracking_code_read($delta);

  // Don't show a blank delete form.
  if (!$snippet) {
    drupal_not_found();
    exit;
  }
  $form['delta'] = array(
    '#type' => 'hidden',
    '#value' => $delta,
  );
  $form['snippet_name'] = array(
    '#type' => 'hidden',
    '#values' => $snippet['name'],
  );
  return confirm_form($form, t('Are you sure you want to delete the tracking code snippet %name?', array(
    '%name' => $snippet['name'],
  )), 'admin/structure/tracking_code', '', t('Delete'), t('Cancel'));
}