function better_messages_process_visibility in Better Messages 7
Same name and namespace in other branches
- 6.2 better_messages.module \better_messages_process_visibility()
- 6 better_messages.module \better_messages_process_visibility()
2 calls to better_messages_process_visibility()
File
- ./
better_messages.module, line 161
Code
function better_messages_process_visibility() {
$settings = better_messages_get_settings();
global $user;
if (!$settings['extra']['admin'] && $user->uid == 1) {
return FALSE;
}
global $theme;
if (!empty($settings['extra']['themes']) && empty($settings['extra']['themes'][$theme])) {
return FALSE;
}
if ($settings['extra']['pages']) {
$path = drupal_get_path_alias($_GET['q']);
$page_match = drupal_match_path($path, $settings['extra']['pages']);
if ($path != $_GET['q']) {
$page_match = $page_match || drupal_match_path($_GET['q'], $settings['extra']['pages']);
}
$page_match = !($settings['extra']['visibility'] xor $page_match);
}
else {
$page_match = TRUE;
}
return $page_match;
}