diff -rupN site_map/site_map.admin.inc site_map_new/site_map.admin.inc --- site_map/site_map.admin.inc 2010-04-05 04:08:48.000000000 +1000 +++ site_map.admin.inc 2010-05-07 12:29:39.060836504 +1000 @@ -58,6 +58,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 2010-04-05 04:05:43.000000000 +1000 +++ site_map.module 2010-05-07 12:32:06.500838217 +1000 @@ -132,6 +132,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(); @@ -374,6 +377,25 @@ 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; +} + /** * Render menus */