You are here

function ad_notify_confirm_delete in Advertisement 6

Same name and namespace in other branches
  1. 5.2 notify/ad_notify.module \ad_notify_confirm_delete()
  2. 5 notify/ad_notify.module \ad_notify_confirm_delete()

Confirm deletion of a specified notification from the database.

1 string reference to 'ad_notify_confirm_delete'
ad_notify_confirm_delete_page in notify/ad_notify.module
Display confirm form.

File

notify/ad_notify.module, line 526
Receive email notifications regarding ads.

Code

function ad_notify_confirm_delete(&$form_state, $node, $owner, $notification) {
  $form = array();
  $form['oid'] = array(
    '#type' => 'hidden',
    '#value' => $notification->oid,
  );
  $form['aid'] = array(
    '#type' => 'hidden',
    '#value' => $node->nid,
  );
  $form['uid'] = array(
    '#type' => 'hidden',
    '#value' => $owner->uid,
  );
  $form['notid'] = array(
    '#type' => 'hidden',
    '#value' => $notification->notid,
  );
  $form['locked'] = array(
    '#type' => 'hidden',
    '#value' => $notification->locked,
  );
  $form['event'] = array(
    '#type' => 'fieldset',
    '#collapsible' => FALSE,
  );
  $notifications = module_invoke_all('adnotifyapi', 'register');
  $form['event']['type'] = array(
    '#type' => 'markup',
    '#value' => t($notifications[$notification->event], array(
      '@when' => format_interval($notification->delay),
    )),
    '#prefix' => '<div class="container-inline">',
    '#suffix' => '</div>',
  );
  $form = confirm_form($form, 'Are you sure you want to delete this notification?', 'node/' . $node->nid . '/adowners/' . $owner->uid . '/notifications', 'This action cannot be undone.', 'Delete', 'Cancel');
  return $form;
}