You are here

function views_crosstab_table::options_validate in Views Crosstab 6

Same name and namespace in other branches
  1. 7 plugins/views_crosstab_table.inc \views_crosstab_table::options_validate()

File

./views_crosstab_table.inc, line 87

Class

views_crosstab_table
Style plugin to transform a linear query into a crosstab table.

Code

function options_validate(&$form, &$form_state) {
  parent::options_validate($form, $form_state);
  foreach ($options as $option => $option_name) {
    foreach ($options as $optiontest => $optiontest_name) {
      if ($option == $optiontest) {
        break;
      }
      if ($form_state['values']['style_options'][$option] == $form_state['values']['style_options'][$optiontest]) {
        $field = $form_state['values']['style_options'][$option];
        $error_items = array(
          '%field' => $form['info'][$field]['name']['#value'],
          '%option' => $option_name,
          '%optiontest' => $optiontest_name,
        );
        form_error($form[$option][$field], t('You cannot set the same field (%field) to be a source for <strong>both</strong> %option and %optiontest.', $error_items));
      }
    }
  }
}