Commit fb4ef3d9 authored by Liuba Kazakov's avatar Liuba Kazakov Committed by Hugh Davenport
Browse files

Device detection - setting session variables



Bug #1041645

Change-Id: I5b7b65e7335529ccd1949b3d1ea94e4f3b1efa42
Signed-off-by: default avatarHugh Davenport <hugh@catalyst.net.nz>
parent 66c42b03
...@@ -345,6 +345,14 @@ if (defined('JSON') && !defined('NOSESSKEY')) { ...@@ -345,6 +345,14 @@ if (defined('JSON') && !defined('NOSESSKEY')) {
} }
} }
// Device detection
require_once(get_config('libroot') . 'mobile_detect/Mobile_Detect.php');
$detect = new Mobile_Detect();
$SESSION->set('handheld_device', ($detect->isMobile() || $detect->isTablet()));
$SESSION->set('mobile', $detect->isMobile());
$SESSION->set('tablet', $detect->isTablet());
/* /*
* Initializes our performance info early. * Initializes our performance info early.
* *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment