You are here

function ad_notify_confirm_delete_validate in Advertisement 5.2

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

Validate that the selected notification can be deleted.

File

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

Code

function ad_notify_confirm_delete_validate($form_id, $form_values) {
  if ($form_values['locked'] && !ad_permission($form_values['aid'], 'manage owners')) {
    drupal_set_message(t('This notification is locked, you will need to contact the site administrator to delete this notification for you.'), 'error');
    if (arg(2) == 'adowners' && arg(4) == 'notifications') {
      drupal_goto('node/' . $form_values['aid'] . '/adowners/' . $form_values['uid'] . '/notifications');
    }
    else {
      drupal_goto('node/' . $form_values['aid'] . '/notifications');
    }
  }
}