You are here

function ad_notify_confirm_delete in Advertisement 5

Same name and namespace in other branches
  1. 5.2 notify/ad_notify.module \ad_notify_confirm_delete()
  2. 6 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 466
Receive email notifications regarding ads.

Code

function ad_notify_confirm_delete($notification, $aid, $uid) {
  $form = array();
  $form['oid'] = array(
    '#type' => 'hidden',
    '#value' => $notification->oid,
  );
  $form['aid'] = array(
    '#type' => 'hidden',
    '#value' => $aid,
  );
  $form['uid'] = array(
    '#type' => 'hidden',
    '#value' => $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, t('Are you sure you want to delete this notification?'), "node/{$aid}/adowners/{$uid}/notifications", t('This action cannot be undone.'), t('Delete'), t('Cancel'));
  return $form;
}