diff -rupN site_map/site_map.admin.inc site_map_new/site_map.admin.inc --- site_map/site_map.admin.inc 2009-06-30 05:12:54.000000000 +1000 +++ site_map.admin.inc 2010-05-07 12:17:34.716840125 +1000 @@ -80,6 +80,26 @@ function site_map_admin_settings() { // '#description' => t('When enabled, this option will show all children pages for each book.'), // ); + $block_options = array(); + $blocks = _block_rehash(); + foreach ($blocks as $bid => $block) { + $block_options[$bid] = $block['info']; + } + $form['site_map_content']['site_map_show_blocks'] = array( + '#type' => 'select', + '#title' => t("Blocks to include in the site map"), + '#default_value' => variable_get('site_map_show_blocks', array()), + '#options' => $block_options, + '#multiple' => TRUE, + '#description' => t('This will include the output of any selected blocks in the sitemap. Ctrl-click (Windows) or Command-click (Mac) to select more than one value.'), + ); + $form['site_map_content']['site_map_show_block_title'] = array( + '#type' => 'checkbox', + '#title' => t('Show block titles'), + '#default_value' => variable_get('site_map_show_block_title', 1), + '#description' => t('When disabled, any blocks included in the sitemap will not have their title displayed.'), + ); + $menu_options = array(); $menu_options = menu_get_menus(); diff -rupN site_map/site_map.module site_map_new/site_map.module --- site_map/site_map.module 2009-10-15 07:35:28.000000000 +1100 +++ site_map.module 2010-05-07 12:19:03.094838735 +1000 @@ -133,6 +133,9 @@ function theme_site_map_display() { // Compile the books trees. $output .= _site_map_books(); + // Compile the blocks. + $output .= _site_map_blocks(); + // Compile the menu trees. $output .= _site_map_menus(); @@ -340,6 +343,26 @@ function _site_map_books() { } } + return $output; +} + +/** + * Render blocks + */ +function _site_map_blocks() { + if ($bids = variable_get('site_map_show_blocks', array())) { + $blocks = _block_rehash(); + + foreach ($bids as $bid) { + if (isset($blocks[$bid])) { + $block = $blocks[$bid]; + $view = module_invoke($block['module'], 'block', 'view', $block['delta']); + $title = variable_get('site_map_show_block_title', 1) ? $view['subject'] : ''; + $output .= theme('site_map_box', $title, $view['content'], 'sitemap-block'); + } + } + } + return $output; }