You are here

function og_context_provider_weight in Organic groups 7.2

Same name and namespace in other branches
  1. 7 og_context/og_context.module \og_context_provider_weight()

Return the passed group context provider weight or a default value.

Parameters

$provider: A group context provider data structure.

Return value

A numeric weight.

2 calls to og_context_provider_weight()
og_context_negotiation_set in og_context/og_context.module
Save a list of language providers.
_og_context_configure_form_table in og_context/og_context.admin.inc
Helper function to build a group context provider table.

File

og_context/og_context.module, line 388
Get a group from a viewed page.

Code

function og_context_provider_weight($provider) {
  $default = is_numeric($provider) ? $provider : 0;
  return isset($provider['weight']) && is_numeric($provider['weight']) ? $provider['weight'] : $default;
}