You are here

function mobile_tools_is_mobile_ctools_access_check in Mobile Tools 6.2

Same name and namespace in other branches
  1. 6.3 plugins/access/is_mobile.inc \mobile_tools_is_mobile_ctools_access_check()
  2. 6 plugins/access/is_mobile.inc \mobile_tools_is_mobile_ctools_access_check()

Check for access.

1 string reference to 'mobile_tools_is_mobile_ctools_access_check'
mobile_tools_is_mobile_ctools_access in plugins/access/is_mobile.inc
Implementation of specially named hook_ctools_access().

File

plugins/access/is_mobile.inc, line 61
Plugin to provide access control based on evaluated PHP.

Code

function mobile_tools_is_mobile_ctools_access_check($conf, $contexts) {
  $browser = mobile_tools_is_mobile_device();
  if ($conf['mobile_any'] && $browser['type'] == 'mobile') {
    return TRUE;
  }
  $access = in_array($browser['group'], $conf['mobile_list']);
  if (in_array($browser['type'], $conf['mobile_list']) && $browser['type'] == 'mobile') {
    return TRUE;
  }
  return $access;
}