function tripal_analysis_delete_form_submit

2.x tripal_analysis.delete.inc tripal_analysis_delete_form_submit($form, &$form_state)
3.x tripal_analysis.delete.inc tripal_analysis_delete_form_submit($form, &$form_state)

Submit for the delete features form

Related topics

File

tripal_analysis/includes/tripal_analysis.delete.inc, line 48
Administration Interface for deleting multiple analyses

Code

function tripal_analysis_delete_form_submit($form, &$form_state) {
  global $user;

  // Convert the analyses input into an array of just ids.
  $analyses = $form_state['values']['analyses'];
  $org_ids = array();
  foreach ($analyses as $id => $val) {
    if ($val != 0) {
      $org_ids[] = $id;
    }
  }

  if (count($org_ids) > 0) {
    $args = array($org_ids);

    tripal_add_job("Delete analysis", 'tripal_analysis', 
    'tripal_analysis_delete_analyses', $args, $user->uid);
    drupal_set_message(t("analyses will disappear from the list below once the job completes."));
  }
  else {
    drupal_set_message(t("Please select at least one analysis to delete."), "error");
  }
}