function mobile_tools_init in Mobile Tools 6.3
Same name and namespace in other branches
- 5 mobile_tools.module \mobile_tools_init()
- 6.2 mobile_tools.module \mobile_tools_init()
- 7.3 mobile_tools.module \mobile_tools_init()
- 7.2 mobile_tools.module \mobile_tools_init()
Theme switching:
- Only for non cached pages!
File
- ./
mobile_tools.module, line 236 - Mobile Tools provides a range of functionality assisting in creating a mobile Drupal site . this functionality contains:
Code
function mobile_tools_init() {
global $mobile_tools_device, $conf;
// Skip everything in case Drush is used
if (php_sapi_name() == 'cli') {
return;
}
// Some small extras
if (mobile_tools_site_type() == 'mobile') {
$conf['default_nodes_main'] = variable_get('default_nodes_main_mobile', variable_get('default_nodes_main', 10));
}
/**
* We set the context
*/
if (module_exists('context')) {
$plugin = context_get_plugin('condition', 'mobile');
if (!empty($plugin) && is_object($plugin)) {
$device = mobile_tools_get_device();
$plugin
->execute($device['type']);
$plugin
->execute($device['group']);
}
}
}