You are here

function _mobile_tools_get_active_purl_provider in Mobile Tools 7.3

Get the list of active providers.

Optionally, check for a specific provider

Parameters

array $modifiers: List of modifiers

string $provider [optional]: Provider name to match against

Return value

array|boolean Returns a list of providers or TRUE if the given provider is active, FALSE otherwise.

1 call to _mobile_tools_get_active_purl_provider()
mobile_tools_redirection_disabled in ./mobile_tools.module
Check if the redirection is disabled or not

File

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

Code

function _mobile_tools_get_active_purl_provider($modifiers, $provider = NULL) {
  $providers = array();
  foreach ($modifiers as $type => $set) {
    foreach ($set as $modifier) {
      if (!is_null($provider) and $modifier->provider == $provider) {
        return TRUE;
      }
      $providers[$modifier->{$provider}] = $modifier->{$provider};
    }
  }
  if (!is_null($provider)) {
    return FALSE;
  }
  else {
    return $providers;
  }
}