function tripal_cv_form_alter

2.x tripal_cv.module tripal_cv_form_alter(&$form, &$form_state, $form_id)
3.x tripal_cv.module tripal_cv_form_alter(&$form, &$form_state, $form_id)
1.x tripal_cv.module tripal_cv_form_alter(&$form, &$form_state, $form_id)

Implements hook_form_alter(). Alter Forms

Related topics

File

tripal_cv/tripal_cv.module, line 298
Provides functions for managing chado controlled vocabularies which are used ubiquitously throughout chado.

Code

function tripal_cv_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == "tripal_cv_cvterm_form") {
    // updating the form through the ahah callback sets the action of
    // the form to the ahah callback URL. We need to set it back
    // to the normal form URL
    if ($form_state['values']['form_action'] == 'edit') {
      $form['#action'] = url("admin/tripal/tripal_cv/cvterm/edit");
    }
    else {
      $form['#action'] = url("admin/tripal/tripal_cv/cvterm/add");
    }
  }
}