You are here

function themekey_og_context_themekey_properties in ThemeKey 7.2

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

Implements hook_themekey_properties().

Provides additional properties for module ThemeKey:

  • group:id
  • group:type

Return value

array of themekey properties and mapping functions

File

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

Code

function themekey_og_context_themekey_properties() {

  // Attributes for properties
  $attributes = array();
  $attributes['group:id'] = array(
    'description' => t('Group: ID - The og group ID'),
    'validator' => 'themekey_validator_ctype_digit',
    'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
  );
  $attributes['group:type'] = array(
    'description' => t('Group: Type - The type of a og group'),
    // TODO
    // 'validator' => 'themekey_validator_og_group_type',
    'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
  );

  // Mapping functions
  $maps = array();
  $maps[] = array(
    'src' => 'node:nid',
    'dst' => 'group:id',
    'callback' => 'themekey_og_context_nid2gid',
  );
  $maps[] = array(
    'src' => 'node:nid',
    'dst' => 'group:type',
    'callback' => 'themekey_og_context_nid2type',
  );
  return array(
    'attributes' => $attributes,
    'maps' => $maps,
  );
}