function mobile_tools_menu_switch_site in Mobile Tools 6.3
Same name and namespace in other branches
- 6.2 mobile_tools.module \mobile_tools_menu_switch_site()
Redirect the user to the right path
1 string reference to 'mobile_tools_menu_switch_site'
- mobile_tools_menu in ./
mobile_tools.module - Implementation of hook_menu().
File
- ./
mobile_tools.module, line 120 - Mobile Tools provides a range of functionality assisting in creating a mobile Drupal site . this functionality contains:
Code
function mobile_tools_menu_switch_site() {
$args = arg();
array_shift($args);
$site = array_shift($args);
$path = implode('/', $args);
// In case of redirect, we already redirect to the target url
if (variable_get('mobile_tools_redirect', FALSE)) {
if ($site == "desktop") {
$url = variable_get('mobile_tools_desktop_url', '') . '/' . $path;
}
else {
$url = variable_get('mobile_tools_mobile_url', '') . '/' . $path;
}
}
else {
$url = $path;
}
$querystring = drupal_query_string_encode(array_merge($_GET, array(
'device' => $site,
)), array(
'q',
));
drupal_goto($url, $querystring);
}