? menuall.patch ? po/menutree-old.php Index: menutree.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/menutree/menutree.admin.inc,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 menutree.admin.inc --- menutree.admin.inc 19 Aug 2008 22:19:21 -0000 1.1.2.1 +++ menutree.admin.inc 18 May 2009 22:24:18 -0000 @@ -22,8 +22,9 @@ function menutree_settings() { } $menus = menu_get_menus(); + $i = 1; foreach ($menus as $menu_name => $menu_title) { - $open = trim(variable_get('menutree_title_'. $menu_name, '') + $open = trim(variable_get('menutree_title_'. $menu_name, '') . variable_get('menutree_intro_text_'. $menu_name, '') . str_replace('', '', variable_get('menutree_all_weight_'. $menu_name, ''))); @@ -33,7 +34,7 @@ function menutree_settings() { '#collapsible' => TRUE, '#collapsed' => ($open ? FALSE : TRUE), '#description' => t('The path @path will provide a complete tree of all menu items in this menu. If you wish to set a custom title or header text, do so here.', array( - '@link' => url('menutree/'. $menu_name), + '@link' => url('menutree/'. $menu_name), '@path' => 'menutree/'. $menu_name, )), ); @@ -54,13 +55,13 @@ function menutree_settings() { '#type' => 'select', '#title' => t('Order in main index'), '#options' => $weights, - '#default_value' => variable_get('menutree_all_weight_'. $menu_name, ''), + '#default_value' => variable_get('menutree_all_weight_'. $menu_name, $i), '#description' => t('The path @path will provide multiple menu trees on a single page. You can specify which and in what order here. Set the weight to "<none>" to exclude this menu.', array( - '@link' => url('menutree/all'), + '@link' => url('menutree/all'), '@path' => 'menutree/all', )), ); - + $i++; } return system_settings_form($form); Index: menutree.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/menutree/menutree.module,v retrieving revision 1.4.2.2 diff -u -p -r1.4.2.2 menutree.module --- menutree.module 19 Aug 2008 22:19:21 -0000 1.4.2.2 +++ menutree.module 18 May 2009 22:24:18 -0000 @@ -5,7 +5,7 @@ * @file * This module provides a simple "site map" tree based on the menu system rather * than on taxonomies. - * + * * @author Larry Garfield * */ @@ -27,7 +27,7 @@ define('MENUTREE_TITLE_BODY', 0x0002); /** * Implementation of hook_theme() */ -function menutree_theme() { +function menutree_theme() { return array( 'menutree_page' => array( 'arguments' => array( @@ -86,3 +86,4 @@ function menutree_menu() { ); return $items; } + Index: menutree.pages.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/menutree/Attic/menutree.pages.inc,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 menutree.pages.inc --- menutree.pages.inc 19 Aug 2008 22:19:21 -0000 1.1.2.2 +++ menutree.pages.inc 18 May 2009 22:24:18 -0000 @@ -24,22 +24,22 @@ function menutree_display_page($menu) { * */ function menutree_display_all() { - + $trees = array(); - + $menus = menu_get_menus(); + foreach ($menus as $menu_name => $menu_title) { - if (($weight = variable_get('menutree_all_weight_'. $menu_name, '')) !== '') { - $trees[$weight] = menutree_display(menu_load($menu_name), MENUTREE_TITLE_BODY); - } - } - - if (empty($trees)) { - drupal_not_found(); - exit(); + + $weight = trim(variable_get('menutree_all_weight_'. $menu_name, '')); + + if(is_numeric($weight)){ + $trees[$weight] = menutree_display(menu_load($menu_name), $menu_title); + } + } ksort($trees); - + return implode($trees); } @@ -50,64 +50,67 @@ function menutree_display_all() { * @param $menu * The menu to display. * @param $title_display - * How to handle the display of the title. This is a bitmask that can take + * How to handle the display of the title. This is a bitmask that can take * multiple values. * - MENUTREE_TITLE_PAGE: Set the title of this menu as the page title. * - MENUTREE_TITLE_BODY: Include the title of the menu in the body of the page. */ -function menutree_display($menu, $title_display = MENUTREE_TITLE_PAGE) { +function menutree_display($menu, $title_display = MENUTREE_TITLE_PAGE, $display = true) { /* $output = ''; - + $title = variable_get('menutree_title_'. $menu['menu_name'], ''); drupal_set_title(check_plain(!empty($title) ? $title : $menu['title'])); - + // Output custom intro text. $intro = variable_get('menutree_intro_text_'. $menu['menu_name'], ''); if (!empty($intro)) { $output .= check_markup($intro, FILTER_FORMAT_DEFAULT, FALSE); } - + $tree = menu_tree_output(menu_tree_all_data($menu['menu_name'])); $output .= theme('menutree_page', $tree); return $output; */ - + $output = ''; - + // The title could be displayed in various ways. $title = variable_get('menutree_title_'. $menu['menu_name'], ''); if (!$title) { $title = $menu['title']; } $title = check_plain($title); - - if ($title_display & MENUTREE_TITLE_PAGE) { + + if ($title_display == MENUTREE_TITLE_PAGE) { drupal_set_title($title); - } - - $tree_title = ''; - if ($title_display & MENUTREE_TITLE_BODY) { $tree_title = $title; + } else { + $tree_title = $title_display; } - + +// $tree_title = ''; +// if ($title_display == MENUTREE_TITLE_BODY) { +// $tree_title = $title; +// } + // Output custom intro text. - $intro = variable_get('menutree_intro_text_'. $menu['menu_name'], ''); - $description = ''; - if (!empty($intro)) { - $description = check_markup($intro, FILTER_FORMAT_DEFAULT, FALSE); - } - +// $intro = variable_get('menutree_intro_text_'. $menu['menu_name'], ''); +// $description = ''; +// if (!empty($intro)) { +// $description = check_markup($intro, FILTER_FORMAT_DEFAULT, FALSE); +// } + $tree = menu_tree_output(menu_tree_all_data($menu['menu_name'])); - - return theme('menutree_page', $tree_title, $description, $tree); + + return theme('menutree_page', $tree_title, "", $tree); } /** * Theme the menutree. - * + * * @param string $title * The title of this tree, if any. * @param $description @@ -117,18 +120,18 @@ function menutree_display($menu, $title_ * @ingroup themeable */ function theme_menutree_page($title, $description, $tree) { - + $output = ''; - + if ($title) { $output .= '

'. $title ."

\n"; } if ($description) { $output .= '\n"; } - + $output .= $tree; - - + + return '\n"; }