You are here

function admin_language_settings in Administration Language 6

Same name and namespace in other branches
  1. 7 admin_language.module \admin_language_settings()

Settings form.

1 string reference to 'admin_language_settings'
admin_language_menu in ./admin_language.module
Implementation of hook_menu().

File

./admin_language.module, line 325
Makes sure all admin pages are displayed in the preferred language of the administrator.

Code

function admin_language_settings() {
  $form = array();
  $options = array(
    ADMIN_LANGUAGE_ALL_PAGES => t('Use administration language on every page except the listed pages.'),
    ADMIN_LANGUAGE_SOME_PAGES => t('Use administration language on only the listed pages.'),
  );
  $description = t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are %admin for the admin dashboard and %admin-wildcard for all administration pages. %front is the front page.", array(
    '%admin' => 'admin',
    '%admin-wildcard' => 'admin/*',
    '%front' => '<front>',
  ));
  $form['admin_language']['admin_language_visibility'] = array(
    '#type' => 'radios',
    '#title' => t('Use administration language on specific pages'),
    '#options' => $options,
    '#default_value' => variable_get('admin_language_visibility', ADMIN_LANGUAGE_SOME_PAGES),
  );
  $form['admin_language']['admin_language_pages'] = array(
    '#type' => 'textarea',
    '#title' => t('Pages'),
    '#default_value' => variable_get('admin_language_pages', ADMIN_LANGUAGE_DEFAULT_PAGES),
    '#description' => $description,
  );
  $form['admin_language_hide_user'] = array(
    '#type' => 'radios',
    '#title' => t('Hide administration language on user form'),
    '#description' => t('Select this option if you want to exclude the admin language from the language selection widget on the user edit form.'),
    '#options' => array(
      t('Disabled'),
      t('Enabled'),
    ),
    '#default_value' => variable_get('admin_language_hide_user', 0),
  );
  $form['admin_language_hide_node'] = array(
    '#type' => 'radios',
    '#title' => t('Hide administration language on node form'),
    '#description' => t('Select this option if you want to exclude the admin language from the language selection widget on the node edit form.'),
    '#options' => array(
      t('Disabled'),
      t('Enabled'),
    ),
    '#default_value' => variable_get('admin_language_hide_node', 0),
  );
  $form['admin_language_force_default'] = array(
    '#type' => 'radios',
    '#title' => t('Force use of default language'),
    '#description' => t('Select this option if you want to force the use of the default language on the node edit form. This setting overrides the <em>Hide admin language on user form</em> setting.'),
    '#options' => array(
      t('Disabled'),
      t('Enabled'),
    ),
    '#default_value' => variable_get('admin_language_force_default', 0),
  );
  $form['admin_language_force_neutral'] = array(
    '#type' => 'radios',
    '#title' => t('Force language neutral aliases'),
    '#description' => t('Select this option if you want to force the use of language neutral URL aliases. In some cases (i.e. if you only use an administration language and a site language) this can help make aliases more consistent.'),
    '#options' => array(
      t('Disabled'),
      t('Enabled'),
    ),
    '#default_value' => variable_get('admin_language_force_neutral', 0),
  );
  if (module_exists('admin_menu')) {
    $form['admin_language_translate_admin_menu'] = array(
      '#type' => 'radios',
      '#title' => t('Use administration language in the administration menu'),
      '#description' => t('Select this option if you want to display the administration menu using the administration language on all pages.'),
      '#options' => array(
        t('Disabled'),
        t('Enabled'),
      ),
      '#default_value' => variable_get('admin_language_translate_admin_menu', 0),
    );
  }
  return system_settings_form($form);
}