function tripal_pub_remote_alter_form_PMID

2.x tripal_pub.PMID.inc tripal_pub_remote_alter_form_PMID($form, $form_state, $num_criteria = 1)
3.x tripal_chado.pub_importer_PMID.inc tripal_pub_remote_alter_form_PMID($form, $form_state, $num_criteria = 1)
1.x PMID.inc tripal_pub_remote_alter_form_PMID($form, $form_state)

A hook for altering the publication importer form. It Changes the 'Abstract' filter to be 'Abstract/Title'.

Parameters

$form: The Drupal form array

$form_state: The form state array

$num_criteria: The number of criteria the user currently has added to the form

Return value

The form (drupal form api)

Related topics

File

tripal_pub/includes/importers/tripal_pub.PMID.inc, line 27
This file provides support for importing and parsing of results from the NCBI PubMed database. The functions here are used by both the publication importer setup form and the publication importer.

Code

function tripal_pub_remote_alter_form_PMID($form, $form_state, $num_criteria = 1) {
  // PubMed doesn't have an 'Abstract' field, so we need to convert the criteria
  // from 'Abstract' to 'Title/Abstract'
  for ($i = 1; $i <= $num_criteria; $i++) {
    $form['themed_element']['criteria'][$i]["scope-$i"]['#options']['abstract'] = 'Abstract/Title';
  }

  return $form;
}