function hide_submit_admin_delete_image in Hide submit button 7
Same name and namespace in other branches
- 5 hide_submit_admin.inc \hide_submit_admin_delete_image()
- 6 hide_submit_admin.inc \hide_submit_admin_delete_image()
Image deletion confirmation form
Parameters
&$form_state:
$filename - The file to delete:
Return value
drupal form array
1 string reference to 'hide_submit_admin_delete_image'
- hide_submit_menu in ./
hide_submit.module - Implements hook_menu().
File
- ./
hide_submit_admin.inc, line 17 - Hide the submit button after clicked to prevent/reduce duplicate postings.
Code
function hide_submit_admin_delete_image($form, &$form_state, $filename) {
$filepath = HIDE_SUBMIT_IMG_DIRECTORY . '/' . $filename;
if (!file_exists(HIDE_SUBMIT_IMG_DIRECTORY . '/' . $filename)) {
drupal_goto('admin/config/content/hide-submit');
}
$form['hide_submit_image_file_path'] = array(
'#type' => 'value',
'#value' => $filepath,
);
$form['hide_submit_image_file_name'] = array(
'#type' => 'value',
'#value' => $filename,
);
$msg = t('Are you sure you want to delete the image file %name', array(
'%name' => check_plain($filename),
));
return confirm_form($form, $msg, 'admin/config/content/hide-submit');
}