diff --git a/README.txt b/README.txt index 722ddb6a..167450d8 100644 --- a/README.txt +++ b/README.txt @@ -30,7 +30,7 @@ jQuery Superfish: http://users.tpg.com.au/j_birch/plugins/superfish/ --- CHANGELOG -------------------------------------------------------- -4.0, 2007-Nov-21 +4.0, 2007-Nov-22 ---------------------- - new CHANGELOG to keep track of changes - #156256 upgrade to SuperFish 1.3 @@ -40,4 +40,6 @@ jQuery Superfish: http://users.tpg.com.au/j_birch/plugins/superfish/ - new option to select which theme to style SimpleMenu with, or provide a custom one - #184051 - don't hardcode CSS, add class to body - #180106 - fix missing translatable strings" -- #144742 - don't show annoying A titles \ No newline at end of file +- #144742 - don't show annoying A titles +- remove dependency on menu module, now works with menu module off +- \ No newline at end of file diff --git a/simplemenu.module b/simplemenu.module index 3c70809f..8e21361a 100644 --- a/simplemenu.module +++ b/simplemenu.module @@ -67,20 +67,24 @@ function simplemenu_perm() { * SimpleMenu settings page. */ function simplemenu_admin_settings() { - $form['default_menu']['simplemenu_menu'] = array( - '#type' => 'select', - '#title' => t('Menu'), - '#options' => menu_parent_options(0), - '#default_value' => variable_get('simplemenu_menu', 1), - '#description' => t('Select the menu to display.') - ); + if (module_exists('menu')) { + $form['default_menu']['simplemenu_menu'] = array( + '#type' => 'select', + '#title' => t('Menu'), + '#options' => menu_parent_options(0), + '#default_value' => variable_get('simplemenu_menu', 1), + '#description' => t('Select the menu to display.') + ); + } - $form['default_menu']['simplemenu_devel'] = array( - '#type' => 'checkbox', - '#title' => t('Add devel module links'), - '#default_value' => variable_get('simplemenu_devel', 0), - '#description' => t('Add devel module links for those users that can access the devel module.') - ); + if (module_exists('devel')) { + $form['default_menu']['simplemenu_devel'] = array( + '#type' => 'checkbox', + '#title' => t('Add devel module links'), + '#default_value' => variable_get('simplemenu_devel', 0), + '#description' => t('Add devel module links for those users that can access the devel module.') + ); + } $form['default_menu']['simplemenu_theme'] = array( '#type' => 'select', @@ -131,7 +135,14 @@ function simplemenu_admin_settings() { function simplemenu_get_menu() { $output = ''; - $menu = simplemenu_menu_tree(variable_get('simplemenu_menu', 1)); + // if a user turned off menu module but SimpleMenu was previously set + // reset variable so a menu appears + if (module_exists('menu')) { + $menu = simplemenu_menu_tree(variable_get('simplemenu_menu', 1)); + } + else { + $menu = simplemenu_menu_tree(1); + } if (!$menu) { $menu = '