You are here

function _locale_admin_manage_add_screen in Drupal 4

Same name and namespace in other branches
  1. 5 includes/locale.inc \_locale_admin_manage_add_screen()

User interface for the language addition screen.

1 call to _locale_admin_manage_add_screen()
locale_admin_manage_add in modules/locale.module
Page handler for the language addition screen

File

includes/locale.inc, line 128
Admin-related functions for locale.module.

Code

function _locale_admin_manage_add_screen() {
  $isocodes = _locale_prepare_iso_list();
  $form = array();
  $form['language list'] = array(
    '#type' => 'fieldset',
    '#title' => t('Language list'),
    '#collapsible' => TRUE,
  );
  $form['language list']['langcode'] = array(
    '#type' => 'select',
    '#title' => t('Language name'),
    '#default_value' => key($isocodes),
    '#options' => $isocodes,
    '#description' => t('Select your language here, or add it below, if you are unable to find it.'),
  );
  $form['language list']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add language'),
  );
  $output = drupal_get_form('locale_add_language_form', $form);
  $form = array();
  $form['custom language'] = array(
    '#type' => 'fieldset',
    '#title' => t('Custom language'),
    '#collapsible' => TRUE,
  );
  $form['custom language']['langcode'] = array(
    '#type' => 'textfield',
    '#title' => t('Language code'),
    '#size' => 12,
    '#maxlength' => 60,
    '#required' => TRUE,
    '#description' => t("Commonly this is an <a href=\"%iso-codes\">ISO 639 language code</a> with an optional country code for regional variants. Examples include 'en', 'en-US' and 'zh-cn'.", array(
      '%iso-codes' => 'http://www.w3.org/WAI/ER/IG/ert/iso639.htm',
    )),
  );
  $form['custom language']['langname'] = array(
    '#type' => 'textfield',
    '#title' => t('Language name in English'),
    '#maxlength' => 64,
    '#required' => TRUE,
    '#description' => t('Name of the language. Will be available for translation in all languages.'),
  );
  $form['custom language']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add custom language'),
  );

  // Use the validation and submit functions of the add language form.
  $output .= drupal_get_form('locale_custom_language_form', $form, 'locale_add_language_form');
  return $output;
}