8 * Implements hook_variable_group_info()
10 function i18n_variable_group_info() {
11 $groups['i18n'] = array(
12 'title' => t('Multilingual settings'),
13 'description' => t('Mixed options for multilingual sites.'),
14 'access' => 'administer site configuration',
15 'path' => 'admin/config/regional/i18n',
21 * Implements hook_variable_info()
23 function i18n_variable_info($options = array()) {
24 $variables['i18n_language_list'] = array(
25 'title' => t('Languages for content', array(), $options),
26 'description' => t('Determines which languages will be allowed for content creation.', array(), $options),
28 'options callback' => 'i18n_variable_option_list',
29 'default' => I18N_LANGUAGE_ENABLED
,
36 * Implements hook_variable_type_info()
38 function i18n_variable_type_info() {
39 // Multiple variable per language options
40 $types['multiple_language'] = array(
41 'title' => t('Multiple'),
42 'element' => array('#type' => 'fieldset'),
43 'build callback' => 'variable_build_multiple',
44 'format callback' => 'variable_format_multiple',
45 'element callback' => 'variable_form_element_multiple',
46 'value callback' => 'variable_multiple_get_value',
47 'default callback' => 'variable_multiple_get_default',
48 'multiple callback' => 'i18n_variable_multiple_language_options',
49 'language list' => I18N_LANGUAGE_EXTENDED
,
55 * Options for content languages
57 function i18n_variable_option_list($variable, $options = array()) {
59 I18N_LANGUAGE_ENABLED
=> t('Enabled languages only.', array(), $options),
60 I18N_LANGUAGE_EXTENDED
=> t('All defined languages will be allowed.', array(), $options),
67 * Callback for multiple per-language variables
69 function i18n_variable_multiple_language_options($variable, $options = array()) {
70 return i18n_language_list('name', $variable['language list']);