You are here

function views_pdf_templates_submit in Views PDF 7.3

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

Page to manage PDF templates.

1 string reference to 'views_pdf_templates_submit'
views_pdf_templates in ./views_pdf.admin.inc
Page to manage PDF templates.

File

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

Code

function views_pdf_templates_submit($form, &$form_state) {
  $pdf_dir = $form_state['values']['pdf_dir'];
  if (file_prepare_directory($pdf_dir, FILE_CREATE_DIRECTORY)) {
    $file = file_save_upload('template_file', array(
      'file_validate_extensions' => array(
        'pdf',
      ),
    ), $pdf_dir, FILE_EXISTS_ERROR);
    if (is_object($file)) {
      $file->status = FILE_STATUS_PERMANENT;
      file_save($file);
    }
  }
}