You are here

function views_pdf_template_delete in Views PDF 7.3

Same name and namespace in other branches
  1. 7 views_pdf.admin.inc \views_pdf_template_delete()

Delete a PDF template.

1 string reference to 'views_pdf_template_delete'
views_pdf_menu in ./views_pdf.module
Implements hook_menu().

File

./views_pdf.admin.inc, line 179
Theme function for enhence the views admin interface vor PDF options.

Code

function views_pdf_template_delete($form, &$form_state, $file_name) {
  $pdfs = _list_pdfs($pdf_dir);
  if (isset($pdfs[$file_name])) {
    $form['name'] = array(
      '#type' => 'value',
      '#value' => $file_name,
    );
    $form['pdf_uri'] = array(
      '#type' => 'value',
      '#value' => "{$pdf_dir}/{$file_name}",
    );
    return confirm_form($form, t('Are you sure you want to delete the template file %name?', array(
      '%name' => $file_name,
    )), 'admin/structure/views/pdfs');
  }
}