function mt_browscap_is_mobile_device in Mobile Tools 5
Same name and namespace in other branches
- 6.3 contrib/mt_browscap/mt_browscap.module \mt_browscap_is_mobile_device()
- 6 contrib/mt_browscap/mt_browscap.module \mt_browscap_is_mobile_device()
Implementation of hook_is_mobile_device() provide by Mobile Tools module
File
- contrib/
mt_browscap/ mt_browscap.module, line 12 - Implements mobile_tools module hooks to integrate with the browsercap module
Code
function mt_browscap_is_mobile_device() {
$info = browscap_get_browser();
// detect device type
if ($info['ismobiledevice']) {
$type = 'mobile';
}
else {
$type = 'desktop';
}
$groups = mt_browscap_device_groups();
$group = '';
if (in_array($info['browser'], $groups)) {
$group = $info['browser'];
}
return array(
'type' => $type,
'group' => $group,
);
}