You are here

function global_filter_debug in Views Global Filter 8

Same name and namespace in other branches
  1. 7 global_filter.module \global_filter_debug()

Custom debug function.

5 calls to global_filter_debug()
global_filter_create_widget in ./global_filter.widgets.inc
Based on the requested or field-implied widget.
global_filter_init in ./global_filter.module
Implements hook_init().
global_filter_set_on_session in ./global_filter.storage.inc
Sets the filter of the supplied name to the supplied value.
global_filter_user_login in ./global_filter.module
Implements hook_user_login().
global_filter_user_profile_form_submit in ./global_filter.module
Additional handler for when the user_profile_form is submitted.

File

./global_filter.module, line 654
global_filter.module

Code

function global_filter_debug($message) {
  global $user;
  $user_names = explode(',', check_plain(global_filter_get_module_parameter('show_debug_messages')));
  foreach ($user_names as $user_name) {
    $user_name = drupal_strtolower(trim($user_name));
    $match = isset($user->name) ? $user_name == drupal_strtolower(trim($user->name)) : $user_name == 'anon' || $user_name == 'anonymous';
    if ($match) {
      drupal_set_message($message);
      return;
    }
  }
}