function mobile_tools_boot in Mobile Tools 6.3
Same name and namespace in other branches
- 6 mobile_tools.module \mobile_tools_boot()
- 6.2 mobile_tools.module \mobile_tools_boot()
Implementation of hook_boot(). Redirecting if needed
File
- ./
mobile_tools.module, line 213 - Mobile Tools provides a range of functionality assisting in creating a mobile Drupal site . this functionality contains:
Code
function mobile_tools_boot() {
global $mobile_tools_device, $conf;
// Skip everything in case drush is used
if (php_sapi_name() == 'cli') {
return;
}
// Get the device object
$mobile_tools_device = mobile_tools_get_device();
// First call the redirect function. This will redirect the userif needed.
if (variable_get('mobile_tools_redirect', FALSE)) {
$redirected = mobile_tools_device_redirect($mobile_tools_device);
}
if (mobile_tools_site_type() == 'mobile') {
$conf['site_frontpage'] = variable_get('site_frontpage_mobile', variable_get('site_frontpage', 'node'));
}
// Switch theme if needed
$theme_switched = mobile_tools_switch_theme($mobile_tools_device);
}