You are here

function _site_map_books in Site map 6

Same name and namespace in other branches
  1. 8 site_map.module \_site_map_books()
  2. 5 site_map.module \_site_map_books()
  3. 6.2 site_map.module \_site_map_books()
  4. 7 site_map.module \_site_map_books()

Render books.

1 call to _site_map_books()
theme_site_map_display in ./site_map.module
Return a themed site map.

File

./site_map.module, line 334
Original author: Nic Ivy Now maintained by by Fredrik Jonsson fredrik at combonet dot se

Code

function _site_map_books() {
  $output = '';
  if (module_exists('book') && ($nids = variable_get('site_map_show_books', array()))) {
    $title = t('Books');
    $description = '<div class="description">' . t("Books at %sn.", array(
      "%sn" => variable_get('site_name', 'Drupal'),
    )) . '</div>';
    $book_menus = array();
    foreach ($nids as $nid) {
      $node = node_load($nid);
      $tree = menu_tree_all_data($node->book['menu_name'], $node->book);
      $data = array_shift($tree);
      $output .= theme('book_title_link', $data['link']);
      $output .= $data['below'] ? menu_tree_output($data['below']) : '';
    }
    if ($output) {
      $output = theme('site_map_box', $title, $description . $output, 'sitemap-book');
    }
  }
  return $output;
}