You are here

public function WsclientRestXMLFormatter::formSubmit in Web service client 7

File

wsclient_rest/wsclient_rest.inc, line 318
Web service client REST - include file.

Class

WsclientRestXMLFormatter

Code

public function formSubmit($form, &$form_state) {
  switch ($form_state['form']) {
    case 'main':

      // Remove XML settings from the formatters that are not XML.
      foreach (array(
        'send_formatter',
        'receive_formatter',
      ) as $formatter_type) {
        if (empty($form_state['values']['settings'][$formatter_type]['formatter'])) {
          continue;
        }
        if ($form_state['values']['settings'][$formatter_type]['formatter'] != 'WsclientRestXMLFormatter') {
          foreach (array(
            'default_root',
            'adaptive_root',
          ) as $setting) {
            unset($form_state['values']['settings'][$formatter_type]['settings'][$setting]);
          }
        }
      }
      break;
  }
}