You are here

function themekey_locale_themekey_properties in ThemeKey 7.3

Same name and namespace in other branches
  1. 6.4 modules/themekey.locale.inc \themekey_locale_themekey_properties()
  2. 6 modules/themekey.locale.inc \themekey_locale_themekey_properties()
  3. 6.2 modules/themekey.locale.inc \themekey_locale_themekey_properties()
  4. 6.3 modules/themekey.locale.inc \themekey_locale_themekey_properties()
  5. 7 modules/themekey.locale.inc \themekey_locale_themekey_properties()
  6. 7.2 modules/themekey.locale.inc \themekey_locale_themekey_properties()

Implements hook_themekey_properties().

Provides additional properties for the ThemeKey module:

  • locale:language
  • locale:language_content
  • locale:language_from_browser

Return value

array of themekey properties and mapping functions

File

modules/themekey.locale.inc, line 26
Provides some node attributes as ThemeKey properties.

Code

function themekey_locale_themekey_properties() {

  // Attributes for properties
  $attributes = array();
  $attributes['locale:language'] = array(
    'description' => t('Locale: Language - The code of the current site language, formatted like "en" or "de" or "neutral". See !link for the codes of your enabled languages', array(
      '!link' => l(t('!path', array(
        '!path' => 'admin/config/language',
      )), 'admin/config/language'),
    )),
    'validator' => 'themekey_validator_language',
    'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
  );
  $attributes['locale:language_content'] = array(
    'description' => t('Locale: Language Content - The code of the current content language, formatted like "en" or "de" or "neutral". See !link for the codes of your enabled languages', array(
      '!link' => l(t('!path', array(
        '!path' => 'admin/config/language',
      )), 'admin/config/language'),
    )),
    'validator' => 'themekey_validator_language',
    'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
  );
  $attributes['locale:language_from_browser'] = array(
    'description' => t('Locale: Language From Browser - Identify best matching language from the Accept-language HTTP header we got.'),
    'validator' => 'themekey_validator_language',
    'page cache' => THEMEKEY_PAGECACHE_UNSUPPORTED,
  );
  $maps = array();
  $maps[] = array(
    'src' => 'system:dummy',
    'dst' => 'locale:language_from_browser',
    'callback' => 'themekey_locale_dummy2language_from_browser',
  );
  return array(
    'attributes' => $attributes,
    'maps' => $maps,
  );
}