summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--print_mail/print_mail.inc2
-rw-r--r--print_pdf/print_pdf.admin.inc20
-rw-r--r--print_pdf/print_pdf.pages.inc12
3 files changed, 8 insertions, 26 deletions
diff --git a/print_mail/print_mail.inc b/print_mail/print_mail.inc
index 02099a9..c8c098d 100644
--- a/print_mail/print_mail.inc
+++ b/print_mail/print_mail.inc
@@ -277,7 +277,7 @@ function print_mail_form_submit($form, &$form_state) {
$params['title'] = $form_state['values']['title'];
$node = $print['node'];
- $params['body'] = theme('print_page', $print, PRINT_MAIL_FORMAT, $node);
+ $params['body'] = theme('print_page', array('print' => $print, 'type' => PRINT_MAIL_FORMAT, 'node' => $node));
$ok = FALSE;
if (function_exists('job_queue_add') && variable_get('print_mail_job_queue', PRINT_MAIL_JOB_QUEUE_DEFAULT)) {
diff --git a/print_pdf/print_pdf.admin.inc b/print_pdf/print_pdf.admin.inc
index d5dbce1..ccbf3d5 100644
--- a/print_pdf/print_pdf.admin.inc
+++ b/print_pdf/print_pdf.admin.inc
@@ -211,31 +211,13 @@ function print_pdf_settings() {
'#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).'),
);
- if (module_exists('token')) {
$form['settings']['print_pdf_filename'] = array(
'#type' => 'textfield',
'#title' => t('PDF File Name'),
'#default_value' => variable_get('print_pdf_filename', PRINT_PDF_FILENAME_DEFAULT),
'#description' => t("If left empty the generated filename defaults to the node's path. Tokens may be used to build the filename (see following list). The .pdf extension will be appended automatically."),
);
- $form['settings']['print_pdf_filename_patterns'] = array(
- '#type' => 'fieldset',
- '#title' => t('Replacement Patterns'),
- '#collapsible' => TRUE,
- '#collapsed' => TRUE,
- );
- $descriptions = '';
- $tokens = token_get_list('node');
- foreach ($tokens as $token) {
- foreach ($token as $key => $val) {
- $descriptions .= '<dt>[' . $key . ']</dt><dd>' . $val . "</dd>\n";
- }
- }
- $form['settings']['print_pdf_filename_patterns']['descriptions'] = array(
- '#type' => 'markup',
- '#markup' => "<dl>\n" . $descriptions . "</dl>\n",
- );
- }
+
$form['#validate'][] = '_print_pdf_settings_validate';
}
else {
diff --git a/print_pdf/print_pdf.pages.inc b/print_pdf/print_pdf.pages.inc
index c8133cb..c0d667c 100644
--- a/print_pdf/print_pdf.pages.inc
+++ b/print_pdf/print_pdf.pages.inc
@@ -43,8 +43,8 @@ function print_pdf_controller() {
$print['logo'] = preg_replace_callback($pattern, '_print_rewrite_urls', $print['logo']);
$print['footer_message'] = preg_replace_callback($pattern, '_print_rewrite_urls', $print['footer_message']);
// And converted from private to public paths
- $file_downloads = variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC);
- if ($file_downloads == FILE_DOWNLOADS_PRIVATE) {
+ $file_downloads = variable_get('file_default_scheme', 'public');
+ if ($file_downloads == 'private') {
switch (variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE)) {
case LANGUAGE_NEGOTIATION_PATH_DEFAULT:
case LANGUAGE_NEGOTIATION_PATH:
@@ -64,7 +64,7 @@ function print_pdf_controller() {
$print['sendtoprinter'] = '';
$node = $print['node'];
- $html = theme('print_page', $print, PRINT_PDF_FORMAT, $node);
+ $html = theme('print_page', array('print' => $print, 'type' => PRINT_PDF_FORMAT, 'node' => $node));
// Convert the a href elements, to make sure no relative links remain
$pattern = '!<(a\s[^>]*?)>!is';
@@ -73,8 +73,8 @@ function print_pdf_controller() {
$html = preg_replace("!${base_url}/" . PRINTPDF_PATH . "/.*?%2523!", '#', $html);
$pdf_filename = variable_get('print_pdf_filename', PRINT_PDF_FILENAME_DEFAULT);
- if (function_exists('token_replace') && !empty($pdf_filename)) {
- $pdf_filename = token_replace($pdf_filename, 'node', $node) . '.pdf';
+ if (!empty($pdf_filename)) {
+ $pdf_filename = token_replace($pdf_filename, array('node' => $node)) . '.pdf';
}
else {
$pdf_filename = str_replace('/', '_', $path) . '.pdf';
@@ -297,7 +297,7 @@ function _print_pdf_wkhtmltopdf($print, $html, $filename) {
$dpi = 96;
- if (function_exists('token_replace') && !empty($print_pdf_wkhtmltopdf_options)) {
+ if (!empty($print_pdf_wkhtmltopdf_options)) {
$print_pdf_wkhtmltopdf_options = token_replace($print_pdf_wkhtmltopdf_options, 'node', $print['node']);
}