function tripal_phylogeny_default_plots_form_submit

2.x tripal_phylogeny.admin.inc tripal_phylogeny_default_plots_form_submit($form, &$form_state)
3.x tripal_chado.phylotree.inc tripal_phylogeny_default_plots_form_submit($form, &$form_state)

_state

Parameters

unknown $form:

1 string reference to 'tripal_phylogeny_default_plots_form_submit'

File

tripal_phylogeny/includes/tripal_phylogeny.admin.inc, line 248
This file contains the functions used for administration of the module

Code

function tripal_phylogeny_default_plots_form_submit($form, &$form_state) {
  // Rebuild this form after submission so that any changes are reflected in
  // the flat tables.
  $form_state['rebuild'] = TRUE;

  if ($form_state['clicked_button']['#name'] == 'submit') {
    variable_set('tripal_phylogeny_default_phylogram_width', $form_state['values']['phylogram_width']);

    variable_set('tripal_phylogeny_default_root_node_size', $form_state['values']['root_node_size']);
    variable_set('tripal_phylogeny_default_interior_node_size', $form_state['values']['interior_node_size']);
    variable_set('tripal_phylogeny_default_leaf_node_size', $form_state['values']['leaf_node_size']);

    $num_orgs = $form_state['values']['num_orgs'];
    variable_set("tripal_phylogeny_num_orgs", $num_orgs);
    $colors = array();
    for ($i = 0; $i < $num_orgs; $i++) {
      $colors[$i] = array(
        'organism' => $form_state['values']['organism_' . $i],
        'color' => $form_state['values']['color_' . $i]
      );
    }
    variable_set("tripal_phylogeny_org_colors", $colors);
  }
  if ($form_state['clicked_button']['#name'] == 'add') {
    $form_state['values']['num_orgs']++;
  }
  if ($form_state['clicked_button']['#name'] == 'remove') {
    $form_state['values']['num_orgs']--;
  }
}