function themekey_user_themekey_properties in ThemeKey 6.4
Same name and namespace in other branches
- 6 modules/themekey.user.inc \themekey_user_themekey_properties()
- 6.2 modules/themekey.user.inc \themekey_user_themekey_properties()
- 6.3 modules/themekey.user.inc \themekey_user_themekey_properties()
- 7.3 modules/themekey.user.inc \themekey_user_themekey_properties()
- 7 modules/themekey.user.inc \themekey_user_themekey_properties()
- 7.2 modules/themekey.user.inc \themekey_user_themekey_properties()
Implements hook_themekey_properties().
Provides additional properties for module ThemeKey:
- user:hostname
- user:language
- user:name
- user:uid
Return value
array of themekey properties and mapping functions
File
- modules/
themekey.user.inc, line 27 - Provides some user attributes as ThemeKey properties.
Code
function themekey_user_themekey_properties() {
// Attributes for properties
$attributes = array();
$attributes['user:hostname'] = array(
'description' => t("User: Hostname - The user hostname property which is the IP address of client machine, adjusted for reverse proxy. Text from Drupal bootstrap.inc:\n If Drupal is behind a reverse proxy, we use the X-Forwarded-For header instead of \$_SERVER['REMOTE_ADDR'], which would be the IP address of the proxy server, and not the client's."),
'validator' => 'themekey_validator_http_host',
'page cache' => THEMEKEY_PAGECACHE_UNSUPPORTED,
);
$attributes['user:language'] = array(
'description' => t('User: Language - The language the user has set in the settings on his profile page.
Format is the language code (for example "en" for English or "de" for German) that can be found on !link.', array(
'!link' => l(t('!path', array(
'!path' => 'admin/settings/language',
)), 'admin/settings/language'),
)),
'validator' => 'themekey_validator_language',
'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
);
$attributes['user:name'] = array(
'description' => t('User: Name - The user\'s username. See !link for your users.', array(
'!link' => l(t('!path', array(
'!path' => 'admin/user/user/list',
)), 'admin/user/user/list'),
)),
'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
);
$attributes['user:uid'] = array(
'description' => t('User: ID - The id of the user (uid). The user id can be found in the URL of the user\'s profile page, "user/23" or "user/23/edit" (23 = uid). See !link for your users.', array(
'!link' => l(t('!path', array(
'!path' => 'admin/user/user/list',
)), 'admin/user/user/list'),
)),
'validator' => 'themekey_validator_ctype_digit',
'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
);
return array(
'attributes' => $attributes,
);
}