jrCore_is_mobile_device() in module listener
Jamroom Developers
its in misc.php in the jrCore module. To use it in your function
function myCustomModule_imageDisplay_listener($_data, $_user, $_conf, $_args, $event)
{
// I need to inject this code if the image is being displayed on a mobile device
if(jrCore_is_mobile_device()){
mobile only stuff goes here....
}
$_rs = array(
'src' => "<amp-img src=\"{$url}\"" . $wid . $hgt . $attrs . ' layout="responsive">'
);
return $_data; // listeners MUST return $_data or you'll break the system. $_rs['src'];
}