You are here

function l10n_update_admin_settings_form in Localization update 7

Same name and namespace in other branches
  1. 6 l10n_update.admin.inc \l10n_update_admin_settings_form()
  2. 7.2 l10n_update.admin.inc \l10n_update_admin_settings_form()

Page callback: Settings form.

1 string reference to 'l10n_update_admin_settings_form'
l10n_update_menu in ./l10n_update.module
Implements hook_menu().

File

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

Code

function l10n_update_admin_settings_form($form, &$form_state) {
  $form['l10n_update_check_mode'] = array(
    '#type' => 'radios',
    '#title' => t('Update source'),
    '#default_value' => variable_get('l10n_update_check_mode', L10N_UPDATE_CHECK_ALL),
    '#options' => _l10n_update_admin_check_options(),
  );
  $form['l10n_update_import_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['l10n_update_check_frequency'] = array(
    '#type' => 'radios',
    '#title' => t('Check for updates'),
    '#default_value' => variable_get('l10n_update_check_frequency', 0),
    '#options' => array(
      0 => t('Never (manually)'),
      1 => t('Daily'),
      7 => t('Weekly'),
    ),
    '#description' => t('Select how frequently you want to automatically check for updated translations for installed modules and themes.'),
  );
  $form['l10n_update_check_disabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Check for updates of disabled modules and themes'),
    '#default_value' => variable_get('l10n_update_check_disabled', 0),
    '#description' => t('Note that this comes with a performance penalty, so it is not recommended.'),
  );
  $form['l10n_update_download_store'] = array(
    '#title' => t('Store downloaded files'),
    '#type' => 'textfield',
    '#default_value' => variable_get('l10n_update_download_store', ''),
    '#description' => t('A path relative to the Drupal installation directory where translation files will be stored, e.g. sites/all/translations. Saved translation files can be reused by other installations. If left empty the downloaded translation will not be saved.'),
  );
  $form = system_settings_form($form);
  $form['#submit'][] = 'l10n_update_admin_settings_form_submit';
  return $form;
}