You are here

function mobile_tools_themes_init in Mobile Tools 5

Being called in the hook_init() implementation This function is in charge of changing to the mobile theme

1 call to mobile_tools_themes_init()
mobile_tools_init in ./mobile_tools.module
Implementation of hook_boot().

File

./mobile_tools.module, line 175
Mobile Tools provides a range of functionality assisting in creating a mobile drupal site . this functionality contains:

Code

function mobile_tools_themes_init() {
  global $conf;
  if ($_SESSION['mobile-tools-site-type'] == 'mobile' && variable_get('mobile_tools_handling', '') != 'theme-switch' || variable_get('mobile_tools_handling', '') == 'theme-switch' && $_SESSION['mobile-tools-mobile-device']['type'] == 'mobile') {
    $group = $_SESSION['mobile-tools-mobile-device']['group'];
    $type = $_SESSION['mobile-tools-mobile-device']['type'];
    $mobile_detection_module = variable_get('mobile-tools-device-detection', 'mobile_tools');
    if (variable_get($mobile_detection_module . '_' . $group . '_enable', '') == 1) {
      $conf['theme_default'] = variable_get($mobile_detection_module . '_' . $group . '_theme', $conf['theme_default']);
    }
    else {
      $conf['theme_default'] = variable_get('mobile_tools_theme_name', $conf['theme_default']);
    }
  }
}