function menu_minipanels_excluded_path in Menu Minipanels 6
Same name and namespace in other branches
- 7.2 menu_minipanels.module \menu_minipanels_excluded_path()
- 7 menu_minipanels.module \menu_minipanels_excluded_path()
Check if current path should be excluded.
2 calls to menu_minipanels_excluded_path()
- menu_minipanels_init in ./
menu_minipanels.module - Implements hook_init().
- menu_minipanels_preprocess_page in ./
menu_minipanels.module - Implements template_preprocess_page().
File
- ./
menu_minipanels.module, line 571 - Allows an administrator to specify a minipanel to be associated with a Drupal menu item. When that menu item is hovered or clicked (as per config), the minipanel content will be shown using the qTip javascript library.
Code
function menu_minipanels_excluded_path() {
// By default don't exclude the page.
$exclude_path_match = FALSE;
// By default ignore the admin pages.
$exclude_paths = drupal_strtolower(variable_get('menu_minipanels_exclude_paths', "admin\nadmin/*"));
// Don't bother checking anything if the setting is empty.
if (!empty($exclude_paths)) {
// Check the current raw path first.
$exclude_path_match = drupal_match_path($_GET['q'], $exclude_paths);
// If there isn't already a patch, check for a possible alias.
if (!$exclude_path_match) {
// Get the current path.
$path = drupal_strtolower(drupal_get_path_alias($_GET['q']));
// If the path *is* different to the current raw URL, check it too.
if ($path != $_GET['q']) {
$exclude_path_match = drupal_match_path($path, $exclude_paths);
}
}
}
return $exclude_path_match;
}