You are here

function wsclient_ui_validate_global_parameters in Web service client 7

FAPI callback to validate the form for editing global parameter info.

1 string reference to 'wsclient_ui_validate_global_parameters'
wsclient_service_form in wsclient_ui/wsclient_ui.inc
Provides a form to add, edit and clone web service descriptions.

File

wsclient_ui/wsclient_ui.inc, line 1128
WSClient UI - implements service description management and configuration screens.

Code

function wsclient_ui_validate_global_parameters($elements, &$form_state) {
  $names = array();
  foreach (element_children($elements['items']) as $item_key) {
    $element =& $elements['items'][$item_key];
    if ($element['name']['#value']) {
      if (isset($names[$element['name']['#value']])) {
        form_error($element['name'], t('The name %name is already taken.', array(
          '%name' => $element['name']['#value'],
        )));
      }
      $names[$element['name']['#value']] = TRUE;
    }
  }
}