You are here

function _mobile_switch_get_site_version in Mobile Switch 7.2

Identify the current website version on a multisite.

Do not call this function outside from redirect context.

Parameters

$get: The associative array contains various setting parameter.

Return value

string Possible string values: desktop or mobile

See also

mobile_switch_boot()

mobile_switch_init()

2 calls to _mobile_switch_get_site_version()
mobile_switch_boot in ./mobile_switch.module
Implements hook_boot().
mobile_switch_init in ./mobile_switch.module
Implements hook_init().

File

./mobile_switch.module, line 466
Provides various functionalities to develop mobile ready websites.

Code

function _mobile_switch_get_site_version($get) {
  static $site_variant;
  if (!isset($site_variant)) {

    // The current host URL.
    $current_url = 'http://' . $_SERVER['HTTP_HOST'];
    $site_variant = FALSE;
    if (stristr(variable_get('mobile_switch_redirect_url_to_desktop', ''), $current_url)) {
      $site_variant = 'desktop';
    }
    if (stristr(variable_get('mobile_switch_redirect_url_to_mobile', ''), $current_url)) {
      $site_variant = 'mobile';
    }
  }
  return $site_variant;
}