You are here

function mobile_tools_switch_options in Mobile Tools 7.3

Same name and namespace in other branches
  1. 7.2 mobile_tools.module \mobile_tools_switch_options()

Generate the options required for PURL to rewrite the URL

Parameters

string $device_group: The device group you want to switch to.

Return value

string Returns options array to pass into l() or url().

File

./mobile_tools.module, line 590
Functionality to ease the creation of mixed device environments.

Code

function mobile_tools_switch_options($device_group, $options = array()) {

  // Set the options required for each device group
  $device_groups = mobile_tools_device_group_load_all();

  // @todo redo this function
  if (isset($device_groups[$device_group])) {

    // Set the options required to get the link for the mobile site
    $options['purl']['provider'] = MOBILE_TOOLS_PURL_PROVIDER;
    $options['purl']['id'] = $device_group;
    return $options;
  }

  // Disable purl if unknown group
  $options['purl']['disabled'] = TRUE;
  return $options;
}