function views_pdf_template_delete_submit in Views PDF 7
Same name and namespace in other branches
- 7.3 views_pdf.admin.inc \views_pdf_template_delete_submit()
Submit function for delete confirmation.
File
- ./
views_pdf.admin.inc, line 149 - Theme function for enhence the views admin interface vor PDF options.
Code
function views_pdf_template_delete_submit($form, &$form_state) {
$uri = $form_state['values']['pdf_uri'];
$files = file_load_multiple(array(), array(
'uri' => $uri,
));
if ($file = reset($files)) {
file_delete($file);
}
else {
// No file record - unmanaged?
unlink(drupal_realpath($uri));
}
drupal_set_message(t('PDF template %name deleted', array(
'%name' => $form_state['values']['name'],
)));
$form_state['redirect'] = 'admin/structure/views/pdfs';
}