Here's book.module. All theme functions were converted but it may need some more work.

book_export_html(), book_node_visitor_html_pre() and book_node_visitor_html_post() have html in them that cannot be overridden. Should we break off some of these functions into template files too? And why is there a pre/post function for adding the html?

book_tree() and book_tree_recurse() uses theme functions for building lists now. It generated them manually duplicating some code. HTML is the same.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rstamm’s picture

Status: Needs review » Needs work

patch doesn't apply anymore.

cvs id tags broken and missing blank line after cvs id tags.

dvessel’s picture

I'll have another patch soon. book.module was under heavy development after I made that patch.

dvessel’s picture

Priority: Normal » Critical
Status: Needs work » Needs review
FileSize
12.54 KB

Changes:

This removes the need for the pre/post visit functions. It's now passed in as a child so it can be wrapped with "book_node_export". Not "book_node_visitor_html_pre" and "book_node_visitor_html_post". Those two had hard coded html. It was moved into theme_book_node_export.

Hard coded html removed from "book_export_html", moved into "theme_book_export_html".

Please don't forget about the search conversion.
http://drupal.org/node/164032

dvessel’s picture

FileSize
19.36 KB

Includes the template files this time.

dvessel’s picture

FileSize
19.41 KB

Rerolled for latest head.. /sigh.

dvessel’s picture

Note that the book sections don't put out the right classes anymore. Something was changed since the last patch so some nodes no longer contain the book depth.

Gábor Hojtsy’s picture

Status: Needs review » Needs work

The book split patch (I just committed) possibly broke this, as you noticed there.

dvessel’s picture

ugh, I have less time now but I'll try to get another patch going soon...

Senpai’s picture

Dvessel, keep trying to shoot that moving target, and PM me when a patch is ready for testing. I wanna see this get in.

chx’s picture

Status: Needs work » Needs review
FileSize
19.11 KB

Reroll.

catch’s picture

Status: Needs review » Needs work

The back and up links are generating urls like node/node/3

everything else seems fine.

catch’s picture

$variables['book_url'] = 'node/'. $book_link['bid']; maybe the culprit?

chx’s picture

Status: Needs work » Needs review
FileSize
31.23 KB

A few url() calls were missed.

chx’s picture

FileSize
19.43 KB

Some menu stuff got into it.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Fixes all the issues I found, RTBC.

dvessel’s picture

Woo hoo!! Nice guys, thanks!

AjK’s picture

Status: Reviewed & tested by the community » Needs work

Export html gives me a wsod. function book_export_traverse() doesn't return it's carefully constructed $output. Am I missing something here?

chx’s picture

Status: Needs work » Needs review
FileSize
13.17 KB
chx’s picture

FileSize
19.46 KB
AjK’s picture

Status: Needs review » Reviewed & tested by the community

Yup, looks good now.

PedroC-1’s picture

I am not sure but is the DOCTYPE in the first line of book-export-html.tpl.php?

Or is it better to write

...
+?><!DOCTYPE ...
...

instead of

...
+?>
+<!DOCTYPE ...
...

in book-export-html.tpl.php

John Morahan’s picture

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed. (Although I corrected a coding style violation in book_theme)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.