You are here

function better_messages_process_visibility in Better Messages 6

Same name and namespace in other branches
  1. 6.2 better_messages.module \better_messages_process_visibility()
  2. 7 better_messages.module \better_messages_process_visibility()
2 calls to better_messages_process_visibility()
better_messages_preprocess_page in ./better_messages.module
theme_better_messages in ./better_messages.module

File

./better_messages.module, line 140

Code

function better_messages_process_visibility() {
  $settings = better_messages_get_settings();
  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;
}