diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-11-04 14:29:09 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-11-04 14:29:09 +0000 |
commit | 75a6f4ded4a57281717263accb806ce8971aa732 (patch) | |
tree | 4e54051365d42c3851358776f411ff1acaf46ed5 /modules/book/book.pages.inc | |
parent | 98a5fb14193b598be05a20e1f14cf171534bfae7 (diff) | |
download | brdo-75a6f4ded4a57281717263accb806ce8971aa732.tar.gz brdo-75a6f4ded4a57281717263accb806ce8971aa732.tar.bz2 |
#160200 by dvessel and chx: better theming support for book module
Diffstat (limited to 'modules/book/book.pages.inc')
-rw-r--r-- | modules/book/book.pages.inc | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/modules/book/book.pages.inc b/modules/book/book.pages.inc index bcfd71dda..f576e2d14 100644 --- a/modules/book/book.pages.inc +++ b/modules/book/book.pages.inc @@ -73,21 +73,13 @@ function book_export($type, $nid) { */ function book_export_html($nid) { if (user_access('access printer-friendly version')) { - $content = ''; + $export_data = array(); $node = node_load($nid); if (isset($node->book)) { - $depth = $node->book['depth']; - for ($i = 1; $i < $depth; $i++) { - $content .= "<div class=\"section-$i\">\n"; - } $tree = book_menu_subtree_data($node->book); - $content .= book_export_traverse($tree, 'book_node_visitor_html_pre', 'book_node_visitor_html_post'); - - for ($i = 1; $i < $depth; $i++) { - $content .= "</div>\n"; - } + $contents = book_export_traverse($tree, 'book_node_export'); } - return theme('book_export_html', check_plain($node->title), $content); + return theme('book_export_html', $node->title, $contents, $node->book['depth']); } else { drupal_access_denied(); @@ -95,26 +87,6 @@ function book_export_html($nid) { } /** - * How the book's HTML export should be themed - * - * @ingroup themeable - */ -function theme_book_export_html($title, $content) { - global $base_url, $language; - $html = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; - $html .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'; - $html .= "<head>\n<title>". $title ."</title>\n"; - $html .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'; - $html .= '<base href="'. $base_url .'/" />'."\n"; - $html .= '<link type="text/css" rel="stylesheet" href="misc/print.css" />'; - if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { - $html .= '<link type="text/css" rel="stylesheet" href="misc/print-rtl.css" />'; - } - $html .= "</head>\n<body>\n". $content ."\n</body>\n</html>\n"; - return $html; -} - -/** * Menu callback; show the outline form for a single node. */ function book_outline($node) { |