You are here

function wsdata_language_plugin_argument_form in Web Service Data 7

Argument language plugin form

2 string references to 'wsdata_language_plugin_argument_form'
hook_wsdata_language_plugin in ./wsdata.api.php
List of language handler plugins
wsdata_wsdata_language_plugin in ./wsdata.module
Implements hook_wsdata_language_plugin().

File

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

Code

function wsdata_language_plugin_argument_form($settings = array()) {
  $form['argument'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#description' => t('Name of the argument to set. Default is "lang"'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => isset($settings['name']) ? $settings['name'] : 'lang',
  );
  $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;
}