i18n_node.variable.inc 3.1 KB

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