summaryrefslogtreecommitdiffstats
path: root/i18n.admin.inc
blob: 06e8c67850973126dffdfb0cee8b51ff0d2550dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
// $Id$

/**
 * @file
 * Extended multilanguage administration and module settings UI.
 */

/**
 * Form builder function.
 * 
 * TO DO: Add exclude paths for content selection
 * Some options have been removed from previous versions:
 * - Languages are now taken from locale module unless defined in settings file
 * - Language dependent tables are authomatically used if defined in settings file
 */
function i18n_admin_settings() {
  // Content selection options
  $form['selection'] = array(
    '#type' => 'fieldset',
    '#title' => t('Content selection'),
    //'#collapsible' => TRUE,
    //'#collapsed' => TRUE,
  );
  $form['selection']['i18n_selection_mode'] = array(
    '#type' => 'radios',
    '#title' => t('Content selection mode'),
    '#default_value' => variable_get('i18n_selection_mode', 'simple'),
    '#options' => _i18n_selection_mode(),
    '#description' => t('Determines which content to show depending on language.'),
  );
  return system_settings_form($form);
}

// List of selection modes
function _i18n_selection_mode(){
  return array(
    'simple' => t('Only current language and no language'),
    'mixed' => t('Only current and default languages and no language'),
    'default' => t('Only default language and no language'),    
    'strict' => t('Only current language'),
    'off' => t('All content. No language conditions apply'),    
  );
}