~spreadubuntu/spreadubuntu/devel-drupal6

« back to all changes in this revision

Viewing changes to modules/i18n/i18n.admin.inc

  • Committer: ruben
  • Date: 2009-06-08 09:38:49 UTC
  • Revision ID: ruben@captive-20090608093849-s1qtsyctv2vwp1x1
SpreadUbuntu moving to Drupal6. Based on ubuntu-drupal theme and adding our modules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
// $Id: i18n.admin.inc,v 1.2.2.7 2009/01/21 13:08:35 jareyero Exp $
 
3
 
 
4
/**
 
5
 * @file
 
6
 * Extended multilanguage administration and module settings UI.
 
7
 */
 
8
 
 
9
/**
 
10
 * Form builder function.
 
11
 *
 
12
 * TO DO: Add exclude paths for content selection
 
13
 * Some options have been removed from previous versions:
 
14
 * - Languages are now taken from locale module unless defined in settings file.
 
15
 * - Language dependent tables are authomatically used if defined in settings file.
 
16
 */
 
17
function i18n_admin_settings() {
 
18
  // Content selection options.
 
19
  $form['selection'] = array(
 
20
    '#type' => 'fieldset',
 
21
    '#title' => t('Content selection'),
 
22
    //'#collapsible' => TRUE,
 
23
    //'#collapsed' => TRUE,
 
24
  );
 
25
  $form['selection']['i18n_selection_mode'] = array(
 
26
    '#type' => 'radios',
 
27
    '#title' => t('Content selection mode'),
 
28
    '#default_value' => variable_get('i18n_selection_mode', 'simple'),
 
29
    '#options' => _i18n_selection_mode(),
 
30
    '#description' => t('Determines which content to show depending on the current page language and the default language of the site.'),
 
31
  );
 
32
 
 
33
  // Node translation links setting.
 
34
  $form['links'] = array(
 
35
    '#type' => 'fieldset',
 
36
    '#title' => t('Content translation links'),
 
37
  );
 
38
  $form['links']['i18n_hide_translation_links'] = array(
 
39
    '#type' => 'checkbox',
 
40
    '#title' => t('Hide content translation links'),
 
41
    '#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.'),
 
42
    '#default_value' => variable_get('i18n_hide_translation_links', 0),
 
43
  );
 
44
  $form['links']['i18n_translation_switch'] = array(
 
45
    '#type' => 'checkbox',
 
46
    '#title' => t('Switch interface for translating'),
 
47
    '#default_value' => variable_get('i18n_translation_switch', 0),
 
48
    '#description' => t('Switch interface language to fit node language when creating or editing a translation. If not checked the interface language will be independent from node language.'),
 
49
  );
 
50
  return system_settings_form($form);
 
51
}
 
52
 
 
53
// List of selection modes
 
54
function _i18n_selection_mode() {
 
55
  return array(
 
56
    'simple' => t('Current language and language neutral.'),
 
57
    'mixed' => t('Mixed current language (if available) or default language (if not) and language neutral.'),
 
58
    'default' => t('Only default language and language neutral.'),
 
59
    'strict' => t('Only current language.'),
 
60
    'off' => t('All content. No language conditions apply.'),
 
61
  );
 
62
}
 
63