Commit 95f3e482 authored by jcnventura's avatar jcnventura

Issue #1230480: Inline the CSS when sending the HTML to TCPDF.

parent 60245e4a
......@@ -82,7 +82,7 @@ function print_permission() {
function print_theme() {
return array(
'print' => array(
'variables' => array('node' => NULL, 'format' => '', 'message' => ''),
'variables' => array('node' => NULL, 'format' => '', 'expand_css' => FALSE, 'message' => ''),
'template' => 'print',
'file' => 'print.pages.inc',
),
......
......@@ -162,7 +162,7 @@ function print_preprocess_print(&$variables) {
$variables['print_title'] = check_plain($node->title);
$variables['head'] = drupal_get_html_head();
$variables['robots_meta'] = _print_robots_meta_generator();
$variables['css'] = _print_css_generator($format == 'mail');
$variables['css'] = _print_css_generator($variables['expand_css']);
if (variable_get('print_html_sendtoprinter', PRINT_HTML_SENDTOPRINTER_DEFAULT) && ($format == 'html')) {
drupal_add_js('misc/drupal.js', array('weight' => JS_LIBRARY));
......@@ -362,7 +362,7 @@ function _print_robots_meta_generator() {
* @return string
* applicable CSS
*/
function _print_css_generator($expand = TRUE) {
function _print_css_generator($expand = FALSE) {
$print_css = variable_get('print_css', PRINT_CSS_DEFAULT);
if (!empty($print_css)) {
......
......@@ -4,6 +4,8 @@
* @file
* Default print module template
*
* @todo document this a lot (including args to theme('print') and available variables
*
* @ingroup print
*/
?>
......
......@@ -301,7 +301,7 @@ function print_mail_form_submit($form, &$form_state) {
$params['link'] = $node->url;
$params['title'] = $form_state['values']['title'];
$params['body'] = theme('print', array('node' => $node, 'format' => $link['format'], 'message' => $sender_message));
$params['body'] = theme('print', array('node' => $node, 'format' => $link['format'], 'expand_css' => TRUE, 'message' => $sender_message));
$ok = FALSE;
$use_job_queue = variable_get('print_mail_job_queue', PRINT_MAIL_JOB_QUEUE_DEFAULT);
......
......@@ -99,7 +99,7 @@ function print_pdf_generate_path($path, $cid = NULL, $pdf_filename = NULL) {
$link = print_pdf_print_link();
$node = print_controller($path, $link['format'], $cid);
if ($node) {
$html = theme('print', array('node' => $node, 'format' => $link['format']));
$html = theme('print', array('node' => $node, 'expand_css' => TRUE, 'format' => $link['format']));
// Img elements must be set to absolute
$pattern = '!<(img\s[^>]*?)>!is';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment