You are here

function wsdata_language_plugin_replace_form in Web Service Data 7

Replacement language plugin form

1 string reference to 'wsdata_language_plugin_replace_form'
wsdata_wsdata_language_plugin in ./wsdata.module
Implements hook_wsdata_language_plugin().

File

./wsdata.admin.inc, line 117
Administrator forms for wsdata

Code

function wsdata_language_plugin_replace_form($settings = array()) {
  $form['default'] = array(
    '#type' => 'textfield',
    '#title' => t('Default value'),
    '#description' => t('Default value if language replacement is not available.'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => isset($settings['default']) ? $settings['default'] : '',
  );
  $languages = language_list();
  foreach ($languages as $language) {
    $form[$language->language] = array(
      '#type' => 'textfield',
      '#title' => $language->native,
      '#description' => t('Value to use when requesting @lang values.', array(
        '@lang' => $language->native,
      )),
      '#size' => 40,
      '#maxlength' => 255,
      '#default_value' => isset($settings[$language->language]) ? $settings[$language->language] : $language->language,
    );
  }
  return $form;
}