Projet

Général

Profil

Paste
Télécharger (1,51 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / print / print_pdf / lib_handlers / print_pdf_wkhtmltopdf / print_pdf_wkhtmltopdf.admin.inc @ 1aa883a3

1
<?php
2

    
3
/**
4
 * @file
5
 * Contains the administrative functions of the print_pdf_wkhtmltopdf module.
6
 *
7
 * This file is included by the print_pdf_wkhtmltopdf module, and includes the
8
 * settings form.
9
 *
10
 * @ingroup print
11
 */
12

    
13
/**
14
 * Form constructor for the wkhtmltopdf options settings form.
15
 *
16
 * @ingroup forms
17
 */
18
function print_pdf_wkhtmltopdf_settings() {
19
  $form['settings'] = array(
20
    '#type' => 'fieldset',
21
    '#title' => t('wkhtmltopdf options'),
22
  );
23

    
24
  $form['settings']['print_pdf_wkhtmltopdf_options'] = array(
25
    '#type' => 'textfield',
26
    '#title' => t('wkhtmltopdf options'),
27
    '#size' => 60,
28
    '#maxlength' => 500,
29
    '#default_value' => variable_get('print_pdf_wkhtmltopdf_options', PRINT_PDF_WKHTMLTOPDF_OPTIONS),
30
    '#description' => t('Set any additional options to be passed to the wkhtmltopdf executable. Tokens may be used in these options (see list below).'),
31
  );
32

    
33
  $form['settings']['print_pdf_wkhtmltopdf_use_input_file'] = array(
34
    '#type' => 'checkbox',
35
    '#title' => t('Use temporary input file'),
36
    '#default_value' => variable_get('print_pdf_wkhtmltopdf_use_input_file', PRINT_PDF_WKHTMLTOPDF_USE_INPUT_FILE_DEFAULT),
37
    '#description' => t('If you experience trouble when generating a PDF try to enable this feature to adjust the input handling.'),
38
  );
39

    
40
  if (module_exists('token')) {
41
    $form['settings']['print_pdf_filename_patterns'] = array(
42
      '#theme' => 'token_tree',
43
      '#token_types' => array('node'),
44
      '#dialog' => TRUE,
45
    );
46
  }
47

    
48
  return system_settings_form($form);
49
}