hide module when path is overlay Im developing a module which shows a bar (fixed, top, z-index 99999) with some content. When im in the admin interface with overlay, I want to hide the module, right now the bar is overlapping the overlay.

This code is working well if the overlay is not activated

if (arg(0) == 'admin' || arg(0) == '#overlay=admin') { $output = NULL; }


only the arg(0) == '#overlay=admin' part is not working,

any ideas?

Thanks in advance
You should use the following code, if you want to avoid outputting something when the overlay is visualized.

if (module_exists('overlay') &amp;&amp; path_is_admin($_GET['q'])) {
  // The overlay is visualized.
}


path_is_admin() is used from overlay_init(), which contains the following code.

  // If this page shouldn't be rendered inside the overlay, redirect to the
  // parent.
  elseif (!path_is_admin($current_path)) {
    overlay_close_dialog($current_path, array('query' =&gt; drupal_get_query_parameters(NULL, array('q', 'render'))));
  }