summaryrefslogtreecommitdiffstats
path: root/print_mail
diff options
context:
space:
mode:
authorJoao Ventura2012-05-14 00:13:14 +0200
committerJoao Ventura2012-05-14 00:13:14 +0200
commita779e64d1b2a2757ed7f3df3bac0f5de564b04b1 (patch)
tree55f166fc9279f46d7974739f3de5817a96af1c0e /print_mail
parent5f38cb153b81e54878f7cd8725a6f5fc6da4e52f (diff)
Issue #953920: Stop using the print array created by_print_var_generator(). Instead make the print.tpl.php a real template and move most of the work into print_preprocess_print().
Diffstat (limited to 'print_mail')
-rw-r--r--print_mail/print_mail.inc11
1 files changed, 5 insertions, 6 deletions
diff --git a/print_mail/print_mail.inc b/print_mail/print_mail.inc
index 34a8196..d67f1a5 100644
--- a/print_mail/print_mail.inc
+++ b/print_mail/print_mail.inc
@@ -278,23 +278,22 @@ function print_mail_form_submit($form, &$form_state) {
$sender_message = t('Message from sender') . ':<br /><br /><em>' . nl2br(check_plain($form_state['values']['txt_message'])) . '</em>';
- $print = print_controller($form_state['values']['path'], $link['format'], $cid, $form_state['values']['chk_teaser'], $sender_message);
+ $node = print_controller($form_state['values']['path'], $link['format'], $cid, $form_state['values']['chk_teaser']);
// Spaces in img URLs must be replaced with %20
$pattern = '!<(img\s[^>]*?)>!is';
- $print['content'] = preg_replace_callback($pattern, '_print_mail_encode_urls', $print['content']);
+ $node->content = preg_replace_callback($pattern, '_print_mail_encode_urls', $node->content);
- if ($print !== FALSE) {
+ if ($node) {
$print_mail_send_option_default = variable_get('print_mail_send_option_default', PRINT_MAIL_SEND_OPTION_DEFAULT);
$params = array();
$params['subject'] = $form_state['values']['fld_subject'];
$params['message'] = $sender_message;
- $params['link'] = $print['url'];
+ $params['link'] = $node->url;
$params['title'] = $form_state['values']['title'];
- $node = $print['node'];
- $params['body'] = theme('print', array('print' => $print, 'type' => $link['format'], 'node' => $node));
+ $params['body'] = theme('print', array('node' => $node, 'format' => $link['format'], 'message' => $sender_message));
$ok = FALSE;
$use_job_queue = variable_get('print_mail_job_queue', PRINT_MAIL_JOB_QUEUE_DEFAULT);