diff --git a/print.module b/print.module index 04dbbad11423a9476453b0ffde04647ce7f2406f..10cd5643815d592fe24ef5e418c20211ea6aa6c0 100644 --- a/print.module +++ b/print.module @@ -293,18 +293,19 @@ function print_node_view($node, $teaser) { ); } + if (($teaser === FALSE) && isset($node->build_mode) && ($node->build_mode == NODE_BUILD_NORMAL)) { // Insert content corner links $node->content['print_links'] = array( '#markup' => "<span class='print-link'></span>", '#weight' => -101, ); - if (($teaser === FALSE) && !empty($print_html_link_pos['corner']) && - isset($node->build_mode) && ($node->build_mode == NODE_BUILD_NORMAL)) { + if (!empty($print_html_link_pos['corner'])) { $link = print_insert_link(NULL, $node); if ($link) { $node->content['print_links']['#markup'] = preg_replace('!</span>$!', $link . '</span>', $node->content['print_links']['#markup']); } } + } } /** @@ -397,6 +398,23 @@ function print_cck_extra_fields($type_name) { return $fields; } +/** + * Implementation of hook_cck_build_modes(). + */ +function print_cck_build_modes() { + return array( + 'print' => array( + 'title' => t('Print'), + 'build modes' => array( + NODE_BUILD_PRINT => array( + 'title' => t('Print'), + 'views style' => TRUE, + ), + ), + ), + ); +} + /** * Auxiliary function to assign the per-node settings to the node object fields * diff --git a/print.pages.inc b/print.pages.inc index a7cabbc1a6c09e4f104029215c349c36993594e0..a2052cd58193018c9c1aa1b33e8a09196f2271f3 100644 --- a/print.pages.inc +++ b/print.pages.inc @@ -574,6 +574,8 @@ function _print_generate_node($nid, $cid = NULL, $format = PRINT_HTML_FORMAT, $t // Adapted (simplified) version of node_view //Render the node content $node = node_build_content($node, $teaser, TRUE); + // Disable the links area + unset($node->content['links']); // Disable fivestar widget output unset($node->content['fivestar_widget']); // Disable service links module output @@ -619,7 +621,7 @@ function _print_generate_node($nid, $cid = NULL, $format = PRINT_HTML_FORMAT, $t } $node->body .= $comments; } - node_invoke_node($node, 'alter', $teaser, TRUE); + module_invoke_all('node_alter', $node, $teaser, TRUE); if ($teaser) { $node->body = $node->teaser;