diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 03db9055405..472293fc0cd 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -17,6 +17,7 @@ Drupal x.x.x, xxxx-xx-xx (development version) * made it possible to block certain IPs/hostnames. - book module: * added Docbook-like XML export functionality. + * added OPML export functionality. - performance: * added 'loose caching' option for high-traffic sites. * improved performance of path aliasing. diff --git a/modules/book.module b/modules/book.module index 81a90f48508..88698a906b8 100644 --- a/modules/book.module +++ b/modules/book.module @@ -61,7 +61,8 @@ function book_link($type, $node = 0, $main = 0) { $links[] = l(t('add child page'), "node/add/book/parent/$node->nid"); } $links[] = l(t('printer-friendly version'), 'book/export/html/'. $node->nid, array('title' => t('Show a printer-friendly version of this book page and its sub-pages.'))); - $links[] = l(t('export as XML'), 'book/export/docbook/'. $node->nid, array('title' => t('Export this book page and its sub-pages as Docbook-like XML.'))); + $links[] = l(t('export DocBook XML'), 'book/export/docbook/'. $node->nid, array('title' => t('Export this book page and its sub-pages as DocBook XML.'))); + $links[] = l(t('export OPML'), 'book/export/opml/'. $node->nid, array('title' => t('Export this book page and its sub-pages as OPML.'))); } } @@ -75,15 +76,25 @@ function book_menu($may_cache) { $items = array(); if ($may_cache) { - $items[] = array('path' => 'book', 'title' => t('books'), - 'access' => user_access('access content'), 'type' => MENU_NORMAL_ITEM, 'weight' => 5); - $items[] = array('path' => 'node/add/book', 'title' => t('book page'), + $items[] = array( + 'path' => 'book', + 'title' => t('books'), + 'access' => user_access('access content'), + 'type' => MENU_NORMAL_ITEM, + 'weight' => 5); + $items[] = array( + 'path' => 'node/add/book', + 'title' => t('book page'), 'access' => user_access('create book pages')); - $items[] = array('path' => 'admin/node/book', 'title' => t('books'), + $items[] = array( + 'path' => 'admin/node/book', + 'title' => t('books'), 'callback' => 'book_admin', 'access' => user_access('administer nodes'), 'weight' => 4); - $items[] = array('path' => 'admin/node/book/orphan', 'title' => t('orphan pages'), + $items[] = array( + 'path' => 'admin/node/book/orphan', + 'title' => t('orphan pages'), 'callback' => 'book_admin_orphan', 'access' => user_access('administer nodes'), 'weight' => 8); @@ -92,13 +103,8 @@ function book_menu($may_cache) { 'access' => user_access('access content'), 'type' => MENU_SUGGESTED_ITEM); $items[] = array( - 'path' => 'book/export/docbook', - 'title' => t('export XML'), - 'callback' => 'book_export_docbook', - 'access' => user_access('access content'), - 'type' => MENU_CALLBACK); - $items[] = array('path' => 'book/export/printer', 'title' => t('printer-friendly version'), - 'callback' => 'book_export_html', + 'path' => 'book/export', + 'callback' => 'book_export', 'access' => user_access('access content'), 'type' => MENU_CALLBACK); } @@ -624,36 +630,111 @@ function book_render() { } /** - * Menu callback; generates a printer-friendly book page with all descendants. + * Menu callback; Generates various representation of a book page with + * all descendants and prints the requested representation to output. + * + * Notes: For HTML output, the given node is /embedded to its absolute + * depth in a top level section/. For example, a child node with + * depth 2 in the hierarchy is contained in (otherwise empty)
The book organises content into a nested hierarchical structure. It is particularly good for manuals, Frequently Asked Questions (FAQs) and the like, allowing you to have chapters, sections, etc.
-A book is simply a collection of nodes that have been linked together. These nodes are usually of type book page, but you can insert nodes of any type into a book outline. Every node in the book has a parent node which \"contains\" it. This is how book.module establishes its hierarchy. At any given level in the hierarchy, a book can contain many nodes. All these sibling nodes are sorted according to the weight that you give them.
-Book pages contain a log message field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that be desirable.
-Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use permissions to determine who may read and write to them. Only administrators are allowed to create new books, which are really just nodes whose parent is <top-level>. To include an existing node in your book, click on the \"outline\"-tab on the node's page. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the create content » book page link.
-Administrators may review the hierarchy of their books by clicking on the collaborative book link in the administration pages. There, nodes may be edited, reorganized, removed from book, and deleted. This behavior may change in the future. When a parent node is deleted, it may leave behind child nodes. These nodes are now orphans. Administrators should periodically review their books for orphans and reaffiliate those pages as desired. Finally, administrators may also export their books to a single, flat HTML page which is suitable for printing.
-Collaborative books let you easily set up a Frequently Asked Questions (FAQ) section on your web site. The main benefit is that you don't have to write all the questions/answers by yourself - let the community do it for you!
-In order to set up the FAQ, you have to create a new book which will hold all your content. To do so, click on the create content » book page link. Give it a thoughtful title, and body. A title like \"Estonia Travel - FAQ\" is nice. You may always edit these fields later. You will probably want to designate <top-level> as the parent of this page. Leave the log message and type fields blank for now. After you have submitted this book page, you are ready to begin filling up your book with questions that are frequently asked.
-Whenever you come across a post which you want to include in your FAQ, click on the administer link. Then click on the edit book outline button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a parent. Books are quite flexible. They can have sections like Flying to Estonia, Eating in Estonia and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.
-Notes:
The \"book\" content type is suited for creating structured, multi-page hypertexts such as site resource guides, manuals, and Frequently Asked Questions (FAQs). It permits a document to have chapters, sections, subsections, etc. Authors with suitable permissions can add pages to a collaborative book, placing them into the existing document by adding them to a table of contents menu.
+ +Books have additional ''previous'', ''up'', and ''next'' navigation elements at the bottom of each page for moving through the text. Additional navigation may be provided by enabling the \"book navigation block\" on the +block administration page. +
+ +Users can select the \"printer-friendly version\" link visible at the bottom of a book page to generate a printer-friendly display of the page and all of its subsections. They can choose to export the page and its subsections as DocBook XML (for offline editing, or production of print or other electronic publication formats) by selecting the \"export DocBook XML\" link. DocBook export currently treats node content as preformatted text. Selecting the \"export OPML\" link will generate an outline document (titles only) in OPML format, readable by many outline editing tools. Note: it may be neccessary to shift-click on the link to save the results to a file on the local computer.
+ +Administrators can view a book outline, from which is it possible to change the titles of sections, and their weight (thus reordering sections). From this outline, it is also possible to edit and/or delete book pages. Many content types besides pages (for example, blog entries, stories, and polls) can be added to a collaborative book by choosing the \"outline\" tab when viewing the post.
+ +You can:
For more information, visit the online documentation. +", +array( + '%create' => url('node/add/book'), + '%collaborative-book' => url('admin/node/book'), + '%workflow' => url('admin/node/configure/types/book'), + '%book-block' => url('admin/block'), + '%permissions' => url('admin/access/permissions'), + '%book-module-help' => url('http://drupal.org/handbook/modules/book') + ) +); case 'admin/modules#description': return t('Allows users to collaboratively author a book.'); case 'admin/node/book': diff --git a/modules/book/book.module b/modules/book/book.module index 81a90f48508..88698a906b8 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -61,7 +61,8 @@ function book_link($type, $node = 0, $main = 0) { $links[] = l(t('add child page'), "node/add/book/parent/$node->nid"); } $links[] = l(t('printer-friendly version'), 'book/export/html/'. $node->nid, array('title' => t('Show a printer-friendly version of this book page and its sub-pages.'))); - $links[] = l(t('export as XML'), 'book/export/docbook/'. $node->nid, array('title' => t('Export this book page and its sub-pages as Docbook-like XML.'))); + $links[] = l(t('export DocBook XML'), 'book/export/docbook/'. $node->nid, array('title' => t('Export this book page and its sub-pages as DocBook XML.'))); + $links[] = l(t('export OPML'), 'book/export/opml/'. $node->nid, array('title' => t('Export this book page and its sub-pages as OPML.'))); } } @@ -75,15 +76,25 @@ function book_menu($may_cache) { $items = array(); if ($may_cache) { - $items[] = array('path' => 'book', 'title' => t('books'), - 'access' => user_access('access content'), 'type' => MENU_NORMAL_ITEM, 'weight' => 5); - $items[] = array('path' => 'node/add/book', 'title' => t('book page'), + $items[] = array( + 'path' => 'book', + 'title' => t('books'), + 'access' => user_access('access content'), + 'type' => MENU_NORMAL_ITEM, + 'weight' => 5); + $items[] = array( + 'path' => 'node/add/book', + 'title' => t('book page'), 'access' => user_access('create book pages')); - $items[] = array('path' => 'admin/node/book', 'title' => t('books'), + $items[] = array( + 'path' => 'admin/node/book', + 'title' => t('books'), 'callback' => 'book_admin', 'access' => user_access('administer nodes'), 'weight' => 4); - $items[] = array('path' => 'admin/node/book/orphan', 'title' => t('orphan pages'), + $items[] = array( + 'path' => 'admin/node/book/orphan', + 'title' => t('orphan pages'), 'callback' => 'book_admin_orphan', 'access' => user_access('administer nodes'), 'weight' => 8); @@ -92,13 +103,8 @@ function book_menu($may_cache) { 'access' => user_access('access content'), 'type' => MENU_SUGGESTED_ITEM); $items[] = array( - 'path' => 'book/export/docbook', - 'title' => t('export XML'), - 'callback' => 'book_export_docbook', - 'access' => user_access('access content'), - 'type' => MENU_CALLBACK); - $items[] = array('path' => 'book/export/printer', 'title' => t('printer-friendly version'), - 'callback' => 'book_export_html', + 'path' => 'book/export', + 'callback' => 'book_export', 'access' => user_access('access content'), 'type' => MENU_CALLBACK); } @@ -624,36 +630,111 @@ function book_render() { } /** - * Menu callback; generates a printer-friendly book page with all descendants. + * Menu callback; Generates various representation of a book page with + * all descendants and prints the requested representation to output. + * + * Notes: For HTML output, the given node is /embedded to its absolute + * depth in a top level section/. For example, a child node with + * depth 2 in the hierarchy is contained in (otherwise empty)
The book organises content into a nested hierarchical structure. It is particularly good for manuals, Frequently Asked Questions (FAQs) and the like, allowing you to have chapters, sections, etc.
-A book is simply a collection of nodes that have been linked together. These nodes are usually of type book page, but you can insert nodes of any type into a book outline. Every node in the book has a parent node which \"contains\" it. This is how book.module establishes its hierarchy. At any given level in the hierarchy, a book can contain many nodes. All these sibling nodes are sorted according to the weight that you give them.
-Book pages contain a log message field which helps your users understand the motivation behind an edit of a book page. Each edited version of a book page is stored as a new revision of a node. This capability makes it easy to revert to an old version of a page, should that be desirable.
-Like other node types, book submissions and edits may be subject to moderation, depending on your configuration. Similarly, books use permissions to determine who may read and write to them. Only administrators are allowed to create new books, which are really just nodes whose parent is <top-level>. To include an existing node in your book, click on the \"outline\"-tab on the node's page. This enables you to place the node wherever you'd like within the book hierarchy. To add a new node into your book, use the create content » book page link.
-Administrators may review the hierarchy of their books by clicking on the collaborative book link in the administration pages. There, nodes may be edited, reorganized, removed from book, and deleted. This behavior may change in the future. When a parent node is deleted, it may leave behind child nodes. These nodes are now orphans. Administrators should periodically review their books for orphans and reaffiliate those pages as desired. Finally, administrators may also export their books to a single, flat HTML page which is suitable for printing.
-Collaborative books let you easily set up a Frequently Asked Questions (FAQ) section on your web site. The main benefit is that you don't have to write all the questions/answers by yourself - let the community do it for you!
-In order to set up the FAQ, you have to create a new book which will hold all your content. To do so, click on the create content » book page link. Give it a thoughtful title, and body. A title like \"Estonia Travel - FAQ\" is nice. You may always edit these fields later. You will probably want to designate <top-level> as the parent of this page. Leave the log message and type fields blank for now. After you have submitted this book page, you are ready to begin filling up your book with questions that are frequently asked.
-Whenever you come across a post which you want to include in your FAQ, click on the administer link. Then click on the edit book outline button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a parent. Books are quite flexible. They can have sections like Flying to Estonia, Eating in Estonia and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.
-Notes:
The \"book\" content type is suited for creating structured, multi-page hypertexts such as site resource guides, manuals, and Frequently Asked Questions (FAQs). It permits a document to have chapters, sections, subsections, etc. Authors with suitable permissions can add pages to a collaborative book, placing them into the existing document by adding them to a table of contents menu.
+ +Books have additional ''previous'', ''up'', and ''next'' navigation elements at the bottom of each page for moving through the text. Additional navigation may be provided by enabling the \"book navigation block\" on the +block administration page. +
+ +Users can select the \"printer-friendly version\" link visible at the bottom of a book page to generate a printer-friendly display of the page and all of its subsections. They can choose to export the page and its subsections as DocBook XML (for offline editing, or production of print or other electronic publication formats) by selecting the \"export DocBook XML\" link. DocBook export currently treats node content as preformatted text. Selecting the \"export OPML\" link will generate an outline document (titles only) in OPML format, readable by many outline editing tools. Note: it may be neccessary to shift-click on the link to save the results to a file on the local computer.
+ +Administrators can view a book outline, from which is it possible to change the titles of sections, and their weight (thus reordering sections). From this outline, it is also possible to edit and/or delete book pages. Many content types besides pages (for example, blog entries, stories, and polls) can be added to a collaborative book by choosing the \"outline\" tab when viewing the post.
+ +You can:
For more information, visit the online documentation. +", +array( + '%create' => url('node/add/book'), + '%collaborative-book' => url('admin/node/book'), + '%workflow' => url('admin/node/configure/types/book'), + '%book-block' => url('admin/block'), + '%permissions' => url('admin/access/permissions'), + '%book-module-help' => url('http://drupal.org/handbook/modules/book') + ) +); case 'admin/modules#description': return t('Allows users to collaboratively author a book.'); case 'admin/node/book':