print_pdf_wkhtmltopdf.admin.inc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * @file
  4. * Contains the administrative functions of the print_pdf_wkhtmltopdf module.
  5. *
  6. * This file is included by the print_pdf_wkhtmltopdf module, and includes the
  7. * settings form.
  8. *
  9. * @ingroup print
  10. */
  11. /**
  12. * Form constructor for the wkhtmltopdf options settings form.
  13. *
  14. * @ingroup forms
  15. */
  16. function print_pdf_wkhtmltopdf_settings() {
  17. $form['settings'] = array(
  18. '#type' => 'fieldset',
  19. '#title' => t('wkhtmltopdf options'),
  20. );
  21. $form['settings']['print_pdf_wkhtmltopdf_options'] = array(
  22. '#type' => 'textfield',
  23. '#title' => t('wkhtmltopdf options'),
  24. '#size' => 60,
  25. '#maxlength' => 500,
  26. '#default_value' => variable_get('print_pdf_wkhtmltopdf_options', PRINT_PDF_WKHTMLTOPDF_OPTIONS),
  27. '#description' => t('Set any additional options to be passed to the wkhtmltopdf executable. Tokens may be used in these options (see list below).'),
  28. );
  29. $form['settings']['print_pdf_wkhtmltopdf_use_input_file'] = array(
  30. '#type' => 'checkbox',
  31. '#title' => t('Use temporary input file'),
  32. '#default_value' => variable_get('print_pdf_wkhtmltopdf_use_input_file', PRINT_PDF_WKHTMLTOPDF_USE_INPUT_FILE_DEFAULT),
  33. '#description' => t('If you experience trouble when generating a PDF try to enable this feature to adjust the input handling.'),
  34. );
  35. if (module_exists('token')) {
  36. $form['settings']['print_pdf_filename_patterns'] = array(
  37. '#theme' => 'token_tree',
  38. '#token_types' => array('node'),
  39. '#dialog' => TRUE,
  40. );
  41. }
  42. return system_settings_form($form);
  43. }