? make_phptemplate_links_optional.patch Index: menutrails.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/menutrails/menutrails.module,v retrieving revision 1.22 diff -u -p -r1.22 menutrails.module --- menutrails.module 17 Aug 2009 16:37:50 -0000 1.22 +++ menutrails.module 6 Nov 2009 23:16:01 -0000 @@ -32,6 +32,9 @@ function menutrails_menu() { * @todo Replace TRUE with settings check. */ function menutrails_init() { + if (variable_get('menutrails_phptemplate_links', TRUE)) { + include_once(drupal_get_path('module', 'menutrails') . '/phptemplate_links.inc'); + } if (module_exists('og') && variable_get('menutrails_og_sub_pages', TRUE)) { if ($group = og_get_group_context()) { $item = menu_get_item(); @@ -330,6 +333,13 @@ function menutrails_menutrails_settings( '#description' => t('If a specific group node has an assigned menu item, use this as the trail for nodes which have that group as an audience. If present, this will override all other group settings.'), ); } + // Make inclusion of phptemplate_links() theme function optional: + $form['menutrails_phptemplate_links'] = array( + '#title' => 'Automatically include "active" class on menu links in active trail.', + '#type' => 'checkbox', + '#default_value' => variable_get('menutrails_phptemplate_links', TRUE), + '#description' => 'Selecting yes will include a phptemplate_links() function, which may impact custom themes.', + ); return $form; } @@ -411,81 +421,6 @@ function _menutrails_recurse($tree, $hre } /** - * Return a themed set of links. - * - * The important difference is that we use the in_active_trail bit here to set - * an "active" CSS class, which is what most themes (e.g. garland) use to - * denote an active/open menu item. You should alter/override this as your - * design needs dictate. - * - * @param $links - * A keyed array of links to be themed. - * @param $attributes - * A keyed array of attributes - * @return - * A string containing an unordered list of links. - */ -function phptemplate_links($links, $attributes = array('class' => 'links')) { - global $language; - $output = ''; - - if (count($links) > 0) { - $output = '