print_pdf_wkhtmltopdf.admin.inc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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('(wkhtmltopdf only) Set any additional options to be passed to the wkhtmltopdf executable. Tokens may be used in these options (see list below).'),
  28. );
  29. if (module_exists('token')) {
  30. $form['settings']['print_pdf_filename_patterns'] = array(
  31. '#type' => 'fieldset',
  32. '#title' => t('Replacement patterns'),
  33. '#collapsible' => TRUE,
  34. '#collapsed' => TRUE,
  35. );
  36. $form['settings']['print_pdf_filename_patterns']['descriptions'] = array(
  37. '#theme' => 'token_tree',
  38. '#token_types' => array('node'),
  39. );
  40. }
  41. return system_settings_form($form);
  42. }