diff --git a/simplemenu.module b/simplemenu.module index 6b83d600..6c5c0b2d 100644 --- a/simplemenu.module +++ b/simplemenu.module @@ -30,14 +30,14 @@ function menu_bar_menu($may_cache) { ); } + // We put this in !$may_cache so it's only added once per request elseif (user_access('view menu bar')) { $path = drupal_get_path('module', 'menu_bar'); - // Add the CSS for this module - // We put this in !$may_cache so it's only added once per request drupal_add_css($path .'/menu_bar.css'); // pass in base path to the JS file - drupal_add_js(array('menu_bar' => array('basePath' => base_path())), 'setting'); + // url() handles appending ?q= but in this case, we need to pass in the variable so the menus work when mod_rewrite is off + drupal_add_js(array('menu_bar' => array('basePath' => base_path() . (variable_get('clean_url', 0) ? '' : '?q='))), 'setting'); drupal_add_js($path .'/menu_bar.js'); }