You are here

function l10n_update_admin_import_form in Localization update 6

Same name and namespace in other branches
  1. 7 l10n_update.admin.inc \l10n_update_admin_import_form()

Translation update form.

@todo selectable packages @todo check language support in server @todo check file update dates

Parameters

$form_state: Form states array.

$projects: @todo $projects are not used in the form.

$updates: Updates to be displayed in the form.

1 string reference to 'l10n_update_admin_import_form'
l10n_update_admin_overview in ./l10n_update.admin.inc
Page callback: Admin overview page.

File

./l10n_update.admin.inc, line 72
Admin settings and update page.

Code

function l10n_update_admin_import_form($form_state, $projects, $updates) {

  //module_load_include('inc', 'l10n_update');

  // For now we get package information provided by modules
  $projects = l10n_update_get_projects();
  $languages = l10n_update_language_list('name');
  if ($projects && $languages) {
    $form['updates'] = array(
      '#type' => 'value',
      '#value' => $updates,
    );
    $form['lang'] = array(
      '#type' => 'fieldset',
      '#title' => t('Languages'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#description' => t('Select one or more languages to download and update. If you select none, all of them will be updated.'),
    );
    $form['lang']['languages'] = array(
      '#type' => 'checkboxes',
      '#options' => $languages,
    );
    $form['mode'] = array(
      '#type' => 'radios',
      '#title' => t('Update mode'),
      '#default_value' => variable_get('l10n_update_import_mode', LOCALE_IMPORT_KEEP),
      '#options' => _l10n_update_admin_import_options(),
    );
    $form['buttons']['download'] = array(
      '#type' => 'submit',
      '#value' => t('Update translations'),
    );
    $form['buttons']['refresh'] = array(
      '#type' => 'submit',
      '#value' => t('Refresh information'),
    );
  }
  else {
    $form['warning'] = array(
      '#value' => t('No projects or languages to update.'),
    );
  }
  return $form;
}