From b859406290d2c37ce821f8be3d9d55b51e64df69 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 25 Jun 2006 14:27:12 +0000 Subject: - Patch #69151 by flanker: make exported book pages themeable. --- modules/book.module | 27 ++++++++++----------------- modules/book/book.module | 27 ++++++++++----------------- 2 files changed, 20 insertions(+), 34 deletions(-) diff --git a/modules/book.module b/modules/book.module index e94cfb50b..96274581e 100644 --- a/modules/book.module +++ b/modules/book.module @@ -686,31 +686,24 @@ function book_export($type = 'html', $nid = 0) { * @param nid * - an integer representing the node id (nid) of the node to export * @param depth - * - an integer giving the depth in the book hierarchy of the node - which is to be exported + * - an integer giving the depth in the book hierarchy of the node + * which is to be exported + * * @return - * - string containing HTML representing the node and its children in - the book hierarchy + * - string containing HTML representing the node and its children in + * the book hierarchy */ function book_export_html($nid, $depth) { if (user_access('see printer-friendly version')) { - global $base_url; + $node = node_load($nid); for ($i = 1; $i < $depth; $i++) { - $output .= "
\n"; + $content .= "
\n"; } - $output .= book_recurse($nid, $depth, 'book_node_visitor_html_pre', 'book_node_visitor_html_post'); + $content .= book_recurse($nid, $depth, 'book_node_visitor_html_pre', 'book_node_visitor_html_post'); for ($i = 1; $i < $depth; $i++) { - $output .= "
\n"; - + $content .= "
\n"; } - $html = "\n"; - $html .= ''; - $html .= "\n". check_plain($node->title) ."\n"; - $html .= ''; - $html .= '' . "\n"; - $html .= "\n"; - $html .= "\n\n". $output . "\n\n\n"; - return $html; + return theme('book_export_html', check_plain($node->title), $content); } else { drupal_access_denied(); diff --git a/modules/book/book.module b/modules/book/book.module index e94cfb50b..96274581e 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -686,31 +686,24 @@ function book_export($type = 'html', $nid = 0) { * @param nid * - an integer representing the node id (nid) of the node to export * @param depth - * - an integer giving the depth in the book hierarchy of the node - which is to be exported + * - an integer giving the depth in the book hierarchy of the node + * which is to be exported + * * @return - * - string containing HTML representing the node and its children in - the book hierarchy + * - string containing HTML representing the node and its children in + * the book hierarchy */ function book_export_html($nid, $depth) { if (user_access('see printer-friendly version')) { - global $base_url; + $node = node_load($nid); for ($i = 1; $i < $depth; $i++) { - $output .= "
\n"; + $content .= "
\n"; } - $output .= book_recurse($nid, $depth, 'book_node_visitor_html_pre', 'book_node_visitor_html_post'); + $content .= book_recurse($nid, $depth, 'book_node_visitor_html_pre', 'book_node_visitor_html_post'); for ($i = 1; $i < $depth; $i++) { - $output .= "
\n"; - + $content .= "
\n"; } - $html = "\n"; - $html .= ''; - $html .= "\n". check_plain($node->title) ."\n"; - $html .= ''; - $html .= '' . "\n"; - $html .= "\n"; - $html .= "\n\n". $output . "\n\n\n"; - return $html; + return theme('book_export_html', check_plain($node->title), $content); } else { drupal_access_denied(); -- cgit v1.2.3