You are here

function themekey_og_context_nid2gid in ThemeKey 7.2

Same name and namespace in other branches
  1. 7.3 modules/themekey.og_context.inc \themekey_og_context_nid2gid()

ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).

src: node:nid dst: group:id

Parameters

$nid: a node id

Return value

int or NULL if no value could be mapped

1 string reference to 'themekey_og_context_nid2gid'
themekey_og_context_themekey_properties in modules/themekey.og_context.inc
Implements hook_themekey_properties().

File

modules/themekey.og_context.inc, line 77
Provides some og attributes as ThemeKey properties.

Code

function themekey_og_context_nid2gid($nid) {

  // look for group info from context
  if ($group = og_context()) {
    return $group['gid'];
  }
  return NULL;
}