function ad_multiple_delete_confirm in Advertisement 5
Same name and namespace in other branches
- 5.2 ad.module \ad_multiple_delete_confirm()
- 6.3 ad.admin.inc \ad_multiple_delete_confirm()
- 6 ad.admin.inc \ad_multiple_delete_confirm()
- 6.2 ad.admin.inc \ad_multiple_delete_confirm()
- 7 ad.admin.inc \ad_multiple_delete_confirm()
Display a form to confirm whether to really delete the selected ads.
1 string reference to 'ad_multiple_delete_confirm'
- ad_admin_list in ./
ad.module - Build default ad administration page.
File
- ./
ad.module, line 1791 - An advertising system for Drupal powered websites.
Code
function ad_multiple_delete_confirm() {
$edit = $_POST;
$form['ads'] = array(
'#prefix' => '<ul>',
'#suffix' => '</ul>',
'#tree' => TRUE,
);
// array_filter returns only elements with TRUE values
foreach (array_filter($edit['ads']) as $aid => $value) {
$title = db_result(db_query('SELECT title FROM {node} WHERE nid = %d', $aid));
$form['ads'][$aid] = array(
'#type' => 'hidden',
'#value' => $aid,
'#prefix' => '<li>',
'#suffix' => check_plain($title) . "</li>\n",
);
}
$form['operation'] = array(
'#type' => 'hidden',
'#value' => 'delete',
);
return confirm_form($form, t('Are you sure you want to delete these ads?'), 'admin/content/ad', t('This action cannot be undone.'), t('Delete all'), t('Cancel'));
}