You are here

function locale_languages_overview_form in Drupal 6

Same name and namespace in other branches
  1. 7 modules/locale/locale.admin.inc \locale_languages_overview_form()

User interface for the language overview screen.

Related topics

1 string reference to 'locale_languages_overview_form'
locale_menu in modules/locale/locale.module
Implementation of hook_menu().

File

includes/locale.inc, line 30
Administration functions for locale.module.

Code

function locale_languages_overview_form() {
  $languages = language_list('language', TRUE);
  $options = array();
  $form['weight'] = array(
    '#tree' => TRUE,
  );
  foreach ($languages as $langcode => $language) {

    // Language code should contain no markup, but is emitted
    // by radio and checkbox options.
    $langcode = check_plain($langcode);
    $options[$langcode] = '';
    if ($language->enabled) {
      $enabled[] = $langcode;
    }
    $form['weight'][$langcode] = array(
      '#type' => 'weight',
      '#default_value' => $language->weight,
    );
    $form['name'][$langcode] = array(
      '#value' => check_plain($language->name),
    );
    $form['native'][$langcode] = array(
      '#value' => check_plain($language->native),
    );
    $form['direction'][$langcode] = array(
      '#value' => $language->direction == LANGUAGE_RTL ? t('Right to left') : t('Left to right'),
    );
  }
  $form['enabled'] = array(
    '#type' => 'checkboxes',
    '#options' => $options,
    '#default_value' => $enabled,
  );
  $form['site_default'] = array(
    '#type' => 'radios',
    '#options' => $options,
    '#default_value' => language_default('language'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  $form['#theme'] = 'locale_languages_overview_form';
  return $form;
}