Critical bug fix
[project/i18n.git] / i18n_node / i18n_node.variable.inc
1 <?php
2 /**
3 * @file
4 * Variable information
5 */
6
7 /**
8 * Implements hook_variable_group_info().
9 */
10 function i18n_node_variable_group_info() {
11 $groups['i18n_node'] = array(
12 'title' => t('Multilingual node options'),
13 'description' => t('Extended node options for multilingual sites.'),
14 'access' => 'administer site configuration',
15 'path' => 'admin/config/regional/i18n/node',
16 );
17 return $groups;
18 }
19
20 /**
21 * Implements hook_variable_info().
22 */
23 function i18n_node_variable_info($options = array()) {
24 $variables['i18n_hide_translation_links'] = array(
25 'type' => 'boolean',
26 'title' => t('Hide content translation links', array(), $options),
27 'description' => t('Hide the links to translations in content body and teasers. If you choose this option, switching language will only be available from the language switcher block.', array(), $options),
28 'default' => 0,
29 'group' => 'i18n_node',
30 );
31 $variables['i18n_node_default_language_none'] = array(
32 'title' => t('Default language for content types with Multilingual support disabled.', array(), $options),
33 'description' => t('Determines which language will be set for newly created content of types that don\'t have Multilingual support enabled.', array(), $options),
34 'type' => 'select',
35 'options' => array(
36 0 => t('The site\'s default language (Default behaviour).', array(), $options),
37 1 => t('Language neutral (Recommended).', array(), $options)
38 ),
39 'default' => 0,
40 'group' => 'i18n_node',
41 );
42 $variables['i18n_node_options_[node_type]'] = array(
43 'type' => 'multiple',
44 'title' => t('Extended language options', array(), $options),
45 'repeat' => array(
46 'type' => 'options',
47 'options' => array(
48 'current' => t('Set current language as default for new content.', array(), $options),
49 'required' => t('Require language (Do not allow Language Neutral).', array(), $options),
50 'lock' => t('Lock language (Cannot be changed).', array(), $options),
51 ),
52 ),
53 'group' => 'i18n',
54 );
55 $variables['i18n_node_extended_[node_type]'] = array(
56 'type' => 'multiple',
57 'title' => t('Extended language support'),
58 'repeat' => array(
59 'type' => 'select',
60 'options callback' => 'i18n_node_variable_extended_options',
61 'default' => I18N_LANGUAGE_ENABLED,
62 ),
63 'description' => t('If enabled, all defined languages will be allowed for this content type in addition to only enabled ones. This is useful to have more languages for content than for the interface.', array(), $options),
64 'group' => 'i18n',
65 );
66
67 return $variables;
68 }
69
70 /**
71 * Options callback for i18n_node_extended_
72 */
73 function i18n_node_variable_extended_options($variable, $options) {
74 return array(
75 I18N_LANGUAGE_ENABLED => t('Normal - All enabled languages will be allowed.', array(), $options),
76 I18N_LANGUAGE_EXTENDED => t('Extended - All defined languages will be allowed.', array(), $options),
77 I18N_LANGUAGE_EXTENDED | I18N_LANGUAGE_HIDDEN => t('Extended, but not displayed - All defined languages will be allowed for input, but not displayed in links.', array(), $options),
78 );
79 }