You are here

public function ServicesClientMappingPlugin::configFormSubmit in Services Client 7.2

Submit configuration form and save config.

Overrides ServicesClientPlugin::configFormSubmit

File

include/mapping.inc, line 231

Class

ServicesClientMappingPlugin
Mapping plugin wrapper which represents mapping row.

Code

public function configFormSubmit(&$form, &$form_state) {
  if (isset($form_state['clicked_button']) && $form_state['clicked_button']['#value'] == t('Cancel')) {
    return;
  }
  $this->config['reader'] = $form_state['values']['reader'];
  $this->config['formatter'] = $form_state['values']['formatter'];
  if (!empty($form_state['reader_plugin'])) {
    $form_state['reader_plugin']
      ->configFormSubmit($form, $form_state);
    $this->config['reader_config'] = $form_state['reader_plugin']
      ->getConfiguration();
  }
  if (!empty($form_state['formatter_plugin'])) {
    $form_state['formatter_plugin']
      ->configFormSubmit($form, $form_state);
    $this->config['formatter_config'] = $form_state['formatter_plugin']
      ->getConfiguration();
  }
}