You are here

function _webform_chart_form_configure_validate in Webform Chart 7

Same name and namespace in other branches
  1. 7.2 webform_chart.admin.inc \_webform_chart_form_configure_validate()

Provides a validation handler for administration form.

Enable backend configuration validation if necessay. This invokes all *module_name*_wbc_backends_configuration_validate functions so other modules may provide additional back ends validation process.

The *module_name*_wbc_backends_configuration_validate must return an array "key/value" to be display in form_set_error function using form_set_error

1 string reference to '_webform_chart_form_configure_validate'
webform_chart_form_webform_configure_form_alter in ./webform_chart.module
Implements hook_form_FORM_ID_alter().

File

./webform_chart.admin.inc, line 114
Provides administration functions for the webform_chart module.

Code

function _webform_chart_form_configure_validate(&$form, &$form_state) {
  $node =& $form['#node'];

  // Get the global configuration.
  $config = array();
  $config['backend'] = $form_state['values']['backend'];
  $config['config_method'] = $form_state['values']['config_method'];

  // Call the backend specific form validation.
  if ($form_state['values']['config_method'] == 0) {
    $backend = $form_state['values']['backend'];
    $fn = $backend . '_wfc_component_validate';
    if (function_exists($fn)) {
      $config['config'] = $fn($form_state);
    }
  }
  $node->webform['charting'] = serialize($config);
}