function taxonomy_manager_double_tree_switch_validate in Taxonomy Manager 7
1 call to taxonomy_manager_double_tree_switch_validate()
1 string reference to 'taxonomy_manager_double_tree_switch_validate'
File
- ./
taxonomy_manager.admin.inc, line 2150
Code
function taxonomy_manager_double_tree_switch_validate($form, &$form_state) {
$values = array();
if (strpos($form_state['input']['_triggering_element_name'], 'right') !== FALSE) {
//move right
$values = array(
'selected_parents' => $form_state['values']['taxonomy2']['manager']['tree']['selected_terms'],
'selected_terms' => $form_state['values']['taxonomy']['manager']['tree']['selected_terms'],
'left_tree_expand_terms' => $form_state['values']['taxonomy']['manager']['tree']['selected_terms_direct_parents'],
'right_tree_expand_terms' => $form_state['values']['taxonomy']['manager']['tree']['selected_terms'],
'voc1' => $form_state['values']['voc']->vid,
'voc2' => $form_state['values']['voc2']->vid,
);
}
else {
//move left
$values = array(
'selected_parents' => $form_state['values']['taxonomy']['manager']['tree']['selected_terms'],
'selected_terms' => $form_state['values']['taxonomy2']['manager']['tree']['selected_terms'],
'left_tree_expand_terms' => $form_state['values']['taxonomy2']['manager']['tree']['selected_terms'],
'right_tree_expand_terms' => $form_state['values']['taxonomy2']['manager']['tree']['selected_terms_direct_parents'],
'voc1' => $form_state['values']['voc2']->vid,
'voc2' => $form_state['values']['voc']->vid,
);
}
$values['update_tree_right'] = TRUE;
$values['update_tree_left'] = TRUE;
if (!count($values['selected_terms'])) {
form_set_error('', t("No terms selected."));
}
form_set_value(array(
'#parents' => array(
'double_tree_values',
),
), $values, $form_state);
}