You are here

function hook_is_mobile_site in Mobile Tools 6.2

Determine whether the user is viewing the desktop or the mobile site.

This hook can be used to implement custom sit type detection. Custom detection methods will be displayed and made selectable on the Mobile Tools administration page.

1 function implements hook_is_mobile_site()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

mobile_tools_detection_is_mobile_site in modules/mobile_tools_detection/mobile_tools_detection.module
Implementatation of hook_is_mobile_site().
2 invocations of hook_is_mobile_site()
mobile_tools_external_modules_configuration_form in ./mobile_tools.admin.inc
Configuration of external modules
mobile_tools_site_type in ./mobile_tools.module
Determine the current site type.

File

./mobile_tools.api.php, line 18
Hooks provided by the Mobile Tools module.

Code

function hook_is_mobile_site() {

  // Assume that the device is viewing the desktop site until we can prove
  // otherwise
  $type = 'desktop';

  // Implement some sort of algorithm to determine whether the user is viewing
  // the desktop or the mobile site
  $current_page_type = custom_detection_algorithm();
  if ($current_page_type == 'mobile_page') {
    $type = 'mobile';
  }
  return $type;
}