diff --git a/drupalorg_handbook/drupalorg_handbook.module b/drupalorg_handbook/drupalorg_handbook.module index 6c1c0cf..829dcdb 100644 --- a/drupalorg_handbook/drupalorg_handbook.module +++ b/drupalorg_handbook/drupalorg_handbook.module @@ -37,6 +37,12 @@ function drupalorg_handbook_nodeapi(&$node, $op = 'view', $teaser = FALSE, $page $node->extra_footer = theme('drupalorg_handbook_footer_line'); } } + elseif ($node->type == 'book_listing') { + // Mark the taxonomy terms as rendered so they don't display on the node. + foreach ($node->taxonomy as $term_id => $dummy) { + $node->taxonomy[$term_id]->rendered = TRUE; + } + } } elseif (($op == 'update' || $op == 'insert') && !empty($node->book) && !empty($node->book['bid'])) { // Remove all cached versions of recently updated data (home). @@ -162,6 +168,22 @@ function drupalorg_handbook_meta_data() { $about['status'] = '

' . check_plain($term->name) . '

'; break; + case 59: + // Book availability: use as status line. + $class = 'page-ok'; + switch ($term_id) { + case 34514: // Out of print + case 34513: // Upcoming + $class = 'page-needs-work'; + break; + + case 34515: // Canceled + $class = 'page-major-problem'; + break; + } + $about['status'] = '

' . check_plain($term->name) . '

'; + break; + case 54: // Keywords vocabulary: print a link, separate section. $keywords[] = l($term->name, taxonomy_term_path($term)); @@ -291,7 +313,7 @@ function drupalorg_handbook_block($op = 'list', $delta = 0, $edit = array()) { break; case 'meta-sidebar': - if (($section === 'documentation' || $section === 'community') && isset($node) && isset($node->book['bid'])) { + if ((($section === 'documentation' || $section === 'community') && isset($node) && isset($node->book['bid'])) || (isset($node) && $node->type == 'book_listing')) { $about = drupalorg_handbook_meta_data(); $links = array(); if (node_access('update', $node)) { @@ -313,7 +335,7 @@ function drupalorg_handbook_block($op = 'list', $delta = 0, $edit = array()) { break; case 'about-page': - if (($section === 'documentation' || $section === 'community') && isset($node) && isset($node->book['bid'])) { + if ((($section === 'documentation' || $section === 'community') && isset($node) && isset($node->book['bid'])) || (isset($node) && $node->type == 'book_listing')) { $about = drupalorg_handbook_meta_data(); unset($about['status']); if (!empty($about)) {