Project

General

Profile

Paste
Download (1.43 KB) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / modules / entity / modules / locale.info.inc @ 7d7b5830

1 85ad3d82 Assos Assos
<?php
2
3
/**
4
 * @file
5
 * Provides locale-related properties.
6
 */
7
8
/**
9
 * Implements hook_entity_property_info_alter() on top of locale module.
10
 *
11
 * @see entity_entity_property_info_alter()
12
 */
13
function entity_metadata_locale_entity_property_info_alter(&$info) {
14
15
  $info['user']['properties']['language'] = array(
16
    'label' => t("Language"),
17
    'description' => t("This account's default language for e-mails, and preferred language for site presentation."),
18
    'type' => 'token',
19
    'getter callback' => 'entity_metadata_locale_get_user_language',
20
    'setter callback' => 'entity_property_verbatim_set',
21
    'options list' => 'entity_metadata_language_list',
22
    'schema field' => 'language',
23
    'setter permission' => 'administer users',
24
  );
25
26
  $info['site']['properties']['current_page']['property info']['language'] = array(
27
    'label' => t("Interface language"),
28
    'description' => t("The language code of the current user interface language."),
29
    'type' => 'token',
30
    'getter callback' => 'entity_metadata_locale_get_languages',
31
    'options list' => 'entity_metadata_language_list',
32
  );
33
  $info['site']['properties']['current_page']['property info']['language_content'] = array(
34
    'label' => t("Content language"),
35
    'description' => t("The language code of the current content language."),
36
    'type' => 'token',
37
    'getter callback' => 'entity_metadata_locale_get_languages',
38
    'options list' => 'entity_metadata_language_list',
39
  );
40
}