You are here

mobile_tools.api.php in Mobile Tools 7.3

Same filename and directory in other branches
  1. 6.2 mobile_tools.api.php
  2. 7.2 mobile_tools.api.php

API functions for mobile_tools

File

mobile_tools.api.php
View source
<?php

/**
 * @file
 * API functions for mobile_tools
 */

/**
 * Define the list of device groups available to mobile_tools
 *
 * Set a list of id/human readable pairs of arbitrary device groupings.
 * Do not wrap the name in the t() function. The value will be translated
 * later on before display to ensure proper translation.
 *
 * You can name your device groups however you like.
 * Ensure the keys contain only lowercase, alphanumeric values along
 * with dashes and/or underscores.
 *
 * Used to define a device "space" and used as the default values
 * in the hook_purl_provider() implementation in mobile_tools.module
 *
 * Only one implementation of this hook is triggered at any given time. The
 * options for which module to use are configurable in the administrative
 * pages for mobile_tools.
 *
 * @return array
 *  Returns an array of device groups
 */
function hook_mobile_tools_device_groups() {
  return array(
    'iphone' => 'iPhone',
    'ipod' => 'iPod',
    'ipad' => 'iPad',
    'android' => 'Android',
    'opera_mini' => 'Opera Mini',
    'blackberry' => 'BlackBerry',
  );
}

/**
 * Allow a module to detect the device making the page request
 *
 * @todo write documentation
 * @see mobile_tools_browscap
 */
function hook_mobile_tools_device_detector_info() {
}

/**
 * Detect if the given feature is available for the given device.
 *
 * @param string $capability
 *  Name of the capability to test
 * @param string $device
 *  Name of the device to test
 * @return boolean
 *  Returns TRUE if the device is capable, FALSE otherwise.
 *
 * @todo verify the notes on this hook
 * @todo see how this works
 */
function hook_mobile_tools_device_capability($capability, $device = NULL) {
}

Functions

Namesort descending Description
hook_mobile_tools_device_capability Detect if the given feature is available for the given device.
hook_mobile_tools_device_detector_info Allow a module to detect the device making the page request
hook_mobile_tools_device_groups Define the list of device groups available to mobile_tools