You are here

function cache_rewrite_cid in Mobile Tools 6.2

Same name and namespace in other branches
  1. 6.3 mobile_tools_cache.inc \cache_rewrite_cid()
  2. 6 mobile_tools_cache.inc \cache_rewrite_cid()
  3. 7.2 mobile_tools_cache.inc \cache_rewrite_cid()

Rewriting the cid support the usage of caching with mobile tools when using theme switching for several device groups

2 calls to cache_rewrite_cid()
cache_get in ./mobile_tools_cache.inc
Return data from the persistent cache. Data may be stored as either plain text or as serialized data. cache_get will automatically return unserialized objects and arrays.
cache_set in ./mobile_tools_cache.inc
Store data in the persistent cache.

File

./mobile_tools_cache.inc, line 205
mobile_tools_cache.inc This files allow to override the default drupal cache in order to support theme switching based on device type and device group.

Code

function cache_rewrite_cid(&$cid) {
  require_once dirname(__FILE__) . '/modules/mobile_tools_detection/mobile_tools_detection.module';
  $result = mobile_tools_detection_detect_mobile_device();
  $query = $_GET;
  unset($query['q']);
  $seperator = count($query) ? '&' : '?';
  $cid = $cid . $seperator . 'mobile_group=' . $result['group'] . '&device=' . $result['type'];
}