diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-08-13 07:24:14 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-08-13 07:24:14 +0000 |
commit | c25bc33181a3f4cc756621354ea902a68d1e0659 (patch) | |
tree | 12352cc16d329d2c60d2aef4c2ddb969b7dc5594 | |
parent | e0b97a75871ec96fb238a2a3c3ffe5f6c30ff542 (diff) | |
download | brdo-c25bc33181a3f4cc756621354ea902a68d1e0659.tar.gz brdo-c25bc33181a3f4cc756621354ea902a68d1e0659.tar.bz2 |
- Usability improvements based on Keith Instone's suggestions:
* Removed 'handbook' title.
* Added a 'books' link to the book location bar: the link takes you to
the book overview page.
* Renamed a few 'collaborative books' to 'books' so that the links and
page/box titles match.
-rw-r--r-- | modules/book.module | 19 | ||||
-rw-r--r-- | modules/book/book.module | 19 |
2 files changed, 18 insertions, 20 deletions
diff --git a/modules/book.module b/modules/book.module index fa1dbb3f2..7deaccb12 100644 --- a/modules/book.module +++ b/modules/book.module @@ -65,7 +65,7 @@ function book_link($type, $node = 0, $main = 0) { $links = array(); if ($type == "page" && user_access("access content")) { - $links[] = l(t("collaborative book"), "book", array("title" => t("Read and contribute to the collaborative books."))); + $links[] = l(t("books"), "book", array("title" => t("Read and contribute to the collaborative books."))); } if ($type == "menu.create" && user_access("maintain books")) { @@ -82,7 +82,7 @@ function book_link($type, $node = 0, $main = 0) { } if ($type == "admin" && user_access("maintain books")) { - menu("admin/node/book", "collaborative books", "book_admin", book_help("admin/node/book"), 4); + menu("admin/node/book", "books", "book_admin", book_help("admin/node/book"), 4); menu("admin/node/book/orphan", "orphan pages", "book_admin", book_help("admin/node/book/orphan"), 8); menu("admin/node/book/help", "help", "book_help", NULL, 9); @@ -411,14 +411,13 @@ function book_view($node, $main = 0) { // build the tree from bottom to top to have the book index in $level for navigation later $path = book_location($node); + $trail[] = l(t("Books"), "book"); foreach ($path as $level) { $trail[] = l($level->title, "node/view/$level->nid"); } $output .= "<div class=\"book\">"; - if ($trail) { - $output .= "<div class=\"location\">". implode($trail, " » ") ."</div><hr />"; - } + $output .= "<div class=\"location\">". implode($trail, " » ") ."</div><hr />"; $output .= "<div class=\"title\">$node->title</div>"; $output .= "<div class=\"last-updated\">". t("Last updated by %u on %d", array("%u" => format_name($node), "%d" => format_date($node->changed))) ."</div>"; @@ -459,7 +458,7 @@ function book_view($node, $main = 0) { $output .= "<div class=\"links\">". theme("links", link_node($node, $main)) ."</div>"; $output .= "</div>"; - theme("box", t("Handbook"), $output); + print $output; } } @@ -563,7 +562,7 @@ function book_render() { } theme("header"); - theme("box", t("Handbook"), "$output"); + theme("box", t("Books"), "$output"); theme("footer"); } @@ -777,7 +776,7 @@ function book_help($section = "admin/node/book/help") { case 'admin/node/book/help': case 'admin/book/help': case 'admin/help': - $output .= "<p>The <i>collaborative book</i> 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.</p>"; + $output .= "<p>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.</p>"; $output .= "<p>A book is simply a collection of nodes that have been linked together. These nodes are usually of type <i>book page</i>, but you can insert nodes of any type into a book outline. Every node in the book has a <i>parent</i> 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 <i>weight</i> that you give them.</p>"; $output .= "<p>A book page is a special node type that allows you to embed PHP within the body of the page. This capability is only offerred to administrators, since malicious users could abuse this power. In addiiton, book pages contain a <i>log message</i> 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.</p>"; $output .= strtr("<p>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 <i><root></i>. To include an existing node in your book, click on the \"administer\"-link in that node. At the bottom of this administration page, click on the <i>edit book outline</i> button. 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 link.</p>", array("%permissions" => l(t("permissions"), "admin/user/permission"), "%create" => l(t("create book page"), "node/add/book") )); @@ -785,14 +784,14 @@ function book_help($section = "admin/node/book/help") { $output .= "<h3>Maintaining a FAQ using a collaborative book</h3>"; $output .= "<p>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!</p>"; $output .= strtr("<p>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 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 <i><root></i> as the parent of this page. Leave the <i>log message</i> and <i>type</i> 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.</p>", array("%create" => l(t("create book page"), "node/add/book") )); - $output .= "<p>Whenever you come across a post which you want to include in your FAQ, click on the <i>administer</i> link. Then click on the <i>edit book outline</i> button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a <i>parent</i>. Books are quite flexible. They can have sections like <i>Flying to Estonia</i>, <i>Eating in Estonia</i> and so on. As you get more experienced with the <i>collaborative book</i>, you can reorganize posts in your book so that it stays organized.</p>"; + $output .= "<p>Whenever you come across a post which you want to include in your FAQ, click on the <i>administer</i> link. Then click on the <i>edit book outline</i> button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a <i>parent</i>. Books are quite flexible. They can have sections like <i>Flying to Estonia</i>, <i>Eating in Estonia</i> and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.</p>"; $output .= strtr("<p>Notes:</p><ul><li>Any comments attached to those relevant posts which you designate as book pages will also be transported into your book. This is a great feature, since much wisdom is shared via comments. Remember that all future comments and edits will automatically be reflected in your book.</li><li>You may wish to edit the title of posts when adding them to your FAQ. This is done on the same page as the <i>Edit book outline</i> button. Clear titles improve navigability enormously.</li><li>Book pages may come from any content type (blog, story, page, etc.). If you are creating a post solely for inclusion in your book, then use the %create link.</li><li>If you don't see the <i>administer</i> link, then you probably have insufficient %permission.</li><li>If you want to get really fancy, note that books are one of the few content types which allow raw PHP in their <i>body</i>. So you've got lots of geeky possibilities there.</li></ul>", array("%create" => l(t("create book page"), "node/add/book"), "%permission" => l(t("permissions"), "admin/user/permission") )); break; case 'admin/system/modules': $output = "Allows users to collaboratively author a book."; break; case 'admin/node/book': - $output = "The collaborative book offers a mean to organize content, authored by many users, in an online manual, outline or FAQ."; + $output = "The book module offers a mean to organize content, authored by many users, in an online manual, outline or FAQ."; break; case 'admin/node/book/orphan': $output = "Pages in a book are like a tree. As pages are edited, reorganized and removed, child pages might be left with no link to the rest of the book. Such pages are refered to as 'orphan pages'. On this page, administrators can review their books for orphans and reattach those pages as desired."; diff --git a/modules/book/book.module b/modules/book/book.module index fa1dbb3f2..7deaccb12 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -65,7 +65,7 @@ function book_link($type, $node = 0, $main = 0) { $links = array(); if ($type == "page" && user_access("access content")) { - $links[] = l(t("collaborative book"), "book", array("title" => t("Read and contribute to the collaborative books."))); + $links[] = l(t("books"), "book", array("title" => t("Read and contribute to the collaborative books."))); } if ($type == "menu.create" && user_access("maintain books")) { @@ -82,7 +82,7 @@ function book_link($type, $node = 0, $main = 0) { } if ($type == "admin" && user_access("maintain books")) { - menu("admin/node/book", "collaborative books", "book_admin", book_help("admin/node/book"), 4); + menu("admin/node/book", "books", "book_admin", book_help("admin/node/book"), 4); menu("admin/node/book/orphan", "orphan pages", "book_admin", book_help("admin/node/book/orphan"), 8); menu("admin/node/book/help", "help", "book_help", NULL, 9); @@ -411,14 +411,13 @@ function book_view($node, $main = 0) { // build the tree from bottom to top to have the book index in $level for navigation later $path = book_location($node); + $trail[] = l(t("Books"), "book"); foreach ($path as $level) { $trail[] = l($level->title, "node/view/$level->nid"); } $output .= "<div class=\"book\">"; - if ($trail) { - $output .= "<div class=\"location\">". implode($trail, " » ") ."</div><hr />"; - } + $output .= "<div class=\"location\">". implode($trail, " » ") ."</div><hr />"; $output .= "<div class=\"title\">$node->title</div>"; $output .= "<div class=\"last-updated\">". t("Last updated by %u on %d", array("%u" => format_name($node), "%d" => format_date($node->changed))) ."</div>"; @@ -459,7 +458,7 @@ function book_view($node, $main = 0) { $output .= "<div class=\"links\">". theme("links", link_node($node, $main)) ."</div>"; $output .= "</div>"; - theme("box", t("Handbook"), $output); + print $output; } } @@ -563,7 +562,7 @@ function book_render() { } theme("header"); - theme("box", t("Handbook"), "$output"); + theme("box", t("Books"), "$output"); theme("footer"); } @@ -777,7 +776,7 @@ function book_help($section = "admin/node/book/help") { case 'admin/node/book/help': case 'admin/book/help': case 'admin/help': - $output .= "<p>The <i>collaborative book</i> 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.</p>"; + $output .= "<p>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.</p>"; $output .= "<p>A book is simply a collection of nodes that have been linked together. These nodes are usually of type <i>book page</i>, but you can insert nodes of any type into a book outline. Every node in the book has a <i>parent</i> 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 <i>weight</i> that you give them.</p>"; $output .= "<p>A book page is a special node type that allows you to embed PHP within the body of the page. This capability is only offerred to administrators, since malicious users could abuse this power. In addiiton, book pages contain a <i>log message</i> 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.</p>"; $output .= strtr("<p>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 <i><root></i>. To include an existing node in your book, click on the \"administer\"-link in that node. At the bottom of this administration page, click on the <i>edit book outline</i> button. 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 link.</p>", array("%permissions" => l(t("permissions"), "admin/user/permission"), "%create" => l(t("create book page"), "node/add/book") )); @@ -785,14 +784,14 @@ function book_help($section = "admin/node/book/help") { $output .= "<h3>Maintaining a FAQ using a collaborative book</h3>"; $output .= "<p>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!</p>"; $output .= strtr("<p>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 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 <i><root></i> as the parent of this page. Leave the <i>log message</i> and <i>type</i> 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.</p>", array("%create" => l(t("create book page"), "node/add/book") )); - $output .= "<p>Whenever you come across a post which you want to include in your FAQ, click on the <i>administer</i> link. Then click on the <i>edit book outline</i> button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a <i>parent</i>. Books are quite flexible. They can have sections like <i>Flying to Estonia</i>, <i>Eating in Estonia</i> and so on. As you get more experienced with the <i>collaborative book</i>, you can reorganize posts in your book so that it stays organized.</p>"; + $output .= "<p>Whenever you come across a post which you want to include in your FAQ, click on the <i>administer</i> link. Then click on the <i>edit book outline</i> button at the bottom of the page. Then place the relevant post wherever is most appropriate in your book by selecting a <i>parent</i>. Books are quite flexible. They can have sections like <i>Flying to Estonia</i>, <i>Eating in Estonia</i> and so on. As you get more experienced with the book module, you can reorganize posts in your book so that it stays organized.</p>"; $output .= strtr("<p>Notes:</p><ul><li>Any comments attached to those relevant posts which you designate as book pages will also be transported into your book. This is a great feature, since much wisdom is shared via comments. Remember that all future comments and edits will automatically be reflected in your book.</li><li>You may wish to edit the title of posts when adding them to your FAQ. This is done on the same page as the <i>Edit book outline</i> button. Clear titles improve navigability enormously.</li><li>Book pages may come from any content type (blog, story, page, etc.). If you are creating a post solely for inclusion in your book, then use the %create link.</li><li>If you don't see the <i>administer</i> link, then you probably have insufficient %permission.</li><li>If you want to get really fancy, note that books are one of the few content types which allow raw PHP in their <i>body</i>. So you've got lots of geeky possibilities there.</li></ul>", array("%create" => l(t("create book page"), "node/add/book"), "%permission" => l(t("permissions"), "admin/user/permission") )); break; case 'admin/system/modules': $output = "Allows users to collaboratively author a book."; break; case 'admin/node/book': - $output = "The collaborative book offers a mean to organize content, authored by many users, in an online manual, outline or FAQ."; + $output = "The book module offers a mean to organize content, authored by many users, in an online manual, outline or FAQ."; break; case 'admin/node/book/orphan': $output = "Pages in a book are like a tree. As pages are edited, reorganized and removed, child pages might be left with no link to the rest of the book. Such pages are refered to as 'orphan pages'. On this page, administrators can review their books for orphans and reattach those pages as desired."; |